Bug 58612 - When 2 breakpoints are hit at "same time" 2nd thread frames count==0
Summary: When 2 breakpoints are hit at "same time" 2nd thread frames count==0
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger (show other bugs)
Version: master
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Zoltan Varga
Depends on:
Blocks: 41739
  Show dependency tree
Reported: 2017-08-07 12:49 UTC by David Karlaš
Modified: 2017-09-22 13:31 UTC (History)
2 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:


Description David Karlaš 2017-08-07 12:49:10 UTC
Here is sample code for repro: https://gist.github.com/DavidKarlas/41f91681ae730e0fbb363495d2f59b1a
Here is log file of bug: https://gist.github.com/DavidKarlas/dee4a2616689f9d36adc6474e5938461
Reproduction steps:
Inside VSfM place breakpoint at https://gist.github.com/DavidKarlas/41f91681ae730e0fbb363495d2f59b1a#file-gistfile1-txt-L20 and start debugging, breakpoint will be hit, then resume execution... What will happen is... IDE will be in weird state where you can resume execution but can't see call stack or evaluate values... This is because runtime returned 0 frames for 2nd thread.

What happens here is this... If 2 breakpoints are hit on 2 threads at "same time" as seen at https://gist.github.com/DavidKarlas/dee4a2616689f9d36adc6474e5938461#file-gistfile1-txt-L579-L580 IDE evaluate state of 1st thread and when user requests Resume, IDE sends resume, but runtime is still in suspended state, because more breakpoints are pending(resume was for 1st breakpoint). And after that IDE request CMD_THREAD_GET_FRAME_INFO for 2nd thread(0x7000054c7000), so it can display call stack and evaluate variables... This can be seen at https://gist.github.com/DavidKarlas/dee4a2616689f9d36adc6474e5938461#file-gistfile1-txt-L734-L735 but 0 frames are returned, this is wrong... It should return frames like it did for 1st thread(both have roughly same call stack).
Comment 1 Lluis Sanchez 2017-09-01 14:12:14 UTC
Zoltan, any update on this?
Comment 2 Zoltan Varga 2017-09-04 15:32:13 UTC
What seems to happen is that hitting the second breakpoint causes the first thread which hit the breakpoint to be interrupted, and the interrupt handler overwrites the stacktrace.
Comment 3 Zoltan Varga 2017-09-05 00:30:41 UTC
Comment 4 David Karlaš 2017-09-22 13:31:53 UTC
PR was merged

Notice (2018-05-21): bugzilla.xamarin.com will be switching to read-only mode on Thursday, 2018-05-25 22:00 UTC.

Please join us on Visual Studio Developer Community and GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs and copy them to the new locations as needed for follow-up. The See Also field on each Bugzilla bug will be updated with a link to its new location when applicable.

After Bugzilla is read-only, if you have new information to add for a bug that does not yet have a matching issue on Developer Community or GitHub, you can create a follow-up issue in the new location. Copy and paste the title and description from this bug, and then add your new details. You can get a pre-formatted version of the title and description here:

In special cases you might also want the comments:

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Note You need to log in before you can comment on or make changes to this bug.