NEW DATE! Bugzilla will undergo maintenance 2024-03-28 18h00 CET. Bugzilla will be placed in read-only mode at that time.

Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 415362 - [visualizer] occasional exception when exercising step into selection
Summary: [visualizer] occasional exception when exercising step into selection
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.4.0   Edit
Assignee: Alvaro Sanchez-Leon CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-19 13:32 EDT by Alvaro Sanchez-Leon CLA
Modified: 2014-08-27 11:56 EDT (History)
5 users (show)

See Also:


Attachments
Exception log (3.55 KB, text/plain)
2013-08-19 13:32 EDT, Alvaro Sanchez-Leon CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alvaro Sanchez-Leon CLA 2013-08-19 13:32:22 EDT
Created attachment 234544 [details]
Exception log

When exercising the step into selection feature and the Multicore Visualizer is present in the active perspective,  the exception in the attachment is occasionally triggered.
  
This has been seen in All stop mode as well as in non stop mode, and switching between them may help trigger the issue.

Not sure if it is relevant but the issue was triggered when the selected step into selection function was at a different line than the current stopped line.
e.g. stopped at line 10 and trigger step into selection by hovering over a selected function on line 20.
Comment 1 Marc Dumais CLA 2013-08-29 13:57:04 EDT
I was able to reproduce this issue quite consistently, without much effort (maybe I was lucky).

The assertion catches a case that in principle should not happen: receiving a IResumedDMEvent for a thread that is not known to be suspended.  To debug, I have added printouts in MulticoreVisualizerEventListener.handleEvent() for both ISuspendedDMEvent and IResumedDMEvent events.  When reproducing the bug, it seems that we receive two or more IResumedDMEvent in a row, without being separated by an ISuspendedDMEvent .  

I suspect that the step into selection feature causes GDB to stop and resume execution a few times.  Could it be that the CDT UI is not made aware of some of those events?  Could one or more IResumedDMEvent be sent without its corresponding ISuspendedDMEvent? 

Here is the GDB trace for one instance of the bug, with added temporary traces for both ISuspendedDMEvent and IResumedDMEvent events.  There are 3 IResumedDMEvent that seems to have no corresponding ISuspendedDMEvent.


993,184 [MI]  191-stack-info-depth --thread 1
993,185 [MI]  191^done,depth="1"
993,190 [MI]  (gdb) 
993,195 [MI]  192-break-insert --thread-group i1 -t -p 1 -f /opt/ericsson/workspaces/runtime-marctes\
tlaunchconfig/Composite/src/Composite.cc:178
993,199 [MI]  192^done,bkpt={number="7",type="breakpoint",disp="del",enabled="y",addr="0x00000000004\
01d39",func="main()",file="../src/Composite.cc",fullname="/opt/ericsson/workspaces/runtime-marctestl\
aunchconfig/Composite/src/Composite.cc",line="178",thread="1",thread="1",times="0",original-location\
="/opt/ericsson/workspaces/runtime-marctestlaunchconfig/Composite/src/Composite.cc:178"}
993,202 [MI]  (gdb) 
993,207 [MI]  193-exec-continue --thread 1
993,209 [MI]  193^running
993,211 [MI]  *running,thread-id="1"
993,213 [MI]  (gdb) 
993,216 [MI]  =breakpoint-modified,bkpt={number="7",type="breakpoint",disp="del",enabled="y",addr="0\
x0000000000401d39",func="main()",file="../src/Composite.cc",fullname="/opt/ericsson/workspaces/runti\
me-marctestlaunchconfig/Composite/src/Composite.cc",line="178",thread="1",thread="1",times="1",origi\
nal-location="/opt/ericsson/workspaces/runtime-marctestlaunchconfig/Composite/src/Composite.cc:178"}\

993,218 [MI]  *stopped,reason="breakpoint-hit",disp="del",bkptno="7",frame={addr="0x0000000000401d39\
",func="main",args=[],file="../src/Composite.cc",fullname="/opt/ericsson/workspaces/runtime-marctest\
launchconfig/Composite/src/Composite.cc",line="178"},thread-id="1",stopped-threads=["1"],core="0"
993,221 [MI]  =breakpoint-deleted,id="7"
*
*** handleEvent(IResumedDMEvent event)
*
993,227 [MI]  194-stack-info-depth --thread 1
993,228 [MI]  194^done,depth="1"
993,229 [MI]  (gdb) 
993,231 [MI]  195-exec-step --thread 1 1
993,232 [MI]  195^running
993,233 [MI]  *running,thread-id="1"
993,235 [MI]  (gdb) 
*
*** handleEvent(IResumedDMEvent event)
*
993,239 [MI]  *stopped,reason="end-stepping-range",frame={addr="0x0000000000402c99",func="LeafNode::\
LeafNode",args=[{name="this",value="0x608d70"},{name="name",value="..."}],file="../src/Leaf.cc",full\
name="/opt/ericsson/workspaces/runtime-marctestlaunchconfig/Composite/src/Leaf.cc",line="10"},thread\
-id="1",stopped-threads=["1"],core="1"
unexpected thread state!
389,807 [MI]  196-stack-info-depth --thread 1
389,812 [MI]  196^done,depth="2"
389,813 [MI]  (gdb) 
389,821 [MI]  197-exec-finish --thread 1 --frame 0
389,824 [MI]  197^running
389,825 [MI]  *running,thread-id="1"
389,825 [MI]  (gdb) 
389,825 [MI]  *stopped,reason="function-finished",frame={addr="0x0000000000401d7c",func="main",args=\
[],file="../src/Composite.cc",fullname="/opt/ericsson/workspaces/runtime-marctestlaunchconfig/Compos\
ite/src/Composite.cc",line="178"},thread-id="1",stopped-threads=["1"],core="1"
*
*** handleEvent(IResumedDMEvent event)
*
unexpected thread state!
391,079 [MI]  198-stack-info-depth --thread 1
391,083 [MI]  198^done,depth="1"
391,085 [MI]  (gdb) 
391,089 [MI]  199-exec-step --thread 1 1
391,092 [MI]  199^running
391,093 [MI]  *running,thread-id="1"
391,094 [MI]  (gdb) 
*
*** handleEvent(IResumedDMEvent event)
*
391,101 [MI]  *stopped,reason="end-stepping-range",frame={addr="0x0000000000403116",func="CompositeN\
ode::Add",args=[{name="this",value="0x608c70"},{name="child",value="0x608d70"}],file="../src/Composi\
te.cc",fullname="/opt/ericsson/workspaces/runtime-marctestlaunchconfig/Composite/src/Composite.cc",l\
ine="19"},thread-id="1",stopped-threads=["1"],core="1"
unexpected thread state!
392,075 [MI]  200-stack-info-depth --thread 1
392,076 [MI]  200^done,depth="2"
392,077 [MI]  (gdb) 
*
*** handleEvent(ISuspendedDMEvent event)
*
392,090 [MI]  201-thread-info 1
392,094 [MI]  201^done,threads=[{id="1",target-id="process 18451",name="Composite",frame={level="0",\
addr="0x0000000000403116",func="CompositeNode::Add",args=[{name="this",value="0x608c70"},{name="chil\
d",value="0x608d70"}],file="../src/Composite.cc",fullname="/opt/ericsson/workspaces/runtime-marctest\
launchconfig/Composite/src/Composite.cc",line="19"},state="stopped",core="1"}]
392,095 [MI]  (gdb) 
392,116 [MI]  202-stack-info-depth --thread 1 2
392,117 [MI]  202^done,depth="2"
392,118 [MI]  (gdb) 
392,148 [MI]  203-stack-info-depth --thread 1 11
392,149 [MI]  203^done,depth="2"
392,149 [MI]  (gdb) 
392,794 [MI]  204-list-thread-groups
392,796 [MI]  204^done,groups=[{id="i1",type="process",pid="18451",executable="/opt/ericsson/workspa\
ces/runtime-marctestlaunchconfig/Composite/Debug/Composite",cores=["1"]}]
392,797 [MI]  (gdb) 
392,827 [MI]  205-stack-info-depth --thread 1
392,828 [MI]  205^done,depth="2"
392,829 [MI]  (gdb) 
392,831 [MI]  206-var-create --thread 1 --frame 0 - * terrier->Add
392,861 [MI]  206^error,msg="-var-create: unable to create variable object"
392,865 [MI]  (gdb) 
392,880 [MI]  207-data-evaluate-expression --thread 1 --frame 0 terrier->Add
392,893 [MI]  208-var-create --thread 1 --frame 0 - * terrier->Add
392,894 [MI]  207^error,msg="No symbol \"terrier\" in current context."
392,896 [MI]  (gdb) 
392,910 [MI]  208^error,msg="-var-create: unable to create variable object"
392,917 [MI]  (gdb) 
392,954 [MI]  209-stack-list-frames --thread 1 0 1
392,956 [MI]  209^done,stack=[frame={level="0",addr="0x0000000000403116",func="CompositeNode::Add",f\
ile="../src/Composite.cc",fullname="/opt/ericsson/workspaces/runtime-marctestlaunchconfig/Composite/\
src/Composite.cc",line="19"},frame={level="1",addr="0x0000000000401d8b",func="main",file="../src/Com\
posite.cc",fullname="/opt/ericsson/workspaces/runtime-marctestlaunchconfig/Composite/src/Composite.c\
c",line="178"}]
392,957 [MI]  (gdb) 
392,961 [MI]  210-stack-list-frames --thread 1
392,963 [MI]  210^done,stack=[frame={level="0",addr="0x0000000000403116",func="CompositeNode::Add",f\
ile="../src/Composite.cc",fullname="/opt/ericsson/workspaces/runtime-marctestlaunchconfig/Composite/\
src/Composite.cc",line="19"},frame={level="1",addr="0x0000000000401d8b",func="main",file="../src/Com\
posite.cc",fullname="/opt/ericsson/workspaces/runtime-marctestlaunchconfig/Composite/src/Composite.c\
c",line="178"}]
392,964 [MI]  (gdb)
Comment 2 Alvaro Sanchez-Leon CLA 2013-09-04 08:46:55 EDT
New gerrit change has been submitted:
https://git.eclipse.org/r/#/c/16106/

The basic idea is to propagate the running state during the start of the Runtoline and step into selection operations, 
and then broadcast the stop at the end of it.  i.e. no intermediate state notifications will be broadcasted e.g. during the processing of single steps.
Comment 3 Marc Khouzam CLA 2013-09-06 13:50:02 EDT
I've committed the fix to master.

I cannot commit it to cdt_8_2 because it adds an API.  But since the exception is an assert, it is not essential for cdt_8_2