osgart crashed on MAC Snowleopard

Community support forum for users of the GPL-licensed osgART Standard Edition v1.0 and proprietary-licensed osgART Professional Edition v1.1
topscores
Posts: 2
Joined: Wed Dec 19, 2007 6:08 am

osgart crashed on MAC Snowleopard

Postby topscores » Thu Aug 18, 2011 1:15 am

I'm using osgart2.0.0-rc3 with osg-2.8.4. I found that whenever I assign an instance of a class that has osgART::video as a member variable to a static variable, my program seems to double delete osgART::video variable and causes segmentation fault on exit. The simplified version of my source code is shown below. I'm not sure whether I did something wrong or not. Has anybody experienced same problem?

Code: Select all

#include <osg/Node>
#include <osgART/Foundation>
#include <osgART/PluginManager>

using namespace osg;

class Test : public Referenced
{
public:
   Test(){}
   ~Test(){}
   
   ref_ptr<osgART::Video> video;
};

int main()
{
   static ref_ptr<Test> test = new Test();//Singleton<Test>::getInstance();
   int _video_id = osgART::PluginManager::instance()->load("osgart_video_artoolkit2");
   test->video = dynamic_cast<osgART::Video*>(osgART::PluginManager::instance()->get(_video_id));
   return 0;
}


here is the stack trace

Process: ARAppOsgViewer [1894]
Path: /Users/topscores/Documents/XCode/osgart_build/AREngine-osg2.8.4-carbon/bin/ARAppOsgViewer.app/Contents/MacOS/ARAppOsgViewer
Identifier: ARAppOsgViewer
Version: ??? ()
Code Type: X86 (Native)
Parent Process: bash [646]

Date/Time: 2011-08-18 16:13:34.628 +0700
OS Version: Mac OS X 10.6.7 (10J4138)
Report Version: 6

Interval Since Last Report: 4009124 sec
Crashes Since Last Report: 140
Per-App Crashes Since Last Report: 33
Anonymous UUID: 07219D79-305F-4937-811E-455FF07DDB6A

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000992270
Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 ARAppOsgViewer 0x000076f2 osg::Referenced::unref() const + 76 (Referenced:183)
1 ARAppOsgViewer 0x0000771a osg::ref_ptr<osgART::Video>::~ref_ptr() + 28 (ref_ptr:33)
2 ARAppOsgViewer 0x00007748 Test::~Test() + 34 (ARAppOsgViewer.cpp:72)
3 ARAppOsgViewer 0x000076fc osg::Referenced::unref() const + 86 (Referenced:185)
4 ARAppOsgViewer 0x0000782a osg::ref_ptr<Test>::~ref_ptr() + 28 (ref_ptr:33)
5 ARAppOsgViewer 0x000073b9 __tcf_0 + 19 (ARAppOsgViewer.cpp:90)
6 libSystem.B.dylib 0x94baa1bf __cxa_finalize + 208
7 libSystem.B.dylib 0x94baa0d4 exit + 33
8 ARAppOsgViewer 0x000072a1 start + 61

Thread 1: Dispatch queue: com.apple.libdispatch-manager
0 libSystem.B.dylib 0x94bb1942 kevent + 10
1 libSystem.B.dylib 0x94bb205c _dispatch_mgr_invoke + 215
2 libSystem.B.dylib 0x94bb1519 _dispatch_queue_invoke + 163
3 libSystem.B.dylib 0x94bb12be _dispatch_worker_thread2 + 240
4 libSystem.B.dylib 0x94bb0d41 _pthread_wqthread + 390
5 libSystem.B.dylib 0x94bb0b86 start_wqthread + 30

Thread 2:
0 libSystem.B.dylib 0x94bb09d2 __workq_kernreturn + 10
1 libSystem.B.dylib 0x94bb0f68 _pthread_wqthread + 941
2 libSystem.B.dylib 0x94bb0b86 start_wqthread + 30

Thread 0 crashed with X86 Thread State (32-bit):
eax: 0x00992270 ebx: 0x94baa0fd ecx: 0x003a8a18 edx: 0x00a113e8
edi: 0x0000000f esi: 0x01006308 ebp: 0xbffff0c8 esp: 0xbffff0a0
ss: 0x00000023 efl: 0x00010212 eip: 0x000076f2 cs: 0x0000001b
ds: 0x00000023 es: 0x00000023 fs: 0x00000000 gs: 0x0000000f
cr2: 0x00992270

Return to “[ARCHIVED] osgART Standard & Professional Editions”

Who is online

Users browsing this forum: No registered users and 2 guests