This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
steps: invoke profiling -> analyze performance -> profile application -> edit profiling roots -> check the whole application -> the session ends "successfully" :) just after finishing instrumentation
Actually, it is enough to set java.** as a profiling root.
It is enough to select java.lang.Thread.nextThreadNum() method as root method.
I am able to reproduce it with NB 7.0.1, so this is not a regression. Lowering priority to P3.
P2 - reproducible by the easiest action: just selecting the topmost (and now by default the only visible) checkbox in the Edit Profiling Roots dialog.
The root of the problem is in JNI method AttachCurrentThread. AttachCurrentThread invokes new Thread() in the same thread. In this situation any root method invoked by new Thread() will cause profiling to fail, because Thread.currentThread() returns partially initialized instance of Thread (the one from new Thread()). Profiling fails in ProfilerRuntime.writeThreadCreationEvent(), which invokes getName() on uninitialized thread.
Fixed in profiler-main. changeset: 222897:58eed9113091 user: Tomas Hurka <thurka@netbeans.org> date: Sun May 27 08:49:41 2012 +0200 summary: bugfix #203164, Thread.getName() can thrown NPE under special conditions (AttachCurrentThread)
Integrated into 'main-golden', will be available in build *201206050001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/58eed9113091 User: Tomas Hurka <thurka@netbeans.org> Log: bugfix #203164, Thread.getName() can thrown NPE under special conditions (AttachCurrentThread)