OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

deadlock loading io plugin?

Goto page 1, 2  Next
 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Max Pfingsthorn
Guest





PostPosted: Mon Nov 03, 2008 4:08 pm    Post subject:
deadlock loading io plugin?
Reply with quote

Dear list,

I have a very simple program such as this:

int main(int argc, char** argv) {
osg::ArgumentParser arguments(&argc,argv);
cout << "start!" << endl;

osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);

if (!loadedModel)
{
cout << argv[0] <<": No data loaded" << endl;
return 1;
}

cout << "loaded" << endl;
}

I'm using the current trunk of OSG (updated 30 mins ago) on Ubuntu
8.04. The program hangs on the line with osgDB::readNodeFiles. I have
no idea why.

This is what GDB says:

#0 0xb7fc8410 in __kernel_vsyscall ()
#1 0xb75c4589 in __lll_lock_wait () from /lib/tls/i686/cmov/libpthread.so.0
#2 0xb75bfba6 in _L_lock_95 () from /lib/tls/i686/cmov/libpthread.so.0
#3 0xb75bf58a in pthread_mutex_lock () from /lib/tls/i686/cmov/libpthread.so.0
#4 0xb76b3ea6 in pthread_mutex_lock () from /lib/tls/i686/cmov/libc.so.6
#5 0xb785ce43 in OpenThreads::Mutex::lock () from
/usr/local/OpenSceneGraph/lib/libOpenThreads.so.11
#6 0xb7ea30c1 in OpenThreads::ReentrantMutex::lock () from
/usr/local/OpenSceneGraph/lib/libosg.so.50
#7 0xb7d4bcbc in osgDB::Registry::addReaderWriter () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#8 0xb7350e0e in __static_initialization_and_destruction_0 () from
/usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflight.so
#9 0xb7364325 in __do_global_ctors_aux () from
/usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflight.so
#10 0xb730bb50 in _init () from
/usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflight.so
#11 0xb7fd6990 in ?? () from /lib/ld-linux.so.2
#12 0xb7fd6ac3 in ?? () from /lib/ld-linux.so.2
#13 0xb7fda774 in ?? () from /lib/ld-linux.so.2
#14 0xb7fd65c6 in ?? () from /lib/ld-linux.so.2
#15 0xb7fd9f4e in ?? () from /lib/ld-linux.so.2
#16 0xb73ac98d in ?? () from /lib/tls/i686/cmov/libdl.so.2
#17 0xb7fd65c6 in ?? () from /lib/ld-linux.so.2
#18 0xb73ac2bc in ?? () from /lib/tls/i686/cmov/libdl.so.2
#19 0xb73aca0f in dlopen () from /lib/tls/i686/cmov/libdl.so.2
#20 0xb7d26005 in osgDB::DynamicLibrary::getLibraryHandle () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#21 0xb7d262a9 in osgDB::DynamicLibrary::loadLibrary () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#22 0xb7d4875c in osgDB::Registry::loadLibrary () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#23 0xb7d57b25 in osgDB::Registry::read () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#24 0xb7d58d35 in osgDB::Registry::readImplementation () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#25 0xb7d594b4 in osgDB::Registry::readNodeImplementation () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#26 0xb7d44fed in osgDB::readNodeFile () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#27 0xb7d46651 in osgDB::readNodeFiles () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#28 0x080511ab in osgDB::readNodeFiles (parser=@0xbfc26014) at
/usr/local/OpenSceneGraph/include/osgDB/ReadFile:132
#29 0x08050df8 in main (argc=2, argv=0xbfc260e4) at src/main.cc:30

This looks like there is a deadlock somewhere, otherwise
pthread_mutex_lock() wouldn't block. The same happens with cessna.osg
file from the sample files, however frames 8-10 are in osgdb_osg.so,
of course. Any ideas? I've already rebuilt OSG once, no luck.

Thank you!
max


------------------
Post generated by Mail2Forum
Back to top
Robert Osfield
Guest





PostPosted: Mon Nov 03, 2008 4:44 pm    Post subject:
deadlock loading io plugin?
Reply with quote

Hi Max,

Do the osg examples fail in a similar way?

Could you do a clean build of the OSG and your app and try again?

Robert.

On Mon, Nov 3, 2008 at 4:08 PM, Max Pfingsthorn
<> wrote:
Quote:
Dear list,

I have a very simple program such as this:

