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.

Bug 212492 - NPE in ProfilingSessionStatus.updateInstrMethodsInfo
Summary: NPE in ProfilingSessionStatus.updateInstrMethodsInfo
Status: RESOLVED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: jtau8042
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-14 16:01 UTC by Jiri Sedlacek
Modified: 2012-09-21 02:24 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
fix (814 bytes, patch)
2012-09-18 13:17 UTC, jtau8042
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Sedlacek 2012-05-14 16:01:40 UTC
Steps:

 0/ Disable marker methods for Java SE (comment out content of mf-layer.xml)
 1/ Create AnagramGame
 2/ Insert Reset Results profiling point in com.toy.anagrams.ui.Anagrams:261
 3/ CPU, Advanced, Customize, select com.toy.anagrams.ui.Anagrams$2 ~ $5, Profile only project classes
 4/ Start profiling

The following exception is thrown by the profiled app:

java.lang.NullPointerException
	at org.netbeans.lib.profiler.global.ProfilingSessionStatus.updateInstrMethodsInfo(ProfilingSessionStatus.java:373)
	at org.netbeans.lib.profiler.server.ProfilerInterface.updateInstrClassAndMethodNames(ProfilerInterface.java:1347)
	at org.netbeans.lib.profiler.server.ProfilerInterface.getAndInstrumentClasses(ProfilerInterface.java:677)
	at org.netbeans.lib.profiler.server.ProfilerInterface.classLoadHook(ProfilerInterface.java:946)
	at com.toy.anagrams.ui.Anagrams.initComponents(Anagrams.java:172)
	at com.toy.anagrams.ui.Anagrams.<init>(Anagrams.java:80)
	at com.toy.anagrams.ui.Anagrams.main(Anagrams.java:70)
Comment 1 jtau8042 2012-09-18 13:17:30 UTC
Created attachment 124511 [details]
fix

The first server-side call to updateInstrMethodsInfo() with nMethods=0 result in nInstrMethods=1 and instrMethodInvoked=null. Which breaks class invariant and produce NPE in subsequent calls to the updateInstrMethodsInfo() method.
Comment 2 jtau8042 2012-09-18 15:05:51 UTC
fixed in: http://hg.netbeans.org/profiler-main/rev/111007aa602b
Comment 3 Quality Engineering 2012-09-21 02:24:39 UTC
Integrated into 'main-golden', will be available in build *201209210001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/111007aa602b
User: Jan Taus <jtau8042@netbeans.org>
Log: #212492: NPE in ProfilingSessionStatus.updateInstrMethodsInfo