JDK-6858776 : Regression: 6u14: jdb throws NPE on Windows when dealing with breakpoints
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 6u14
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows
  • CPU: generic
  • Submitted: 2009-07-09
  • Updated: 2010-07-29
  • Resolved: 2009-07-30
Related Reports
Duplicate :  
Relates :  
Description
jdb throws a NPE on Windows when dealing with breakpoints. The issue can be reproduced

a) on 6u14, but not on 6u13.
b) on Windows, but not on Solaris and not on Linux

E:\jdb>type Test.java
import java.util.ArrayList;
import java.util.List;

public class Test {

public static List<Object> objList = new ArrayList<Object>();

    private static void init(int numObjs) {
        for (int i = 0; i < numObjs; i++) {
            objList.add(new Object());
        }
    }

    public static void main(String[] args) {

        for (int i = 0; i < 10; i++) {
           System.out.println("start");
           init(1000000);
           System.out.println("end");
           objList.clear();
        }
    }
}
E:\jdb>javac Test.java

E:\jdb>"C:\Program Files\Java\jdk1.6.0_14\bin\jdb.exe" -J-showversion -classpath . Test
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)

Initializing jdb ...
> stop at Test:17
Deferring breakpoint Test:17.
It will be set after the class is loaded.
> stop at Test:19
Deferring breakpoint Test:19.
It will be set after the class is loaded.
> stop
Breakpoints set:
        breakpoint Test:17
        breakpoint Test:19
> run
run Test
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
>
VM Started: Set deferred breakpoint Test:19
Set deferred breakpoint Test:17

Breakpoint hit: "thread=main", Test.main(), line=17 bci=8
17               System.out.println("start");

main[1] list
13
14        public static void main(String[] args) {
15
16            for (int i = 0; i < 10; i++) {
17 =>            System.out.println("start");
18               init(1000000);
19               System.out.println("end");
20               objList.clear();
21            }
22        }
main[1] cont
> start

Breakpoint hit: Exception in thread "event-handler" java.lang.NullPointerException
        at com.sun.tools.example.debug.tty.TTY.printCurrentLocation(TTY.java:212)
        at com.sun.tools.example.debug.tty.TTY.vmInterrupted(TTY.java:189)
        at com.sun.tools.example.debug.tty.EventHandler.run(EventHandler.java:86)
        at java.lang.Thread.run(Thread.java:619)

Comments
EVALUATION Closing as duplicate after contacting Kevin.
30-07-2009

EVALUATION This issue is being addressed via the following bug: 6862295 2/3 JDWP threadid changes during debugging session (leading to ignored breakpoints) The fix for the bug has already been pushed to HSX-16 (should be integrated in B08). The fix is also queued up for HSX-14.1 or HSX-14.2 depending on whether the fix goes into 6u15 or 6u16. I'm planning to close this bug as a duplicate of 6862295. However, it is escalated so I'm not sure of the proper process.
29-07-2009