Greetings.
OpenSG 2.0 (64-bit Vista DLL) is crashing in its exit routines after
having loaded a ".wrl" file into a SimpleSceneManager. The app runs
fine until the window closes and the app quits. Also, it exits cleanly
if I use a hard-coded scene instead of loading from a "wrl" file.
It fails differently depending on whether I explicitly call osgExit(),
or let the atexit functions handle the cleanup, but it fails in either
case.
If I /don't/ explicitly call osgExit(), then the app fails like so:
Unhandled exception ... Access violation reading location
0xffffffffffffffff.
OSGBaseD.dll!000007feee67d993()
[Frames below may be incorrect and/or missing, no symbols loaded for
OSGBaseD.dll]
OSGDynamicsD.dll!000007feec6fc446()
OSGDynamicsD.dll!000007feec6fd42f()
OSGDynamicsD.dll!000007feec6fc4a6()
OSGDynamicsD.dll!000007feec6f7b58()
OSGDynamicsD.dll!000007feec6fe9f4()
OSGBaseD.dll!000007feee52f71e()
OSGBaseD.dll!000007feee527b66()
OSGBaseD.dll!000007feee528daf()
> MyDLL-d.dll!_CRT_INIT(void * hDllHandle=0x000007feeff10000, unsigned
> long dwReason=0, void * lpreserved=0x0000000000000001) Line 446 C
MyDLL-d.dll!__DllMainCRTStartup(void * hDllHandle=0x000007feeff10000,
unsigned long dwReason=0, void * lpreserved=0x0000000000000001) Line 557 +
0x13 bytes C
MyDLL-d.dll!_DllMainCRTStartup(void * hDllHandle=0x000007feeff10000,
unsigned long dwReason=0, void * lpreserved=0x0000000000000001) Line 508 C
ntdll.dll!0000000077450507()
ntdll.dll!0000000077450310()
msvcr90d.dll!000000005ce3293b()
msvcr90d.dll!000000005ce3275e()
msvcr90d.dll!000000005ce32316()
MyApp-d.exe!__tmainCRTStartup() Line 595 C
MyApp-d.exe!mainCRTStartup() Line 399 C
kernel32.dll!000000007724be3d()
ntdll.dll!0000000077456a51()
If I /do/ explicitly call osgExit(), I get this:
WARNING: FieldContainerFactoryBase::terminate: Entry [244] is not NULL
([0000000002A97EE0]).
WARNING: [0] [0000000002A97940] [TextureEnvChunk] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [253] is not NULL
([0000000002AAA7F0]).
WARNING: [0] [0000000002AA9FB0] [VRMLGenericAtt] [5 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [258] is not NULL
([0000000002AC9210]).
WARNING: [0] [0000000002B08B20] [WIN32Window] [2 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [410] is not NULL
([0000000002BEE510]).
WARNING: [0] [0000000002BEE0E0] [Node] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [411] is not NULL
([0000000002BEEB80]).
WARNING: [0] [0000000002BEE710] [MaterialGroup] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [412] is not NULL
([0000000002BF0420]).
WARNING: [0] [0000000002BEEDE0] [VRMLGenericAtt] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [413] is not NULL
([0000000002BF0E60]).
WARNING: [0] [0000000002BF0A30] [Node] [2 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [414] is not NULL
([0000000002BF1450]).
WARNING: [0] [0000000002BF0FE0] [Group] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [415] is not NULL
([0000000002BF1D50]).
WARNING: [0] [0000000002BF18D0] [ChunkMaterial] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [416] is not NULL
([0000000002BF3570]).
WARNING: [0] [0000000002BF1ED0] [VRMLGenericAtt] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [417] is not NULL
([0000000002BF4920]).
WARNING: [0] [0000000002BF4400] [MaterialChunk] [2 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [418] is not NULL
([0000000002BF4FD0]).
WARNING: [0] [0000000002BF4DB0] [Node] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [419] is not NULL
([0000000002BF5810]).
WARNING: [0] [0000000002BF51D0] [Geometry] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [420] is not NULL
([0000000002BF72C0]).
WARNING: [0] [0000000002BF5C80] [VRMLGenericAtt] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [421] is not NULL
([0000000002BF9BC0]).
WARNING: [0] [0000000002BF9790] [GeoPnt3fProperty] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [422] is not NULL
([0000000002BFB440]).
WARNING: [0] [0000000002BF9E00] [VRMLGenericAtt] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [423] is not NULL
([0000000002BFC0E0]).
WARNING: [0] [0000000002BFBD10] [GeoVec3fProperty] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [424] is not NULL
([0000000002BFD960]).
WARNING: [0] [0000000002BFC320] [VRMLGenericAtt] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [425] is not NULL
([0000000002BFE6B0]).
WARNING: [0] [0000000002BFE180] [GeoUInt32Property] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [426] is not NULL
([0000000002BFF030]).
WARNING: [0] [0000000002BFEC70] [GeoUInt32Property] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [427] is not NULL
([0000000002BFF820]).
WARNING: [0] [0000000002BFF2F0] [GeoUInt8Property] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [428] is not NULL
([0000000002C00380]).
WARNING: [0] [0000000002BFFE50] [GeoUInt32Property] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [429] is not NULL
([0000000002B75C60]).
WARNING: [0] [0000000002B758A0] [Node] [2 3]
WARNING: FieldContainerFactoryBase::terminate: Entry [430] is not NULL
([0000000002C29C60]).
WARNING: [0] [0000000002B75DE0] [Transform] [2 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [431] is not NULL
([0000000002C2A370]).
WARNING: [0] [0000000002C29F40] [Node] [2 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [432] is not NULL
([0000000002B81090]).
WARNING: [0] [0000000002C2ABF0] [DirectionalLight] [2 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [433] is not NULL
([0000000002B81730]).
WARNING: [0] [0000000002B813E0] [PerspectiveCamera] [2 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [434] is not NULL
([0000000002B81C00]).
WARNING: [0] [0000000002B818B0] [SolidBackground] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [435] is not NULL
([0000000002B82280]).
WARNING: [0] [0000000002B81E00] [ImageForeground] [2 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [436] is not NULL
([0000000002BA9560]).
WARNING: [0] [0000000002B82400] [SimpleStatisticsForeground] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [437] is not NULL
([0000000002BC3850]).
WARNING: [0] [0000000002BC3490] [Viewport] [2 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [438] is not NULL
([0000000002AB4390]).
WARNING: [0] [0000000002AB4200] [State] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [439] is not NULL
([0000000002BC4490]).
WARNING: [0] [0000000002BC4190] [LightChunk] [1 0]
WARNING: FieldContainerFactoryBase::terminate: Entry [440] is not NULL
([0000000002B0A1F0]).
WARNING: [0] [0000000002B09DD0] [DrawableStatsAttachment] [1 0]
WARNING: ThreadManager::shutdown: thread [OSGThread_1|0000000002AC9500]
is still alive ([0]).
WARNING: ThreadManager::shutdown: lock [OSGLock_6|0000000002AC9BE0] is
still alive
WARNING: ThreadManager::shutdown: semaphore
[OSGSemaphore_0|0000000002AC9DD0] is still alive
Unhandled exception ... Access violation reading location
0x0000000000000000.
OSGBaseD.dll!000007feee6a8910()
[Frames below may be incorrect and/or missing, no symbols loaded for
OSGBaseD.dll]
OSGBaseD.dll!000007feee5ee87f()
OSGBaseD.dll!000007feee67d923()
> MyDLL-d.dll!OSG::RecordedRefCountPolicy::subRef(OSG::FieldContainer *
> const objectP=0x0000000002b08b20) Line 66 C++
MyDLL-d.dll!OSG::RefCountPtr<OSG::WIN32Window,OSG::RecordedRefCountPolicy>::~RefCountPtr<OSG::WIN32Window,OSG::RecordedRefCountPolicy>()
Line 111 C++
MyDLL-d.dll!Jugular::Win32Window::~Win32Window() Line 29 + 0x1d bytes
C++
MyDLL-d.dll!Jugular::Win32Window::`scalar deleting destructor'() +
0x31 bytes C++
MyDLL-d.dll!boost::checked_delete<Jugular::Win32Window>(Jugular::Win32Window *
x=0x0000000002b10be0) Line 34 + 0x2b bytes C++
MyDLL-d.dll!boost::detail::sp_counted_impl_p<Jugular::Win32Window>::dispose()
Line 79 C++
MyDLL-d.dll!boost::detail::sp_counted_base::release() Line 103 C++
MyDLL-d.dll!boost::detail::shared_count::~shared_count() Line 220
C++
MyDLL-d.dll!boost::shared_ptr<Jugular::Win32Window>::~shared_ptr<Jugular::Win32Window>()
+ 0x31 bytes C++
MyDLL-d.dll!Jugular::App::~App() Line 25 + 0x4a bytes C++
MyDLL-d.dll!Jugular::Main(int argc=2, char * * argv=0x000000000271c760)
Line 73 C++
MyApp-d.exe!main(int argc=2, char * * argv=0x000000000271c760) Line 75
C++
MyApp-d.exe!__tmainCRTStartup() Line 582 + 0x19 bytes C
MyApp-d.exe!mainCRTStartup() Line 399 C
kernel32.dll!000000007724be3d()
ntdll.dll!0000000077456a51()
Some notes on the program structure:
* The ".wrl" file contains only a simple tetrahedron -- a single
IndexedFaceSet with no texture.
* I'm managing OpenSG from within my own DLL.
* MyDLL's entry function allocates an App object on the stack.
* The App's data members are:
OSG::SimpleSceneManagerRefPtr m_SceneManager;
boost::shared_ptr<Win32Window> m_Window; // NOT OSG::WIN32Window
std::string m_Name;
* The Win32Window's data members are:
HWND m_hwnd;
OSG::WIN32WindowRefPtr m_osgWindow;
boost::shared_ptr<Win32MessageController> m_msgController;
* The Win32MessageController's data members are:
OSG::SimpleSceneManagerRefPtr m_sceneManager;
* I call OSG::osgExit() just before the App object goes out of scope
and its d'tor is called. There are no explicit references to any
OSG objects beyond that point, but there is a chain of d'tors for
OSG::RefCountPtrs, OSG::RecordedRefCountPolicys, and
boost::shared_ptrs
* I note that there are two OSG::SimpleSceneManagerRefPtr's referencing
the same object, to be cleaned up in the d'tor chain. Is that a
problem? (And why would that be sensitive to whether or not the
scene was loaded from a ".wrl" file?)
Sorry for the length of this message.
Thanks for any news or advice.
--
Ted Hall <[email protected]>
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users