Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330289 - [variables] Race condition when updating a variable object
Summary: [variables] Race condition when updating a variable object
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Marc Khouzam CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-15 15:59 EST by Marc Khouzam CLA
Modified: 2010-11-18 10:32 EST (History)
3 users (show)

See Also:


Attachments
Fix (1.78 KB, patch)
2010-11-17 16:29 EST, Marc Khouzam CLA
marc.khouzam: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Khouzam CLA 2010-11-15 15:59:59 EST
I noticed with this simple code

	int a[2] = {0,1};
	return a[0];

that if I show the variable view and expand 'a' on line 1 and then step to line 2, the content of a[0] and a[1] does not always show properly.

I tracked it down to a race condition that was introduced in the pretty-printing effort, within the state change of the variable object.  I'm working on a patch now.
Comment 1 Marc Khouzam CLA 2010-11-17 16:29:11 EST
Created attachment 183352 [details]
Fix

Because we now have a async call when receiving the answer to -var-update, we cannot immediately change the state from STATE_UPDATING to STATE_READY.  We have to wait until the async call is completed to set the state, so that we ensure the varObj is not read before we've finished processing the result of -var-update.

Committed to HEAD.

Jens, does it look good to you?
Comment 2 Marc Khouzam CLA 2010-11-17 16:30:16 EST
Fixed
Comment 3 CDT Genie CLA 2010-11-17 17:23:02 EST
*** cdt cvs genie on behalf of mkhouzam ***
Bug 330289: [variables] Race condition when updating a variable object

[*] MIVariableManager.java 1.17 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIVariableManager.java?root=Tools_Project&r1=1.16&r2=1.17
Comment 4 Jens Elmenthaler CLA 2010-11-18 10:32:12 EST
(In reply to comment #1)
> Created an attachment (id=183352) [details]
> Fix
...
> Jens, does it look good to you?
Yes, looks much better now. Thanks.