public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* Some null pointer method invocations causes segmentation fault
@ 2000-03-27 14:52 Rolf W. Rasmussen
  2000-03-27 16:21 ` Bryce McKinlay
  2000-04-01  0:00 ` Rolf W. Rasmussen
  0 siblings, 2 replies; 10+ messages in thread
From: Rolf W. Rasmussen @ 2000-03-27 14:52 UTC (permalink / raw)
  To: java-discuss

The following program causes a segmentation fault when run, instead of
the NullPointerException one would expect.

--------
public class NullPointerExceptionTest {
    public static void main(String[] args) {
        ((Integer) null).intValue();
    }
}
--------

Starting
program: /home/debian/rolfwr/prg/testgcj/./NullPointerExceptionTest

[...]
Program received signal SIGSEGV, Segmentation fault.
0x400dfef9 in java.lang.Integer.intValue (this=null)
    at ../../../libjava/java/lang/Integer.java:60
60          return value;
Current language:  auto; currently java
(gdb) bt
#0  0x400dfef9 in java.lang.Integer.intValue (this=null)
    at ../../../libjava/java/lang/Integer.java:60
#1  0x804af63 in NullPointerExceptionTest.main (args=@8081ff0)
    at NullPointerExceptionTest.java:3
#2  0x4013160a in gnu::gcj::runtime::FirstThread::run (this=@8064ea0)
[...]

Other one-liners that trigger the same problem:

    ((String) null).length();
    ((java.util.Vector) null).size();
    Boolean ref = null; ref.booleanValue();

I've compiled/run with gcj/libgcj pulled from CVS on 27. March.
gcc version 2.96 20000327 (experimental) on i586-pc-linux-gnu

--
Rolf W. Rasmussen

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2000-04-01  0:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-27 14:52 Some null pointer method invocations causes segmentation fault Rolf W. Rasmussen
2000-03-27 16:21 ` Bryce McKinlay
2000-03-28  1:00   ` Andrew Haley
2000-03-28 19:14     ` PR libgcj/184 [was Re: Re: Some null pointer method invocations causes segmentation fault] Bryce McKinlay
2000-03-30  3:06       ` Bryce McKinlay
2000-04-01  0:00         ` Bryce McKinlay
2000-04-01  0:00       ` Bryce McKinlay
2000-04-01  0:00     ` Some null pointer method invocations causes segmentation fault Andrew Haley
2000-04-01  0:00   ` Bryce McKinlay
2000-04-01  0:00 ` Rolf W. Rasmussen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).