int main(int argc, char** argv) {
osg::ArgumentParser arguments(&argc,argv);
cout << "start!" << endl;

osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);

if (!loadedModel)
{
cout << argv[0] <<": No data loaded" << endl;
return 1;
}

cout << "loaded" << endl;
}

I'm using the current trunk of OSG (updated 30 mins ago) on Ubuntu
8.04. The program hangs on the line with osgDB::readNodeFiles. I have
no idea why.

This is what GDB says:

#0 0xb7fc8410 in __kernel_vsyscall ()
#1 0xb75c4589 in __lll_lock_wait () from /lib/tls/i686/cmov/libpthread.so.0
#2 0xb75bfba6 in _L_lock_95 () from /lib/tls/i686/cmov/libpthread.so.0
#3 0xb75bf58a in pthread_mutex_lock () from /lib/tls/i686/cmov/libpthread.so.0
#4 0xb76b3ea6 in pthread_mutex_lock () from /lib/tls/i686/cmov/libc.so.6
#5 0xb785ce43 in OpenThreads::Mutex::lock () from
/usr/local/OpenSceneGraph/lib/libOpenThreads.so.11
#6 0xb7ea30c1 in OpenThreads::ReentrantMutex::lock () from
/usr/local/OpenSceneGraph/lib/libosg.so.50
#7 0xb7d4bcbc in osgDB::Registry::addReaderWriter () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#8 0xb7350e0e in __static_initialization_and_destruction_0 () from
/usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflight.so
#9 0xb7364325 in __do_global_ctors_aux () from
/usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflight.so
#10 0xb730bb50 in _init () from
/usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflight.so
#11 0xb7fd6990 in ?? () from /lib/ld-linux.so.2
#12 0xb7fd6ac3 in ?? () from /lib/ld-linux.so.2
#13 0xb7fda774 in ?? () from /lib/ld-linux.so.2
#14 0xb7fd65c6 in ?? () from /lib/ld-linux.so.2
#15 0xb7fd9f4e in ?? () from /lib/ld-linux.so.2
#16 0xb73ac98d in ?? () from /lib/tls/i686/cmov/libdl.so.2
#17 0xb7fd65c6 in ?? () from /lib/ld-linux.so.2
#18 0xb73ac2bc in ?? () from /lib/tls/i686/cmov/libdl.so.2
#19 0xb73aca0f in dlopen () from /lib/tls/i686/cmov/libdl.so.2
#20 0xb7d26005 in osgDB::DynamicLibrary::getLibraryHandle () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#21 0xb7d262a9 in osgDB::DynamicLibrary::loadLibrary () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#22 0xb7d4875c in osgDB::Registry::loadLibrary () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#23 0xb7d57b25 in osgDB::Registry::read () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#24 0xb7d58d35 in osgDB::Registry::readImplementation () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#25 0xb7d594b4 in osgDB::Registry::readNodeImplementation () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#26 0xb7d44fed in osgDB::readNodeFile () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#27 0xb7d46651 in osgDB::readNodeFiles () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#28 0x080511ab in osgDB::readNodeFiles (parser=@0xbfc26014) at
/usr/local/OpenSceneGraph/include/osgDB/ReadFile:132
#29 0x08050df8 in main (argc=2, argv=0xbfc260e4) at src/main.cc:30

This looks like there is a deadlock somewhere, otherwise
pthread_mutex_lock() wouldn't block. The same happens with cessna.osg
file from the sample files, however frames 8-10 are in osgdb_osg.so,
of course. Any ideas? I've already rebuilt OSG once, no luck.

Thank you!
max




------------------
Post generated by Mail2Forum
Back to top
Csaba Halász
Guest





PostPosted: Mon Nov 03, 2008 5:01 pm    Post subject:
deadlock loading io plugin?
Reply with quote

On Mon, Nov 3, 2008 at 5:08 PM, Max Pfingsthorn
<> wrote:
Quote:

I'm using the current trunk of OSG (updated 30 mins ago) on Ubuntu
8.04. The program hangs on the line with osgDB::readNodeFiles. I have
no idea why.

This is what GDB says:
#6 0xb7ea30c1 in OpenThreads::ReentrantMutex::lock () from
/usr/local/OpenSceneGraph/lib/libosg.so.50

