Bug 34802

Summary: Debugger crash on break-all, step into sequence.
Product: Android Reporter: Przemysław Raciborski <przemyslawraciborski>
Component: DebuggerAssignee: Jatin <jatint>
Severity: normal CC: abhishekk, andi.mcclure, ashley.gazich, brendan.zagaeski, chrisntr, dominic, jatint, mono-bugs+monodroid, shrutis, vargaz
Priority: ---    
Version: 5.2   
Target Milestone: 7.1 (C9)   
Hardware: PC   
OS: Windows   
Tags: BZCU Is this bug a regression?: ---
Last known good build:

Description Przemysław Raciborski 2015-10-13 05:41:34 UTC
Latest stable Xamarin.Android (10/13/2015), Windows 10, Visual Studio 2015, debug on VS Emulator 5.5" KitKat 4.4.

Debugger crash on: break-all, step into sequence with message:

In mgmain JNI_OnLoad
10-13 11:39:17.895 F/        ( 2315): * Assertion at /Users/builder/data/lanes/2185/53fce373/source/mono/mono/mini/debugger-agent.c:5415, condition `tls->context.valid' not met
10-13 11:39:17.895 F/libc    ( 2315): Fatal signal 6 (SIGABRT) at 0x0000090b (code=-6), thread 2333 (rtpl.mobiquesto)
Step request failed: Exception of type 'Mono.Debugger.Soft.VMDisconnectedException' was thrown.
Comment 1 Ashley Gazich [MSFT] 2015-10-15 16:31:32 UTC

Thanks for submitting the report! When you have some time, would you mind adding some additional information to help us with this investigation, please?

1. Sample project demonstrating the behavior

2. Step-by-step process to reproduce

3. Debug logs
Visual Studio: View -> Output -> Show output from: Debug

4. Xamarin for Visual Studio logs (you can copy + paste this into the location bar in Explorer to find them): %LOCALAPPDATA%\Xamarin\Log

5. Full version information
Visual Studio: Help > About Microsoft Visual Studio > Copy Info [button]

Comment 2 Przemysław Raciborski 2015-11-10 12:13:10 UTC
This is met in every project!

Start debugging project.
Click Debug on Visual studio toolbar and then "Break all".
Then click continue button on Visual studio toolbar.
Comment 3 Andi McClure 2016-11-09 18:52:42 UTC
*** Bug 42836 has been marked as a duplicate of this bug. ***
Comment 4 Andi McClure 2016-11-09 18:54:10 UTC
Duped 42836 to this, inherited 42836's C9 status. Zoltan Varga is working on a patch.
Comment 5 Zoltan Varga 2016-11-09 20:04:10 UTC
The original issue should be fixed in mono master/4.8.
Comment 6 Andi McClure 2016-11-09 20:08:54 UTC
Fix in 4.8 is f42685a7efdf14aeb61c73cb15801d706c93b189
Comment 7 Jatin 2016-11-18 15:07:46 UTC
Reproduced Status:

I am successfully able to reproduce this issue on both MAC and Window Environment.

Steps to Reproduce:
1. Open VS/XS (Window/MAC)
2. Create an Android Application.
3. Run the application on VS Emulator/Android Device
4. Click Break All (ctrl+alt+break) present on toolbar and then click on step into/step over.

Actual Result: Debugger crashes with message "* Assertion at /Users/builder/data/lanes/4009/0a4ab557/source/mono/mono/mini/debugger-agent.c:5401, condition `tls->context.valid' not met
11-18 20:03:55.779 F/libc    ( 2117): Fatal signal 6 (SIGABRT), code -6 in tid 2141 (Debugger agent)
Step request failed: Exception of type 'Mono.Debugger.Soft.VMDisconnectedException' was thrown."

Screencast: http://www.screencast.com/t/MO0IEghq

======Window Environment Supplement Info======
*Master Build:
Debug Output: https://gist.github.com/anonymous/1bb3bf91f8ee09bea37b9416537ce092
Build Output: https://gist.github.com/anonymous/551dd29460ddde1cbfd638be6050ef3b
Environment Info: Envt: https://gist.github.com/anonymous/4e3e99427ea3d1ae98dc95e66569044c
Device log: https://gist.github.com/anonymous/14123b157f54c271313d0545cacbd016
IDE Log: https://gist.github.com/anonymous/11e1e43e644b7bd62bce6f6a9ae20a09

*Cycle 9 Build:
Debug Output: https://gist.github.com/anonymous/39e6b06f9a3a06fcf9d2af0433664090
Build Output: https://gist.github.com/anonymous/f9374f4d6d3fc2c48bdf0cf5114a1f54
IDE Log: https://gist.github.com/anonymous/9e0327f9812bc4b74fc3c3a4202eca84
Envt Info: https://gist.github.com/anonymous/a617394e41b1a961f6926f837f1d0509

======MAC Environment Supplement Info======
*Cycle 9 Build:
Application Output: https://gist.github.com/anonymous/badbfda955bf6cc9eea186bcc503b751
Device Log: https://gist.github.com/anonymous/fcda7d064a6984a8c94dd7079406fcc5
Build Output: https://gist.github.com/anonymous/434114bb5be80868277a1ef08efe6921
Environment Info and IDE Log: https://gist.github.com/shrutis360/ec4661a63950ffe33a7b02f816911b4d

Note: As per comment6, I am still getting this issue with 
MonoFramework-MDK- on MAC Envt. 

Hence, changing the bug status to Reopened.