gerwindehaan / osgswig

Python bindings for OpenSceneGraph (auto-export from code.google.com/p/osgswig)
Other
1 stars 1 forks source link

Segfaults in osg::notify #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build osgswig
2. Run one of the examples

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
Latest svn (r169), Ubuntu 8.10 Intrepid Ibex, OpenSceneGraph 2.4.0
(installed from ubuntu repositories).

Please provide any additional information below.
Here's what happens why I try to run it in gdb:
patrick@t40puter:~/dev/osgswig-read-only/examples/python$ gdb python 
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(no debugging symbols found)
(gdb) run simpleosg.py
Starting program: /usr/bin/python simpleosg.py
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[New Thread 0xb7d8b8c0 (LWP 1623)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7d8b8c0 (LWP 1623)]
0xb75dc637 in std::uncaught_exception () from /usr/lib/libstdc++.so.6
(gdb) bt
#0  0xb75dc637 in std::uncaught_exception () from /usr/lib/libstdc++.so.6
#1  0xb75ae0b5 in std::__ostream_insert<char, std::char_traits<char> > ()
from /usr/lib/libstdc++.so.6
#2  0xb7afc728 in osg::notify () from /usr/lib/libosg.so.7
#3  0xb7640736 in osgDB::findFileInPath () from /usr/lib/libosgDB.so.7
#4  0xb7640b11 in osgDB::findLibraryFile () from /usr/lib/libosgDB.so.7
#5  0xb763b20a in osgDB::DynamicLibrary::loadLibrary () from
/usr/lib/libosgDB.so.7
#6  0xb765423f in osgDB::Registry::loadLibrary () from /usr/lib/libosgDB.so.7
#7  0xb76623d0 in osgDB::Registry::read () from /usr/lib/libosgDB.so.7
#8  0xb766077b in osgDB::Registry::readImplementation () from
/usr/lib/libosgDB.so.7
#9  0xb7660e0c in osgDB::Registry::readNodeImplementation () from
/usr/lib/libosgDB.so.7
#10 0xb764debd in osgDB::readNodeFile () from /usr/lib/libosgDB.so.7
#11 0xb7c2515b in _wrap_readNodeFile () from
/home/patrick/dev/osgswig-read-only/build/lib/python/_osgDB.so
#12 0x0805d867 in PyObject_Call ()
#13 0x080cd502 in PyEval_EvalFrameEx ()
#14 0x080d0345 in PyEval_EvalCodeEx ()
#15 0x080ce728 in PyEval_EvalFrameEx ()
#16 0x080d0345 in PyEval_EvalCodeEx ()
#17 0x080d0557 in PyEval_EvalCode ()
#18 0x080edf8f in PyRun_FileExFlags ()
#19 0x080ee25a in PyRun_SimpleFileExFlags ()
#20 0x080595e7 in Py_Main ()
#21 0x08058962 in main ()
(gdb) 

Another way; just importing osgViewer causes segfault:
patrick@t40puter:~/dev/osgswig-read-only/examples/python$ gdb python
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(no debugging symbols found)
(gdb) r
Starting program: /usr/bin/python 
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49) 
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
[New Thread 0xb7e9b8c0 (LWP 1629)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
>>> import osgViewer

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7e9b8c0 (LWP 1629)]
0xb75c8637 in std::uncaught_exception () from /usr/lib/libstdc++.so.6
(gdb) bt
#0  0xb75c8637 in std::uncaught_exception () from /usr/lib/libstdc++.so.6
#1  0xb759a0b5 in std::__ostream_insert<char, std::char_traits<char> > ()
from /usr/lib/libstdc++.so.6
#2  0xb7b32728 in osg::notify () from /usr/lib/libosg.so.7
#3  0xb7661c83 in ?? () from /usr/lib/libosgViewer.so.7
#4  0xb766e6ad in ?? () from /usr/lib/libosgViewer.so.7
#5  0xb761d170 in _init () from /usr/lib/libosgViewer.so.7
#6  0xb806bae4 in ?? () from /lib/ld-linux.so.2
#7  0xb806bc14 in ?? () from /lib/ld-linux.so.2
#8  0xb806fb3b in ?? () from /lib/ld-linux.so.2
#9  0xb806b716 in ?? () from /lib/ld-linux.so.2
#10 0xb806f2ee in ?? () from /lib/ld-linux.so.2
#11 0xb8025bec in ?? () from /lib/tls/i686/cmov/libdl.so.2
#12 0xb806b716 in ?? () from /lib/ld-linux.so.2
#13 0xb802601c in ?? () from /lib/tls/i686/cmov/libdl.so.2
#14 0xb8025b21 in dlopen () from /lib/tls/i686/cmov/libdl.so.2
#15 0x080f5503 in _PyImport_GetDynLoadFunc ()
#16 0x080e6aa3 in _PyImport_LoadDynamicModule ()
#17 0x080e4930 in ?? ()
#18 0x080e51c9 in ?? ()
#19 0x080e546a in ?? ()
#20 0x080e5a77 in ?? ()
#21 0x080e5dd3 in PyImport_ImportModuleLevel ()
#22 0x080c8034 in ?? ()
#23 0x0805d867 in PyObject_Call ()
#24 0x080c850c in PyEval_CallObjectWithKeywords ()
#25 0x080cc2b8 in PyEval_EvalFrameEx ()
#26 0x080d0345 in PyEval_EvalCodeEx ()
#27 0x080d0557 in PyEval_EvalCode ()
#28 0x080e3a49 in PyImport_ExecCodeModuleEx ()
#29 0x080e3d1c in ?? ()
#30 0x080e51c9 in ?? ()
#31 0x080e546a in ?? ()
#32 0x080e5a77 in ?? ()
#33 0x080e5dd3 in PyImport_ImportModuleLevel ()
#34 0x080c8034 in ?? ()
#35 0x0805d867 in PyObject_Call ()
#36 0x080c850c in PyEval_CallObjectWithKeywords ()
#37 0x080cc2b8 in PyEval_EvalFrameEx ()
#38 0x080d0345 in PyEval_EvalCodeEx ()
#39 0x080d0557 in PyEval_EvalCode ()
#40 0x080edb63 in PyRun_InteractiveOneFlags ()
#41 0x080eddb8 in PyRun_InteractiveLoopFlags ()
#42 0x080ee516 in PyRun_AnyFileExFlags ()
#43 0x080595e7 in Py_Main ()
#44 0x08058962 in main ()
(gdb) 