Works here.
As the call stack shows a ReentrantMutex, the thread can not deadlock
on itself. Thus, another thread must be involved. Please check call
stacks for all threads. Also, if you have debugging symbols, you could
check the _threadHoldingMutex member of the ReentrantMutex to see who
is the owner.

--
Csaba


------------------
Post generated by Mail2Forum
Back to top
Max Pfingsthorn
Guest





PostPosted: Mon Nov 03, 2008 5:07 pm    Post subject:
deadlock loading io plugin?
Reply with quote

Hi Robert,

no, it doesn't seem so. The osgviewer works fine. I did a clean build
just before.

There is only one thread says "info threads"...

I'm stumped. Seems only to happen on apps I compile seperately.

Cheers,
max

Robert Osfield wrote:
Quote:
Hi Max,

Do the osg examples fail in a similar way?

Could you do a clean build of the OSG and your app and try again?

Robert.

On Mon, Nov 3, 2008 at 4:08 PM, Max Pfingsthorn
<> wrote:
Quote:
Dear list,

I have a very simple program such as this:

int main(int argc, char** argv) {
osg::ArgumentParser arguments(&argc,argv);
cout << "start!" << endl;

osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);

if (!loadedModel)
{
cout << argv[0] <<": No data loaded" << endl;
return 1;
}

cout << "loaded" << endl;
}

I'm using the current trunk of OSG (updated 30 mins ago) on Ubuntu
8.04. The program hangs on the line with osgDB::readNodeFiles. I have
no idea why.

This is what GDB says:

#0 0xb7fc8410 in __kernel_vsyscall ()
#1 0xb75c4589 in __lll_lock_wait () from /lib/tls/i686/cmov/libpthread.so.0
#2 0xb75bfba6 in _L_lock_95 () from /lib/tls/i686/cmov/libpthread.so.0
#3 0xb75bf58a in pthread_mutex_lock () from /lib/tls/i686/cmov/libpthread.so.0
#4 0xb76b3ea6 in pthread_mutex_lock () from /lib/tls/i686/cmov/libc.so.6
#5 0xb785ce43 in OpenThreads::Mutex::lock () from
/usr/local/OpenSceneGraph/lib/libOpenThreads.so.11
#6 0xb7ea30c1 in OpenThreads::ReentrantMutex::lock () from
/usr/local/OpenSceneGraph/lib/libosg.so.50
#7 0xb7d4bcbc in osgDB::Registry::addReaderWriter () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#8 0xb7350e0e in __static_initialization_and_destruction_0 () from
/usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflight.so
#9 0xb7364325 in __do_global_ctors_aux () from
/usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflight.so
#10 0xb730bb50 in _init () from
/usr/local/OpenSceneGraph/lib/osgPlugins-2.7.5/osgdb_openflight.so
#11 0xb7fd6990 in ?? () from /lib/ld-linux.so.2
#12 0xb7fd6ac3 in ?? () from /lib/ld-linux.so.2
#13 0xb7fda774 in ?? () from /lib/ld-linux.so.2
#14 0xb7fd65c6 in ?? () from /lib/ld-linux.so.2
#15 0xb7fd9f4e in ?? () from /lib/ld-linux.so.2
#16 0xb73ac98d in ?? () from /lib/tls/i686/cmov/libdl.so.2
#17 0xb7fd65c6 in ?? () from /lib/ld-linux.so.2
#18 0xb73ac2bc in ?? () from /lib/tls/i686/cmov/libdl.so.2
#19 0xb73aca0f in dlopen () from /lib/tls/i686/cmov/libdl.so.2
#20 0xb7d26005 in osgDB::DynamicLibrary::getLibraryHandle () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#21 0xb7d262a9 in osgDB::DynamicLibrary::loadLibrary () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#22 0xb7d4875c in osgDB::Registry::loadLibrary () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#23 0xb7d57b25 in osgDB::Registry::read () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#24 0xb7d58d35 in osgDB::Registry::readImplementation () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#25 0xb7d594b4 in osgDB::Registry::readNodeImplementation () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#26 0xb7d44fed in osgDB::readNodeFile () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#27 0xb7d46651 in osgDB::readNodeFiles () from
/usr/local/OpenSceneGraph/lib/libosgDB.so.50
#28 0x080511ab in osgDB::readNodeFiles (parser=@0xbfc26014) at
/usr/local/OpenSceneGraph/include/osgDB/ReadFile:132
#29 0x08050df8 in main (argc=2, argv=0xbfc260e4) at src/main.cc:30

