Segfault in current ODEJava

I am unable to hunt down a segfault in ODEJava on linux. It does not seem to be reproducible on Windows, so I can’t use the tools I am familiar with. Anyone here able to debug the jni part on linux and have a look into the stack to post that here?

[you can download a debug build of the lib here]



Edit: to reproduce run TestBasicJoints and wait some (to several) seconds…

can't read anything from that log undecided. the only actual information seems to be ...


Yes seems as the rest is the libs loaded by java at that point.
I wasn't able so far to find a trace of the odejava natives in the 15 or like threads from the java - process running at signal time.

Still trying but don't expect something useful soon as i learn linux debugging by doing here.


I still have no idea why but it was caused by the new segfault handler to convert segfaults to StackOverflowErrors. It is disabled now until someone finds out why it causes problems.



If someone has the capabilities please debug the native lib posted above.

If someone has the capabilities please debug the native lib posted above


Not really but i'll download the debug lib and give it a shot when i get the time.
(always wondered what it looks like when gdb is started  :) )

how can i reproduce the problem?

with the latest cvs version it dosen't segfault.

right but with the native you can download from the link above:

irrisor said:

[you can download a debug build of the lib here]

i did replace ./jmephysics/impl/ode/lib/libodejava.so with the one you provided, i still can't seem to get a segfault.

i play a bit more with the other tests.

hmm, strange enough, maybe it's only on dual-core machines :?

my laptop is a ibm T60 Centrino core duo :wink:

i am using Suse 10.3 rc1.

no idea then - it is segfaulting 3 of 10 times on a core 2 duo under ubuntu dapper… maybe it's some lib…

Ok, i played with the core dump a bit and gdb told me: NOOB ! … err no … but:


gdb /opt/jdk1.6.0_02/bin/java core
GNU gdb 6.6-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(no debugging symbols found)
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/tls/i686/cmov/libpthread.so.0...(no debugging symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/libpthread.so.0
Reading symbols from /opt/jdk1.6.0_02/jre/lib/i386/jli/libjli.so...(no debugging symbols found)...done.
Loaded symbols for /opt/jdk1.6.0_02/bin/../jre/lib/i386/jli/libjli.so
Reading symbols from /lib/tls/i686/cmov/libdl.so.2...
(no debugging symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/libdl.so.2
Reading symbols from /lib/tls/i686/cmov/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/libc.so.6
Reading symbols from /lib/ld-linux.so.2...
(no debugging symbols found)...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /opt/jdk1.6.0_02/jre/lib/i386/server/libjvm.so...(no debugging symbols found)...done.
Loaded symbols for /opt/jdk1.6.0_02/jre/lib/i386/server/libjvm.so
Reading symbols from /lib/tls/i686/cmov/libm.so.6...
(no debugging symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/libm.so.6
Reading symbols from /lib/tls/i686/cmov/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/librt.so.1
Reading symbols from /opt/jdk1.6.0_02/jre/lib/i386/native_threads/libhpi.so...
(no debugging symbols found)...done.
Loaded symbols for /opt/jdk1.6.0_02/jre/lib/i386/native_threads/libhpi.so
Reading symbols from /lib/tls/i686/cmov/libnsl.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/libnsl.so.1
Reading symbols from /lib/tls/i686/cmov/libnss_compat.so.2...
(no debugging symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/libnss_compat.so.2
Reading symbols from /lib/tls/i686/cmov/libnss_nis.so.2...(no debugging symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/libnss_nis.so.2
Reading symbols from /lib/tls/i686/cmov/libnss_files.so.2...
(no debugging symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/libnss_files.so.2
Reading symbols from /opt/jdk1.6.0_02/jre/lib/i386/libverify.so...(no debugging symbols found)...done.
Loaded symbols for /opt/jdk1.6.0_02/jre/lib/i386/libverify.so
Reading symbols from /opt/jdk1.6.0_02/jre/lib/i386/libjava.so...
(no debugging symbols found)...done.
Loaded symbols for /opt/jdk1.6.0_02/jre/lib/i386/libjava.so
Reading symbols from /opt/jdk1.6.0_02/jre/lib/i386/libzip.so...(no debugging symbols found)...done.
Loaded symbols for /opt/jdk1.6.0_02/jre/lib/i386/libzip.so
Reading symbols from /opt/jdk1.6.0_02/jre/lib/i386/libawt.so...
(no debugging symbols found)...done.
Loaded symbols for /opt/jdk1.6.0_02/jre/lib/i386/libawt.so
Reading symbols from /opt/jdk1.6.0_02/jre/lib/i386/libmlib_image.so...(no debugging symbols found)...done.
Loaded symbols for /opt/jdk1.6.0_02/jre/lib/i386/libmlib_image.so
Reading symbols from /opt/jdk1.6.0_02/jre/lib/i386/xawt/libmawt.so...
(no debugging symbols found)...done.
Loaded symbols for /opt/jdk1.6.0_02/jre/lib/i386/xawt/libmawt.so
Reading symbols from /usr/lib/libXext.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libXext.so.6
Reading symbols from /usr/lib/libX11.so.6...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libX11.so.6
Reading symbols from /usr/lib/libXtst.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libXtst.so.6
Reading symbols from /usr/lib/libXi.so.6...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libXi.so.6
Reading symbols from /usr/lib/libXau.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libXau.so.6
Reading symbols from /usr/lib/libXdmcp.so.6...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libXdmcp.so.6
Reading symbols from /opt/jdk1.6.0_02/jre/lib/i386/libfontmanager.so...(no debugging symbols found)...done.
Loaded symbols for /opt/jdk1.6.0_02/jre/lib/i386/libfontmanager.so
Reading symbols from /usr/lib/libXcursor.so.1...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libXcursor.so.1
Reading symbols from /usr/lib/libXrender.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libXrender.so.1
Reading symbols from /usr/lib/libXfixes.so.3...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libXfixes.so.3
Reading symbols from /home/sam/projekte/JME/jme/lib/liblwjgl.so...(no debugging symbols found)...done.
Loaded symbols for /home/sam/projekte/JME/jme/lib/liblwjgl.so
Reading symbols from /usr/lib/libXrandr.so.2...
---Type <return> to continue, or q <return> to quit---
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libXrandr.so.2
Reading symbols from /opt/jdk1.6.0_02/jre/lib/i386/libjawt.so...(no debugging symbols found)...done.
Loaded symbols for /opt/jdk1.6.0_02/jre/lib/i386/libjawt.so
Reading symbols from /usr/lib/libGL.so.1...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libGL.so.1
Reading symbols from /usr/lib/libGLcore.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libGLcore.so.1
Reading symbols from /usr/lib/tls/libnvidia-tls.so.1...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/tls/libnvidia-tls.so.1
Reading symbols from /opt/jdk1.6.0_02/jre/lib/i386/libcmm.so...(no debugging symbols found)...done.
Loaded symbols for /opt/jdk1.6.0_02/jre/lib/i386/libcmm.so
Reading symbols from /opt/jdk1.6.0_02/jre/lib/i386/libjpeg.so...
(no debugging symbols found)...done.
Loaded symbols for /opt/jdk1.6.0_02/jre/lib/i386/libjpeg.so
Reading symbols from /home/sam/projekte/JME/jmephysics/impl/ode/lib/libodejava.so...done.
Loaded symbols for /home/sam/projekte/JME/jmephysics/impl/ode/lib/libodejava.so
Reading symbols from /usr/lib/libstdc++.so.6...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1

Core was generated by `/opt/jdk1.6.0_02/bin/java -Xms256M -Djava.library.path=/home/sam/projekte/JME/j'.
Program terminated with signal 11, Segmentation fault.
#0  0xb4d95d7f in ?? ()
(gdb) list
1       /build/buildd/glibc-2.3.6/build-tree/i386-libc/csu/crti.S: No such file or directory.
        in /build/buildd/glibc-2.3.6/build-tree/i386-libc/csu/crti.S
(gdb) backtrace
#0  0xb4d95d7f in ?? ()
#1  0x00000000 in ?? ()



seems to me this glibc-2.3.6 is a bit old ???  version is 2.5 on my system
does this tell You anything irrisor ? as i believe it comes from libodejava.so

I also managed to let it segfault with gdb (via ddd frontend) attached to the process but i must admit that i don't understand
what happens at that point  :(

what is the source version for this debug build ?

Not sure what to do next besides read gdb and ddd docs  ;)

can't read anything from that log :|. the only actual information seems to be

#0  0xb4d95d7f in ?? ()
(gdb) list
1       /build/buildd/glibc-2.3.6/build-tree/i386-libc/csu/crti.S: No such file or directory.
        in /build/buildd/glibc-2.3.6/build-tree/i386-libc/csu/crti.S
(gdb) backtrace


which is not very much.

The source for that .so is the current cvs of odejava-jni (esp. the line "sigaction( SIGSEGV, &action, NULL );" uncommented - will comment that out soon) + current ODE.