Hello everyone,

I've checked out OSG again, rebuilt it completely with debugging
symbols. I checked with ldd which libraries are linked to, and they
are the correct ones. First I thought this happened because I still
had an old OpenThreads library lying around (from the ubuntu repos),
but now that it links with the proper library it still doesn't work.
osgviewer(d) still works.
Here is some more output that might be interesting:

ldd on my executable:
        linux-gate.so.1 =>  (0xb7f3d000)
        libosgd.so.50 => /usr/local/OpenSceneGraph/lib/libosgd.so.50 
(0xb7b35000)
        libosgDBd.so.50 => /usr/local/OpenSceneGraph/lib/libosgDBd.so.50 
(0xb7a28000)
        libosgFXd.so.50 => /usr/local/OpenSceneGraph/lib/libosgFXd.so.50 
(0xb79d6000)
        libosgGAd.so.50 => /usr/local/OpenSceneGraph/lib/libosgGAd.so.50 
(0xb7972000)
        libosgParticled.so.50 =>
/usr/local/OpenSceneGraph/lib/libosgParticled.so.50 (0xb78e5000)
        libosgSimd.so.50 => /usr/local/OpenSceneGraph/lib/libosgSimd.so.50 
(0xb778c000)
        libosgTextd.so.50 => /usr/local/OpenSceneGraph/lib/libosgTextd.so.50
(0xb76cb000)
        libosgUtild.so.50 => /usr/local/OpenSceneGraph/lib/libosgUtild.so.50
(0xb735c000)
        libosgTerraind.so.50 =>
/usr/local/OpenSceneGraph/lib/libosgTerraind.so.50 (0xb72f4000)
        libosgManipulatord.so.50 =>
/usr/local/OpenSceneGraph/lib/libosgManipulatord.so.50 (0xb727f000)
        libosgViewerd.so.50 =>
/usr/local/OpenSceneGraph/lib/libosgViewerd.so.50 (0xb7159000)
        libosgWidgetd.so.50 =>
/usr/local/OpenSceneGraph/lib/libosgWidgetd.so.50 (0xb70d0000)
        libOpenThreadsd.so.11 =>
/usr/local/OpenSceneGraph/lib/libOpenThreadsd.so.11 (0xb70c7000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb6fbf000)
        libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb6f9a000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6f8f000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb6e3f000)
        libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb6e27000)
        libGLU.so.1 => /usr/lib/libGLU.so.1 (0xb6da4000)
        libGL.so.1 => /usr/lib/libGL.so.1 (0xb6d42000)
        libSM.so.6 => /usr/lib/libSM.so.6 (0xb6d3a000)
        libICE.so.6 => /usr/lib/libICE.so.6 (0xb6d22000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0xb6c3b000)
        libXext.so.6 => /usr/lib/libXext.so.6 (0xb6c2c000)
        /lib/ld-linux.so.2 (0xb7f3e000)
        libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0xb6c27000)
        libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0xb6c24000)
        libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0xb6c1e000)
        libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb6c1a000)
        libdrm.so.2 => /usr/lib/libdrm.so.2 (0xb6c10000)
        libxcb-xlib.so.0 => /usr/lib/libxcb-xlib.so.0 (0xb6c0e000)
        libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb6bf6000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0xb6bf2000)
        libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb6bed000)

GDB backtrace:
(gdb) bt
#0  0xb7f20410 in __kernel_vsyscall ()
#1  0xb6e16589 in __lll_lock_wait () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb6e11ba6 in _L_lock_95 () from /lib/tls/i686/cmov/libpthread.so.0
#3  0xb6e1158a in pthread_mutex_lock () from /lib/tls/i686/cmov/libpthread.so.0
#4  0xb6f05ea6 in pthread_mutex_lock () from /lib/tls/i686/cmov/libc.so.6
#5  0xb70afb79 in OpenThreads::Mutex::lock (this=0x805e690) at
/home/max/svn/osg/src/OpenThreads/pthreads/PThreadMutex.c++:122
#6  0xb7dac795 in OpenThreads::ReentrantMutex::lock (this=0x805e690)
at /home/max/svn/osg/include/OpenThreads/ReentrantMutex:43
#7  0xb7ae03d2 in ScopedLock (this=0xbff2715c, [EMAIL PROTECTED]) at
/home/max/svn/osg/include/OpenThreads/ScopedLock:31
#8  0xb7ad03a0 in osgDB::Registry::addReaderWriter (this=0x805e5a8,
rw=0x80606e8) at /home/max/svn/osg/src/osgDB/Registry.cpp:539
#9  0xb6b95f0c in RegisterReaderWriterProxy (this=0xb6bcdab8) at
/home/max/svn/osg/include/osgDB/Registry:668
#10 0xb6b8ebb4 in __static_initialization_and_destruction_0
(__initialize_p=1, __priority=65535)
    at /home/max/svn/osg/src/osgPlugins/OpenFlight/ReaderWriterFLT.cpp:510
