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.
Dynamic attach to a running NetBeans instance, CPU all (sampled), detach, re-attach for 1 selected method (instrumented) "org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run()", the following is thrown and both profiling and profiled IDEs stop responding: java.lang.NullPointerException at org.netbeans.lib.profiler.instrumentation.ClassManager.storeClassFileBytesForCustomLoaderClasses(ClassManager.java:284) at org.netbeans.lib.profiler.instrumentation.RecursiveMethodInstrumentor1.preGetInitialMethodsToInstrument(RecursiveMethodInstrumentor1.java:525) at org.netbeans.lib.profiler.instrumentation.RecursiveMethodInstrumentor1.getInitialMethodsToInstrument(RecursiveMethodInstrumentor1.java:96) at org.netbeans.lib.profiler.instrumentation.Instrumentor.createInitialInstrumentMethodGroupResponseForCallGraph(Instrumentor.java:448) at org.netbeans.lib.profiler.instrumentation.Instrumentor.createInitialInstrumentMethodGroupResponse(Instrumentor.java:297) at org.netbeans.lib.profiler.ProfilerClient.instrumentMethodGroupFromRoot(ProfilerClient.java:1925) at org.netbeans.lib.profiler.ProfilerClient.access$200(ProfilerClient.java:89) [catch] at org.netbeans.lib.profiler.ProfilerClient$SeparateCmdExecutionThread.run(ProfilerClient.java:120)
Missing part of steps is that running NetBeans instance must run another java application via ant. Problem is caused by ugly hack (#46171) in ant infrastructure, which changes content of "java.class.path" system property. Profiler uses "java.class.path" system property to search for classes loaded by system classloader. Of course changing this property, after JVM starts, does not affect system classloader in any way, so the profiler is searching for system classloader classes in the wrong classpath.
Fixed in profiler-main changeset: 284596:e8f7177a362e user: Tomas Hurka <thurka@netbeans.org> date: Thu Mar 12 10:27:49 2015 +0100 summary: invoke setInterface() only for vm-supplied classes