Name: sg39081 Date: 08/04/97
The following program causes jdb to throw a nullpointerexception.
public class ab {
public static void main(String[] argv) {
try {
throw new RuntimeException("");
} catch (Exception E) {
E.printStackTrace(new java.io.PrintStream(System.out));
java.io.PrintWriter pw = new java.io.PrintWriter(System.out);
pw.println("foo");
E.printStackTrace(pw);
pw.flush();
// pw.close();
}
}
}
D:\temp>jdb ab
Initializing jdb...
0xf75358:class(ab)
> stop at ab:9
Breakpoint set at ab:9
> run
run ab
java.lang.RuntimeException: running ...
main[1]
at ab.main(ab.java:4)
at sun.tools.debug.MainThread.run(Agent.java:55)
Breakpoint hit:
Fatal exception: java.lang.Exception: java.lang.NullPointerException
java.lang.Exception: java.lang.NullPointerException
at sun.tools.debug.RemoteAgent.getReply(RemoteAgent.java:408)
at sun.tools.debug.RemoteAgent.dumpStack(RemoteAgent.java:527)
at sun.tools.debug.RemoteThread.dumpStack(RemoteThread.java:148)
at sun.tools.ttydebug.TTY.breakpointEvent(TTY.java:85)
at sun.tools.debug.AgentIn.run(AgentIn.java:67)
at java.lang.Thread.run(Thread.java:470)
main[1] quit
======================================================================