Some null pointer method invocations causes segmentation fault

Bryce McKinlay
Mon Mar 27 16:21:00 GMT 2000

"Rolf W. Rasmussen" wrote:

> The following program causes a segmentation fault when run, instead of
> the NullPointerException one would expect.
> [...]
> Program received signal SIGSEGV, Segmentation fault.
> 0x400dfef9 in java.lang.Integer.intValue (this=null)
>     at ../../../libjava/java/lang/

The SIGSEGV you see in the debugger here is normal. The runtime catches
the segv and maps it into a NullPointerException. Unfortunatly, in these
cases the __throw() call in is failing, which appears to be a
new regression ;-(.

Program received signal SIGABRT, Aborted.
0x40257d41 in __kill () from /lib/
(gdb) bt
#0  0x40257d41 in __kill () from /lib/
#1  0x4021b217 in raise (sig=6) at signals.c:65
#2  0x402590d8 in abort () at ../sysdeps/generic/abort.c:88
#3  0x804b59e in __default_terminate () at ../../gcc/libgcc2.c:3036
#4  0x804b5bc in __terminate () at ../../gcc/libgcc2.c:3036
#5  0x804c1fc in throw_helper (eh=@8083618, pc=@400e75ba,
    offset_p=@bf7ffb08) at ../../gcc/libgcc2.c:3170
#6  0x804c3f1 in __throw () at ../../gcc/libgcc2.c:3170
#7  0x400a98ba in Letext () at ../../../libjava/
#8  0x4009f238 in catch_segv () at ../../../libjava/
#9  0x400e75bb in java.lang.String.length (this=null)
    at ../../../libjava/java/lang/
#10 0x804d97a in test.main (args=@8086ff0) at
#11 0x40133420 in gnu::gcj::runtime::FirstThread::run (this=@8069ea0)
    at ../../../libjava/gnu/gcj/runtime/
#12 0x4013e9ee in java::lang::Thread::run_ (obj=@8069ea0)
    at ../../../libjava/java/lang/
#13 0x40150821 in really_start (x=@808aff8)
    at ../../../libjava/
#14 0x402007aa in GC_start_routine (arg=@808bfe0)
    at ../../../boehm-gc/linux_threads.c:553
#15 0x40218b85 in pthread_start_thread (arg=@bf7ffe40) at manager.c:241

Could you enter a PR?


  [ bryce ]

More information about the Java mailing list