Hi Rafa, How do you go about reproducing the problem under Ubuntu?
Robert On 19 April 2012 12:37, Rafa Gaitan <[email protected]> wrote: > Hi Robert, > > I can confirm than same occurs on Ubuntu 10.04 64 bits. > > Reverting changes works as expected, so is not only an Android problem. > > Backtace: > 0x0000000000ba19f9 in ScopedLock (this=0x7fffffffdf00, m=...) at > /home/rgaitan/Projects/OSG/osg-trunk/include/OpenThreads/ScopedLock:31 > 31 explicit ScopedLock(M& m):m_lock(m) {m_lock.lock();} > (gdb) backtrace > #0 0x0000000000ba19f9 in ScopedLock (this=0x7fffffffdf00, m=...) at > /home/rgaitan/Projects/OSG/osg-trunk/include/OpenThreads/ScopedLock:31 > #1 0x0000000000ec4632 in Scene (this=0x1c8df10) at > /home/rgaitan/Projects/OSG/osg-trunk/src/osgViewer/Scene.cpp:39 > #2 0x0000000000e74cea in View (this=0x1c8d530, __in_chrg=<value > optimized out>, __vtt_parm=<value optimized out>) at > /home/rgaitan/Projects/OSG/osg-trunk/src/osgViewer/View.cpp:145 > #3 0x000000000103fb7e in __static_initialization_and_destruction_0 > (__initialize_p=1, __priority=65535) at > /home/rgaitan/Projects/OSG/osg-trunk/src/osgWrappers/deprecated-dotosg/osgViewer/View.cpp:22 > #4 0x000000000103fcb1 in global constructors keyed to > dotosgwrapper_View_Proxy () at > /home/rgaitan/Projects/OSG/osg-trunk/src/osgWrappers/deprecated-dotosg/osgViewer/View.cpp:292 > #5 0x000000000147afb6 in __do_global_ctors_aux () > #6 0x0000000000b8e3eb in _init () > #7 0x0000000001abd010 in ?? () > #8 0x000000000147af35 in __libc_csu_init () > #9 0x00007ffff5fadbe0 in __libc_start_main (main=<value optimized > out>, argc=<value optimized out>, ubp_av=<value optimized out>, > init=0x147aef0 <__libc_csu_init>, fini=0x1, > rtld_fini=0x7ffff630de48 <main_arena+8>, stack_end=0x7fffffffe148) > at libc-start.c:185 > #10 0x0000000000b90889 in _start () > > > Cheers, > Rafa. > > > El día 19 de abril de 2012 12:32, Rafa Gaitan <[email protected]> > escribió: >> Hi Robert, >> >> Working with Jorge we have spot than lastest changes in Scene.cpp has >> broken execution for Android devices. The change is: >> >> Index: src/osgViewer/Scene.cpp >> =================================================================== >> --- src/osgViewer/Scene.cpp (revision 13030) >> +++ src/osgViewer/Scene.cpp (revision 13031) >> @@ -18,15 +18,15 @@ >> >> typedef std::vector< osg::observer_ptr<Scene> > SceneCache; >> >> +static SceneCache s_sceneCache; >> static SceneCache& getSceneCache() >> { >> - static SceneCache s_sceneCache; >> return s_sceneCache; >> } >> >> +static OpenThreads::Mutex s_sceneCacheMutex; >> static OpenThreads::Mutex& getSceneCacheMutex() >> { >> - static OpenThreads::Mutex s_sceneCacheMutex; >> return s_sceneCacheMutex; >> } >> >> Looks like static initialization is not correctly done (Android >> building currently builds in static), and crashes trying to do a >> ScopedLock. >> >> Comes to my mind two possible solutions: >> 1. Keep SceneCache inside osgDB::Registry to solve exit() problems you >> mentioned in the commit and global static initialization of the mutex >> and the cache for android. >> 2. Create a Singleton class (SceneCacheSingleton) that creates >> correctly both variables to solve both problems too. >> >> both methods allows us to maintain compatibility using 'getSceneCache' >> and 'getSceneCacheMutex' and calling the correct Singleton. >> >> I prefer 1st solution but maybe you have another idea or solution to >> this issue. Thoughts? >> >> Cheers, >> Rafa. >> >> -- >> Rafael Gaitán Linares >> CTO at Mirage Technologies S.L - http://www.mirage-tech.com >> gvSIG3D Developer - http://gvsig3d.blogspot.com > > > > -- > Rafael Gaitán Linares > CTO at Mirage Technologies S.L - http://www.mirage-tech.com > gvSIG3D Developer - http://gvsig3d.blogspot.com > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

