Bug 60535 - DebuggerTests.Dispose fails often on Linux
Summary: DebuggerTests.Dispose fails often on Linux
Status: RESOLVED ANSWERED
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger ()
Version: master
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2017-11-06 19:23 UTC by Alexander Köplinger [MSFT]
Modified: 2018-03-20 16:08 UTC (History)
2 users (show)

Tags: clean-ci
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 ANSWERED

Description Alexander Köplinger [MSFT] 2017-11-06 19:23:13 UTC
Run "make -C mcs/class/Mono.Debugger.Soft check FIXTURE=DebuggerTests.Dispose" on Linux, it fails about 40% of the time there with the following error:

> ...* Assertion at threads.c:5069, condition `thread_info' not met
> 
> F
> Tests run: 1, Passed: 0, Errors: 1, Failures: 0, Inconclusive: 0
>   Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0
> Elapsed time: 00:00:00.5470000
> 
> Errors and Failures:
> 
> 1) Dispose (MonoTests.DebuggerTests.Dispose)
>      Expected: 3
>   But was:  134
> 
> TearDown : Mono.Debugger.Soft.VMDisconnectedException : Exception of type 'Mono.Debugger.Soft.VMDisconnectedException' was thrown.
>   at MonoTests.DebuggerTests.Dispose () [0x00043] in /home/alexander/dev/mono/mcs/class/Mono.Debugger.Soft/Test/dtest.cs:2343 
>   at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
>   at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /home/alexander/dev/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:305 
> 
> --TearDown
>   at Mono.Debugger.Soft.Connection.SendReceive (Mono.Debugger.Soft.Connection+CommandSet command_set, System.Int32 command, Mono.Debugger.Soft.Connection+PacketWriter packet) [0x00117] in /home/alexander/dev/mono/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs:1570 
>   at Mono.Debugger.Soft.Connection.SendReceive (Mono.Debugger.Soft.Connection+CommandSet command_set, System.Int32 command) [0x00000] in /home/alexander/dev/mono/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs:1573 
>   at Mono.Debugger.Soft.Connection.VM_Resume () [0x00000] in /home/alexander/dev/mono/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs:1670 
>   at Mono.Debugger.Soft.VirtualMachine.Resume () [0x00006] in /home/alexander/dev/mono/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/VirtualMachine.cs:125 
>   at MonoTests.DebuggerTests.TearDown () [0x0001c] in /home/alexander/dev/mono/mcs/class/Mono.Debugger.Soft/Test/dtest.cs:347 
>   at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
>   at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in /home/alexander/dev/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:305 


This is one of the top failing tests on Jenkins in master builds, it's hidden in PR builds because of the failing tests retry.
It doesn't seem to happen on OSX.

--

mono master/1a79065f8cd9
Ubuntu 16.04
Comment 3 Zoltan Varga 2017-11-09 23:30:26 UTC
Disregard the last 2 comments.
Comment 4 Zoltan Varga 2017-11-10 05:58:29 UTC
So what seems to happen is mono_thread_detach_internal () gets called on a thread which calls
mono_thread_info_unset_internal_thread_gchandle () on thread->thread_info which is NULL leading to the assert.
Comment 5 Zoltan Varga 2017-11-16 23:23:08 UTC
https://github.com/mono/mono/pull/6036
Comment 6 Alexander Köplinger [MSFT] 2018-03-20 16:08:50 UTC
Let's track this with https://github.com/mono/mono/issues/7712 going forward.