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
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger (show other bugs)
Version: master
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Zoltan Varga
URL:
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)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

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.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

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
https://github.com/mono/mono/pull/5503
Comment 4 David Karlaš 2017-09-22 13:31:53 UTC
PR was merged