Original issue reported on code.google.com by patrick....@gmail.com on 15 Nov 2008 at 7:35

GoogleCodeExporter commented 9 years ago
Hi Patrick,
A good excuse to do a fresh install of ubuntu 8.10 on my home machine! With this
setup, I was able to replicate these errors. Hope to try a manual build of osg 
2.4
soon, did you try that?
regards,
Gerwin

Original comment by gerwinde...@gmail.com on 16 Nov 2008 at 10:34

GoogleCodeExporter commented 9 years ago
No, and that might be beyond my abilities/available time at the moment.

Original comment by patrick....@gmail.com on 17 Nov 2008 at 12:32

GoogleCodeExporter commented 9 years ago
I've also encountered these segfaults on a fresh install (after importing 
osgViewer
when I do it interactively)

they don't occur on my other machine which I upgraded to 8.10 from 8.04

Original comment by huib...@gmail.com on 10 Dec 2008 at 9:28

GoogleCodeExporter commented 9 years ago
(I forgot to mention that I used a manual build of osg, similar to the one on 
the
other machine)

Original comment by huib...@gmail.com on 10 Dec 2008 at 9:30

GoogleCodeExporter commented 9 years ago
there seems to be something wrong in osg::notify. On my ubuntu hardy install,
osg.notify() returns a <Swig Object of type 'std::ostream *' at 0xb6c1d120>. On 
my
intrepid install, I get a segfault. I tried both older and newer swig versions
(1.3.33, 1.3.35, 1.3.36), but no luck so far. Tried the latest changes from svn 
to
osg Notify.cpp, but no changes there. The C++-based osgviewer happily displays
osg::notify calls. Still looking...

Original comment by gerwinde...@gmail.com on 29 Dec 2008 at 9:09

GoogleCodeExporter commented 9 years ago
Ah! I found a "workaround" which might also lead to the real cause. When using 
the
following all goes well on my intrepid ibex system:

export LD_PRELOAD=/usr/lib/libstdc++.so.6

I'm not yet sure why this is necessary, and how to fix/prevent this more 
cleanly.

Original comment by gerwinde...@gmail.com on 29 Dec 2008 at 9:12

GoogleCodeExporter commented 9 years ago

Original comment by gerwinde...@gmail.com on 30 Dec 2008 at 8:53

GoogleCodeExporter commented 9 years ago

Original comment by gerwinde...@gmail.com on 30 Dec 2008 at 8:55

GoogleCodeExporter commented 9 years ago

Original comment by gerwinde...@gmail.com on 30 Dec 2008 at 11:04

GoogleCodeExporter commented 9 years ago
Added an explicit linking of the standard c++ library in the cmake. For reasons 
not
clear to me, this link option had to be BEFORE the openGL library links.
Committed the fix in r182.

---

IF(CMAKE_COMPILER_IS_GNUCXX)
 SET(STDCPLUSPLUS_LIBRARY -lstdc++)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)

SET(SWIGLINKLIBS ${OSG_LIBRARY} ${PYTHON_LIBRARIES} ${OPENTHREADS_LIBRARY}
${STDCPLUSPLUS_LIBRARY} ${OPENGL_LIBRARIES})

Original comment by gerwinde...@gmail.com on 30 Dec 2008 at 12:25

GoogleCodeExporter commented 9 years ago
sorry, committed the fix in r181.

Original comment by gerwinde...@gmail.com on 30 Dec 2008 at 12:31