This looks like there is a deadlock somewhere, otherwise
pthread_mutex_lock() wouldn't block. The same happens with cessna.osg
file from the sample files, however frames 8-10 are in osgdb_osg.so,
of course. Any ideas? I've already rebuilt OSG once, no luck.

Thank you!
max





------------------
Post generated by Mail2Forum
Back to top
Robert Osfield
Guest





PostPosted: Mon Nov 03, 2008 5:12 pm    Post subject:
deadlock loading io plugin?
Reply with quote

Hi Max,

On Mon, Nov 3, 2008 at 5:06 PM, Max Pfingsthorn
<> wrote:
Quote:
no, it doesn't seem so. The osgviewer works fine. I did a clean build
just before.

There is only one thread says "info threads"...

I'm stumped. Seems only to happen on apps I compile seperately.

Check if you have other OSG libs that you might be linking to, as
there is chance that you are compiling against one version of the OSG
but linking at runtime to another. It might be worth doing removing
the CMakeCache.txt on the OSG and your app and then re-run CMake to
make sure that it everything is wired up correctly.

If this all fails then it looks like there is a bug in ReentrantMutex.
Recreating elsewhere will be the key to tracking it down and fixing
it.

Robert.


------------------
Post generated by Mail2Forum
Back to top
Csaba Halász
Guest





PostPosted: Mon Nov 03, 2008 5:35 pm    Post subject:
deadlock loading io plugin?
Reply with quote

On Mon, Nov 3, 2008 at 6:12 PM, Robert Osfield <> wrote:
Quote:

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


------------------
Post generated by Mail2Forum
Back to top
Max Pfingsthorn
Guest





PostPosted: Tue Nov 04, 2008 9:46 am    Post subject:
deadlock loading io plugin?
Reply with quote

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, m=@0x805e690) 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
(libraryName=@0xbff275e8) at
/home/max/svn/osg/src/osgDB/DynamicLibrary.cpp:118
#24 0xb7aae0e4 in osgDB::DynamicLibrary::loadLibrary
(libraryName=@0xbff276f8) at
/home/max/svn/osg/src/osgDB/DynamicLibrary.cpp:80
#25 0xb7ad0ef1 in osgDB::Registry::loadLibrary (this=0x805e5a8,
fileName=@0xbff276f8) at /home/max/svn/osg/src/osgDB/Registry.cpp:714
#26 0xb7ad6ac6 in osgDB::Registry::read (this=0x805e5a8,
readFunctor=@0xbff27804) at
/home/max/svn/osg/src/osgDB/Registry.cpp:1549
#27 0xb7ad7341 in osgDB::Registry::readImplementation (this=0x805e5a8,
readFunctor=@0xbff27804, useObjectCache=false)
at /home/max/svn/osg/src/osgDB/Registry.cpp:1646
#28 0xb7ad7531 in osgDB::Registry::readNodeImplementation
(this=0x805e5a8, fileName=@0xbff279bc, options=0x0)
at /home/max/svn/osg/src/osgDB/Registry.cpp:1851
#29 0xb7aab71d in osgDB::Registry::readNode (this=0x805e5a8,
fileName=@0xbff279bc, options=0x0, buildKdTreeIfRequired=true)
at /home/max/svn/osg/include/osgDB/Registry:237
#30 0xb7accdc8 in osgDB::readNodeFile (filename=@0xbff279bc,
options=0x0) at /home/max/svn/osg/src/osgDB/ReadFile.cpp:69
#31 0xb7ace2ce in osgDB::readNodeFiles (arguments=@0xbff27b24,
options=0x0) at /home/max/svn/osg/src/osgDB/ReadFile.cpp:221
#32 0x0805308b in osgDB::readNodeFiles (parser=@0xbff27b24) 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 <> wrote:
Quote:
On Mon, Nov 3, 2008 at 6:12 PM, Robert Osfield <> wrote:
Quote:

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




------------------
Post generated by Mail2Forum
Back to top
Robert Osfield
Guest





PostPosted: Tue Nov 04, 2008 9:58 am    Post subject:
deadlock loading io plugin?
Reply with quote

Hi Max,

On Tue, Nov 4, 2008 at 9:46 AM, Max Pfingsthorn
<> wrote:
Quote:
The _threadHoldingMutex is NULL, is that ok? Also, there is only one thread.

