[re] Java executables can abort trying to access a null pointer in a leaf function

Andrew Haley aph@redhat.com
Thu Feb 2 17:39:00 GMT 2006


tsuraan writes:
 > > Just run the thing under GDB,  Set most signals (other than SIGABRT) to
 > > noprint nostop pass.  Then print the trace when gdb stops in the abort.
 > 
 > Invoking gdb with
 > 
 > LD_LIBRARY_PATH=/opt/gcc-4.1/lib gdb ./nullpointer
 > 
 > When I run I get
 > 
 > Starting program: /home/tsuraan/java/abort/nullpointer
 > Cannot find thread 2: Thread ID=1, generic error
 > 
 > My gdb version is
 > 
 > GNU gdb 6.1.1 [FreeBSD]
 > Copyright 2004 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 "i386-marcel-freebsd".
 > 
 > A backtrace of the program that showed me this bug (a python program
 > using PyLucene) is:

Did you see the point at which the SEGV was thrown?  The debugger
should have caught it.

 > #0  0x2822f31b in pthread_testcancel () from /usr/lib/libpthread.so.1
 > #1  0x28220145 in sigaction () from /usr/lib/libpthread.so.1
 > #2  0x2821a1dd in pthread_kill () from /usr/lib/libpthread.so.1
 > #3  0x28219bac in raise () from /usr/lib/libpthread.so.1
 > #4  0x282eac1b in abort () from /lib/libc.so.5
 > #5  0x28e5800c in _Jv_Throw (value=0x8c06ac8)
 >     at ../../../gcc-4.1-20051029/libjava/exception.cc:111
 > #6  0x28e4c873 in _Jv_ThrowNullPointerException ()
 >     at ../../../gcc-4.1-20051029/libjava/prims.cc:359


 > #7  0x08b63048 in ?? ()

^^^^^

This is the interesting part.

Andrew.



More information about the Java mailing list