GoogleCodeExporter commented 9 years ago
I'm afraid this isssue surfaced again, the fix seems not to work for me.
After importing osgViewer on a machine with Nvidia graphics, I get crashes. The 
build
works fine with a number of different graphics cards/drivers (ati, mesa) and 
crashes
on all versions of NVidia. Setting LD_PRELOAD=/usr/lib/libstdc++.so.6 fixes it 
though.
Platform: debian etchl
ibc6 version 2.3.6.ds1-13etch7
SWIG Version 1.3.38
osgswig version: last week's svn checkout
cmake version 2.4-patch 5

best,
   mathias

Original comment by Franz...@gmail.com on 24 Feb 2009 at 8:18

GoogleCodeExporter commented 9 years ago
Started to try out osgswig once more, but this issue is still open. I just 
installed osgswig and found the same error.
I cannot use the workaround with LD_PRELOAD because it crashes python as soon 
as I import scipy.
It works only on machines without NVidia drivers. I attach the output of ldd 
for the _osg.so on a working machine and on a crashing machine.
This is basically a showstopper for osgswig for me :(

Config: 
Linux version 2.6.27.45-hri-32bit (luttropp@merlin07) (gcc version 4.1.2 
20061115 (prerelease) (Debian 4.1.1-21))
swig 2.0.0
this week's svn checkout of osgswig
OSG 2.8.2
cmake 2.8.1

Non-working machine:
ldd _osg.so
        linux-gate.so.1 =>  (0xffffe000)
        libosg.so.55 => /home/franzius/.HRI/sit/2009/External/OpenSceneGraph/2.8/lib/linux-i686-gcc-lsb31/libosg.so.55 (0xb76d0000)
        libpython2.6.so.1.0 => /home/franzius/.HRI/sit/2009/External/python/2.6.3/linux-i686-gcc-lsb31/lib/libpython2.6.so.1.0 (0xb756b000)
        libOpenThreads.so.11 => /home/franzius/.HRI/sit/2009/External/OpenSceneGraph/2.8/lib/linux-i686-gcc-lsb31/libOpenThreads.so.11 (0xb7564000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb746a000)
        libGLU.so.1 => /usr/lib/libGLU.so.1 (0xb73eb000)
        libGL.so.1 => /usr/lib/libGL.so.1 (0xb7344000)
        libSM.so.6 => /usr/lib/libSM.so.6 (0xb733a000)
        libICE.so.6 => /usr/lib/libICE.so.6 (0xb7322000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0xb7236000)
        libXext.so.6 => /usr/lib/libXext.so.6 (0xb7228000)
        libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7203000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb71f8000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb70c6000)
        libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb70b4000)
        libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb70b0000)
        libutil.so.1 => /lib/tls/i686/cmov/libutil.so.1 (0xb70ac000)
        libGLcore.so.1 => /usr/lib/libGLcore.so.1 (0xb6143000)
        libnvidia-tls.so.1 => /usr/lib/tls/libnvidia-tls.so.1 (0xb6140000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0xb613d000)
        libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb6138000)
        /lib/ld-linux.so.2 (0xb7fce000)

Working machine:
linux-gate.so.1 =>  (0xffffe000)
        libosg.so.55 => /home/franzius/.HRI/sit/2009/External/OpenSceneGraph/2.8/lib/linux-i686-gcc-lsb31/libosg.so.55 (0xb7684000)
        libpython2.6.so.1.0 => /home/franzius/.HRI/sit/2009/External/python/2.6.3/linux-i686-gcc-lsb31/lib/libpython2.6.so.1.0 (0xb7520000)
        libOpenThreads.so.11 => /home/franzius/.HRI/sit/2009/External/OpenSceneGraph/2.8/lib/linux-i686-gcc-lsb31/libOpenThreads.so.11 (0xb7519000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb7426000)
        libGLU.so.1 => /usr/lib/libGLU.so.1 (0xb73a7000)
        libGL.so.1 => /usr/lib/libGL.so.1 (0xb733d000)
        libSM.so.6 => /usr/lib/libSM.so.6 (0xb7333000)
        libICE.so.6 => /usr/lib/libICE.so.6 (0xb731b000)
        libX11.so.6 => /usr/lib/libX11.so.6 (0xb722f000)
        libXext.so.6 => /usr/lib/libXext.so.6 (0xb7221000)
        libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb71fc000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb71f1000)
        libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb70bf000)
        libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0xb70ad000)
        libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb70a9000)
        libutil.so.1 => /lib/tls/i686/cmov/libutil.so.1 (0xb70a5000)
        libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0xb70a0000)
        libdrm.so.2 => /usr/lib/libdrm.so.2 (0xb7098000)
        libXau.so.6 => /usr/lib/libXau.so.6 (0xb7095000)
        libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb7090000)
        /lib/ld-linux.so.2 (0xb7f83000)

Best,
   Mathias

Original comment by Franz...@gmail.com on 17 Jun 2010 at 12:08