ReentrantMutex::threadHoldingMutex is initialized to 0, and when the
mutex is released it is reset to 0 so it's perfectly normal.

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

It might be a long shot, but my only idea right now is that perhaps
the main thread for OpenThreads::Thread::CurrentThread() is returning
0 one time then another value later on.

Could you print out the value of OpenThreads::Thread::CurrentThread
as the first thing in your main then after any other operation to see
if it's value does change.

Robert.


------------------
Post generated by Mail2Forum
Back to top
Max Pfingsthorn
Guest





PostPosted: Tue Nov 04, 2008 10:07 am    Post subject:
deadlock loading io plugin?
Reply with quote

Hi Robert,

On Tue, Nov 4, 2008 at 10:58 AM, Robert Osfield
<> wrote:
Quote:
Quote:
Any further ideas? I'm pretty sure I'm doing something wrong because
osgviewer works.

It might be a long shot, but my only idea right now is that perhaps
the main thread for OpenThreads::Thread::CurrentThread() is returning
0 one time then another value later on.

Could you print out the value of OpenThreads::Thread::CurrentThread
as the first thing in your main then after any other operation to see
if it's value does change.

As long as the program doesn't hang, it always returns 0. I print it
as the very first thing, parse the arguments, print it again, the try
to readNodeFiles(arguments), which hangs.

--------------------------------------
int main(int argc, char** argv) {
cout << "OpenThreads::CurrentThread: " <<
OpenThreads::Thread::CurrentThread() << endl;

osg::ArgumentParser arguments(&argc,argv);
cout << "start!" << endl;
cout << "OpenThreads::CurrentThread: " <<
OpenThreads::Thread::CurrentThread() << endl;

osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);

cout << "OpenThreads::CurrentThread: " <<
OpenThreads::Thread::CurrentThread() << endl;
--------------------------------------

The first two show 0, the third print is never reached. The weird
thing is, if I install OSG from the Ubuntu repos (2.4), it works just
fine. I tried it at home.

Cheers,
max


------------------
Post generated by Mail2Forum
Back to top
Robert Osfield
Guest





PostPosted: Tue Nov 04, 2008 11:06 am    Post subject:
deadlock loading io plugin?
Reply with quote

Hi Max,

I just run your code on my Kubuntu 7.10 64bit, Intel quad core system and got:

OpenThreads::CurrentThread: 0x6030e0
start!
OpenThreads::CurrentThread: 0x6030e0
OpenThreads::CurrentThread: 0x6030e0

The complete code is listed below.

Which version of the OSG do find problems with? What is the exact
machine/OS combination are you using?

As an experiment could you modify the ReentrantMutext() so that the
_threadHoldingMutex member variable is set to something like
0xffffffff.

Robert.

--

#include <osgDB/ReadFile>

#include <iostream>

using namespace std;

int main(int argc, char** argv)
{
cout << "OpenThreads::CurrentThread: " <<
OpenThreads::Thread::CurrentThread() << endl;

osg::ArgumentParser arguments(&argc,argv);
cout << "start!" << endl;
cout << "OpenThreads::CurrentThread: " <<
OpenThreads::Thread::CurrentThread() << endl;

osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);

cout << "OpenThreads::CurrentThread: " <<
OpenThreads::Thread::CurrentThread() << endl;

}


------------------
Post generated by Mail2Forum
Back to top
Max Pfingsthorn
Guest





PostPosted: Tue Nov 04, 2008 12:19 pm    Post subject:
deadlock loading io plugin?
Reply with quote

Hi Robert,

On Tue, Nov 4, 2008 at 12:01 PM, Robert Osfield
<> wrote:
Quote:
Which version of the OSG do find problems with? What is the exact
machine/OS combination are you using?

I am using OSG trunk (2.7.5) from this morning on Ubuntu 8.04 32bit.
The machine is a Intel Pentium D 2.8GHz (basically 2 Pentium 4s on one
dice). Compiler is GCC 4.2.4.

Quote:
As an experiment could you modify the ReentrantMutext() so that the
_threadHoldingMutex member variable is set to something like
0xffffffff.

I'll try that and report back soon. I'll also try the Ubuntu OSG
package (to make sure its not something with my pthread library).

Bye,
max


------------------
Post generated by Mail2Forum
Back to top
Robert Osfield
Guest





PostPosted: Tue Nov 04, 2008 12:40 pm    Post subject:
deadlock loading io plugin?
Reply with quote

