Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 338538

Summary: NPE in TCFBreakpointStatusListener during launch
Product: [Tools] TCF Reporter: Anton Leherbauer <aleherb+eclipse>
Component: DebugAssignee: Project Inbox <tcf.debug-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eugene
Version: unspecified   
Target Milestone: 0.4.0   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Proposed patch cdtdoug: iplog-

Description Anton Leherbauer CLA 2011-03-01 09:45:37 EST
This can happen due to a race condition when a launch is added to the launch manager but has not yet started connecting.

Unhandled exception in TCF event dispatch
java.lang.NullPointerException
	at org.eclipse.tm.internal.tcf.cdt.ui.TCFBreakpointStatusListener$BreakpointListener.<init>(TCFBreakpointStatusListener.java:55)
	at org.eclipse.tm.internal.tcf.cdt.ui.TCFBreakpointStatusListener$1.onConnected(TCFBreakpointStatusListener.java:193)
	at org.eclipse.tm.internal.tcf.cdt.ui.TCFBreakpointStatusListener.<init>(TCFBreakpointStatusListener.java:215)
	at org.eclipse.tm.internal.tcf.cdt.ui.Activator$1.run(Activator.java:38)
	at org.eclipse.tm.tcf.EventQueue.run(EventQueue.java:99)
	at java.lang.Thread.run(Unknown Source)
Comment 1 Anton Leherbauer CLA 2011-03-01 10:01:26 EST
The stack trace in comment 0 is from a modified file.  Here is the stack trace for the original file.
java.lang.NullPointerException
    at
org.eclipse.tm.internal.tcf.cdt.ui.TCFBreakpointStatusListener$BreakpointListener.<init>(TCFBreakpointStatusListener.java:46)
    at
org.eclipse.tm.internal.tcf.cdt.ui.TCFBreakpointStatusListener$1.onConnected(TCFBreakpointStatusListener.java:129)
    at
org.eclipse.tm.internal.tcf.cdt.ui.TCFBreakpointStatusListener.<init>(TCFBreakpointStatusListener.java:151)
    at org.eclipse.tm.internal.tcf.cdt.ui.Activator$1.run(Activator.java:38)
    at org.eclipse.tm.tcf.EventQueue.run(EventQueue.java:99)
    at java.lang.Thread.run(Unknown Source)
Comment 2 Anton Leherbauer CLA 2011-03-01 10:05:45 EST
Created attachment 190040 [details]
Proposed patch

This adds another check before attaching the breakpoint listener to the launch.
Comment 3 Eugene Tarassov CLA 2011-03-02 01:19:25 EST
Committed.
Thanks!