#11 0xb6b8ebf4 in global constructors keyed to osgdb_OpenFlight () at
/home/max/svn/osg/src/osgPlugins/OpenFlight/ReaderWriterFLT.cpp:511
#12 0xb6ba8165 in __do_global_ctors_aux () from
/usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflightd.so
#13 0xb6b2d524 in _init () from
/usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflightd.so
#14 0xb7f2e990 in ?? () from /lib/ld-linux.so.2
#15 0xb7f2eac3 in ?? () from /lib/ld-linux.so.2
#16 0xb7f32774 in ?? () from /lib/ld-linux.so.2
#17 0xb7f2e5c6 in ?? () from /lib/ld-linux.so.2
#18 0xb7f31f4e in ?? () from /lib/ld-linux.so.2
#19 0xb6bfe98d in ?? () from /lib/tls/i686/cmov/libdl.so.2
#20 0xb7f2e5c6 in ?? () from /lib/ld-linux.so.2
#21 0xb6bfe2bc in ?? () from /lib/tls/i686/cmov/libdl.so.2
#22 0xb6bfea0f in dlopen () from /lib/tls/i686/cmov/libdl.so.2
#23 0xb7aadb13 in osgDB::DynamicLibrary::getLibraryHandle
([EMAIL PROTECTED]) at
/home/max/svn/osg/src/osgDB/DynamicLibrary.cpp:118
#24 0xb7aae0e4 in osgDB::DynamicLibrary::loadLibrary
([EMAIL PROTECTED]) at
/home/max/svn/osg/src/osgDB/DynamicLibrary.cpp:80
#25 0xb7ad0ef1 in osgDB::Registry::loadLibrary (this=0x805e5a8,
[EMAIL PROTECTED]) at /home/max/svn/osg/src/osgDB/Registry.cpp:714
#26 0xb7ad6ac6 in osgDB::Registry::read (this=0x805e5a8,
[EMAIL PROTECTED]) at
/home/max/svn/osg/src/osgDB/Registry.cpp:1549
#27 0xb7ad7341 in osgDB::Registry::readImplementation (this=0x805e5a8,
[EMAIL PROTECTED], useObjectCache=false)
    at /home/max/svn/osg/src/osgDB/Registry.cpp:1646
#28 0xb7ad7531 in osgDB::Registry::readNodeImplementation
(this=0x805e5a8, [EMAIL PROTECTED], options=0x0)
    at /home/max/svn/osg/src/osgDB/Registry.cpp:1851
#29 0xb7aab71d in osgDB::Registry::readNode (this=0x805e5a8,
[EMAIL PROTECTED], options=0x0, buildKdTreeIfRequired=true)
    at /home/max/svn/osg/include/osgDB/Registry:237
#30 0xb7accdc8 in osgDB::readNodeFile ([EMAIL PROTECTED],
options=0x0) at /home/max/svn/osg/src/osgDB/ReadFile.cpp:69
#31 0xb7ace2ce in osgDB::readNodeFiles ([EMAIL PROTECTED],
options=0x0) at /home/max/svn/osg/src/osgDB/ReadFile.cpp:221
#32 0x0805308b in osgDB::readNodeFiles ([EMAIL PROTECTED]) at
/usr/local/OpenSceneGraph/include/osgDB/ReadFile:132
#33 0x08052cd8 in main (argc=2, argv=0xbff27bf4) at src/main.cc:30
(gdb) f 6
#6  0xb7dac795 in OpenThreads::ReentrantMutex::lock (this=0x805e690)
at /home/max/svn/osg/include/OpenThreads/ReentrantMutex:43
43                      int result = Mutex::lock();
(gdb) l
38                      ++_lockCount;
39                      return 0;
40                  }
41                  else
42                  {
43                      int result = Mutex::lock();
44                      if (result==0)
45                      {
46                          OpenThreads::ScopedLock<OpenThreads::Mutex>
lock(_lockCountMutex);
47      
(gdb) disp _threadHoldingMutex
1: this->_threadHoldingMutex = (class OpenThreads::Thread *) 0x0
(gdb) info thr
* 1 Thread 0xb6bce6c0 (LWP 14709)  0xb7dac795 in
OpenThreads::ReentrantMutex::lock (this=0x805e690)
    at /home/max/svn/osg/include/OpenThreads/ReentrantMutex:43

The _threadHoldingMutex is NULL, is that ok? Also, there is only one thread.

Any further ideas? I'm pretty sure I'm doing something wrong because
osgviewer works.

Thanks for all the help,
Max

On Mon, Nov 3, 2008 at 6:29 PM, Csaba Halász <[EMAIL PROTECTED]> wrote:
> On Mon, Nov 3, 2008 at 6:12 PM, Robert Osfield <[EMAIL PROTECTED]> wrote:
>>
>> If this all fails then it looks like there is a bug in ReentrantMutex.
>
> Hmm, looking at it, I wonder why the thread checking is disabled in
> the unlock path? Is it for performance reasons? (couldn't find the
> relevant svn comment) Don't think this could cause deadlock, rather
> quite the opposite.
> Also, is the _lockCountMutex at all necessary? At first glance the
> _lockCount value is only ever modified from the owner thread and that
> can not cause problems.
>
> --
> Csaba
> _______________________________________________
> 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

Reply via email to