Hi Max,

As another datapoint for your testing - I modified my
Thread::CurrentThread method to return 0 and the test code worked
without deadlocks.

Do you have any other machines that you could try?

Robert.

On Tue, Nov 4, 2008 at 12:19 PM, Max Pfingsthorn
<> wrote:
Quote:
Hi Robert,

On Tue, Nov 4, 2008 at 12:01 PM, Robert Osfield
<> wrote:
Quote:
Which version of the OSG do find problems with? What is the exact
machine/OS combination are you using?

I am using OSG trunk (2.7.5) from this morning on Ubuntu 8.04 32bit.
The machine is a Intel Pentium D 2.8GHz (basically 2 Pentium 4s on one
dice). Compiler is GCC 4.2.4.

Quote:
As an experiment could you modify the ReentrantMutext() so that the
_threadHoldingMutex member variable is set to something like
0xffffffff.

I'll try that and report back soon. I'll also try the Ubuntu OSG
package (to make sure its not something with my pthread library).

Bye,
max




------------------
Post generated by Mail2Forum
Back to top
Max Pfingsthorn
Guest





PostPosted: Tue Nov 04, 2008 1:13 pm    Post subject:
deadlock loading io plugin?
Reply with quote

Hi Robert,

On Tue, Nov 4, 2008 at 1:40 PM, Robert Osfield <> wrote:
Quote:
As another datapoint for your testing - I modified my
Thread::CurrentThread method to return 0 and the test code worked
without deadlocks.

Hmm, ok. Thanks. I noticed that with the Ubuntu OSG package,
CurrentThread is non-zero only after readNodeFiles was called, not
before. This is different to your output, which was always non-zero.
Can or should I somehow initialize OpenThreads?

Quote:
Do you have any other machines that you could try?

Unfortunately, I don't. I could try my PowerBook G4, but I can't get
OpenSceneGraph to compile there yet, some missing dependencies I
think. I am trying the 2.6.1 and 2.5.5 tags on my Ubuntu machine to
see if using those versions makes any difference. They are still
compiling...

Cheers,
max


------------------
Post generated by Mail2Forum
Back to top
Robert Osfield
Guest





PostPosted: Tue Nov 04, 2008 1:41 pm    Post subject:
deadlock loading io plugin?
Reply with quote

Hi Max,

On Tue, Nov 4, 2008 at 1:13 PM, Max Pfingsthorn
<> wrote:
Quote:
Hmm, ok. Thanks. I noticed that with the Ubuntu OSG package,
CurrentThread is non-zero only after readNodeFiles was called, not
before. This is different to your output, which was always non-zero.
Can or should I somehow initialize OpenThreads?

Could you try adding a:

Thread::Init();

To the start of your main and see if that makes a difference.

As an experiment I've also added an Init() call into Thread::CurrentThread :

if(!s_isInitialized) Thread::Init();

The modified OpenSceneGraph/src/OpenThreads/pthreads/PThread.c++ is
attached. Could you try this to see if it helps.

Robert.



------------------
Post generated by Mail2Forum
Back to top
Max Pfingsthorn
Guest





PostPosted: Tue Nov 04, 2008 2:06 pm    Post subject:
deadlock loading io plugin?
Reply with quote

Hi Robert,

On Tue, Nov 4, 2008 at 2:36 PM, Robert Osfield <> wrote:
Quote:
Could you try adding a:

Thread::Init();

To the start of your main and see if that makes a difference.

Yes, that did it. Before, OSG 2.6.1 and 2.5.5 finished compiling and
*both* worked without OpenThreads::Thread::init(); in my main. That
seems weird.. Did something change for 2.7 in terms of OpenThreads?

Cheers,
max


------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Loading .fbx files causes triangulati... neonerd Plugins [osgPlugins] 0 Tue Jun 18, 2019 3:14 am View latest post
No new posts Problems with dae plugin John Richardson Plugins [osgPlugins] 0 Thu Apr 11, 2019 5:00 pm View latest post
No new posts [PARTIALLY SOLVED] Problems with dae ... Nikkitta Plugins [osgPlugins] 4 Mon Apr 08, 2019 3:51 pm View latest post
No new posts Add search location for textures in F... bbjorn Submission 1 Mon Feb 04, 2019 2:22 pm View latest post
No new posts Loading osgt from string / Compile re... mmaurus General 2 Mon Jan 21, 2019 11:02 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP