Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4069374

NullPointerException while using jdb

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.1.4
    • 1.2.0
    • core-svc
    • None
    • 1.1.4
    • x86
    • windows_nt
    • Not verified



      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

      ======================================================================

            rfield Robert Field (Inactive)
            sgoodsunw Sheri Good (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: