Bug 33623 - Assertion at mono-threads.c:144, condition `(suspend_posts + resume_posts + abort_posts) == waits_done' not met
Summary: Assertion at mono-threads.c:144, condition `(suspend_posts + resume_posts + a...
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: GC ()
Version: unspecified
Hardware: Other Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-09-03 16:12 UTC by Alexander Köplinger
Modified: 2015-09-04 22:22 UTC (History)
4 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 Alexander Köplinger 2015-09-03 16:12:51 UTC
Since https://github.com/mono/mono/commit/ef860c3258d937678a94e01152b1af32208148ff there are a lot of those asserts on Linux.

E.g. when running the runtime tests in mono/tests:

> 420 test(s) passed. 9 test(s) did not pass.
> 
> Failed tests:
> 
> remoting4.exe
> =============== remoting4.exe.stdout ===============
> test remoting4.exe
> type: System.Runtime.Remoting.ObjectHandle
> unwrapped type: RemotingTest.R1
> * Assertion at mono-threads.c:144, condition `(suspend_posts + resume_posts + abort_posts) == waits_done' not met
> 
> =============== EOF ===============
> =============== remoting4.exe.stderr ===============
> Stacktrace:
> 
> =============== EOF ===============
> delegate-async-exit.exe
> =============== delegate-async-exit.exe.stdout ===============
> Delegate method
> Async callback foo
> * Assertion at mono-threads.c:144, condition `(suspend_posts + resume_posts + abort_posts) == waits_done' not met
> 
> =============== EOF ===============
> =============== delegate-async-exit.exe.stderr ===============
> Stacktrace:
> 
> =============== EOF ===============
> finalizer-abort.exe
> =============== finalizer-abort.exe.stdout ===============
> Set ID: foo
> finalizer thread ID: foo
> Aborted!
> finalizer thread ID: foo
> Aborted!
> finalizer thread ID: foo
> Aborted!
> finalizer thread ID: foo
> Aborted!
> finalizer thread ID: foo
> Aborted!
> finalizer thread ID: foo
> Aborted!
> finalizer thread ID: foo
> Aborted!
> finalizer thread ID: foo
> Aborted!
> finalizer thread ID: foo
> Aborted!
> finalizer thread ID: foo
> Aborted!
> finalizer thread ID: foo
> Aborted!
> * Assertion at mono-threads.c:144, condition `(suspend_posts + resume_posts + abort_posts) == waits_done' not met
> 
> =============== EOF ===============
> =============== finalizer-abort.exe.stderr ===============
> Stacktrace:
> 
> =============== EOF ===============
> finalizer-exception.exe
> =============== finalizer-exception.exe.stdout ===============
> caught
> * Assertion at mono-threads.c:144, condition `(suspend_posts + resume_posts + abort_posts) == waits_done' not met
> 
> =============== EOF ===============
> =============== finalizer-exception.exe.stderr ===============
> Stacktrace:
> 
> =============== EOF ===============
> finalizer-exit.exe
> =============== finalizer-exit.exe.stdout ===============
> Set ID: foo
> finalizer thread ID: foo
> * Assertion at mono-threads.c:144, condition `(suspend_posts + resume_posts + abort_posts) == waits_done' not met
> 
> =============== EOF ===============
> =============== finalizer-exit.exe.stderr ===============
> Stacktrace:
> 
> =============== EOF ===============
> bug-561239.exe
> =============== bug-561239.exe.stdout ===============
> Main[1]*: waiting
> ThreadMain[1]*: waiting
> Main[1]*: woken
> Main[1]*: disposing
> Main[1]*: disposed
> Main[2]*: waiting
> ThreadMain[2]*: waiting
> Main[2]*: woken
> Main[2]*: disposing
> Main[2]*: disposed
> Main[3]*: waiting
> ThreadMain[3]*: waiting
> Main[3]*: woken
> Main[3]*: disposing
> Main[3]*: disposed
> Main[4]*: waiting
> ThreadMain[4]*: waiting
> Main[4]*: woken
> Main[4]*: disposing
> Main[4]*: disposed
> Main[5]*: waiting
> ThreadMain[5]*: waiting
> Main[5]*: woken
> Main[5]*: disposing
> * Assertion at mono-threads.c:144, condition `(suspend_posts + resume_posts + abort_posts) == waits_done' not met
> 
> =============== EOF ===============
> =============== bug-561239.exe.stderr ===============
> Stacktrace:
> 
> =============== EOF ===============
> appdomain-thread-abort.exe
> =============== appdomain-thread-abort.exe.stdout ===============
> done
> * Assertion at mono-threads.c:144, condition `(suspend_posts + resume_posts + abort_posts) == waits_done' not met
> 
> =============== EOF ===============
> =============== appdomain-thread-abort.exe.stderr ===============
> Stacktrace:
> 
> =============== EOF ===============
> block_guard_restore_aligment_on_exit.exe
> =============== block_guard_restore_aligment_on_exit.exe.stdout ===============
> EEE
> * Assertion at mono-threads.c:144, condition `(suspend_posts + resume_posts + abort_posts) == waits_done' not met
> 
> =============== EOF ===============
> =============== block_guard_restore_aligment_on_exit.exe.stderr ===============
> Stacktrace:
> 
> =============== EOF ===============
> bug-18026.exe
> =============== bug-18026.exe.stdout ===============
> * Assertion at mono-threads.c:144, condition `(suspend_posts + resume_posts + abort_posts) == waits_done' not met
> 
> =============== EOF ===============
> =============== bug-18026.exe.stderr ===============
> Stacktrace:
> 
> =============== EOF ===============




or when running the System testsuite:

>  ***** MonoTests.System.Threading.ThreadTest.SpinWait
>  ***** MonoTests.System.Threading.ThreadTest.Test_Interrupt
>  
> * Assertion at mono-threads.c:144, condition `(suspend_posts + resume_posts + abort_posts) == waits_done' not met
>  
>  Stacktrace:
>  
>    at <unknown> <0xffffffff>
>    at (wrapper managed-to-native) System.Threading.Thread.InterruptInternal (System.Threading.Thread) <IL 0x00031, 0xffffffff>
>    at System.Threading.Thread.Interrupt () [0x00000] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/external/referencesource/mscorlib/system/threading/thread.cs:603
>    at MonoTests.System.Threading.ThreadTest.Test_Interrupt_Worker (object) [0x00007] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mcs/class/corlib/Test/System.Threading/ThreadTest.cs:835
>    at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (object) [0x0000e] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/external/referencesource/mscorlib/system/threading/threadpool.cs:1291
>    at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00081] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/external/referencesource/mscorlib/system/threading/executioncontext.cs:581
>    at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/external/referencesource/mscorlib/system/threading/executioncontext.cs:530
>    at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x0002a] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/external/referencesource/mscorlib/system/threading/threadpool.cs:1268
>    at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00096] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/external/referencesource/mscorlib/system/threading/threadpool.cs:859
>    at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in /var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/external/referencesource/mscorlib/system/threading/threadpool.cs:1196
>    at (wrapper runtime-invoke) <Module>.runtime_invoke_bool (object,intptr,intptr,intptr) <IL 0x00060, 0xffffffff>
>  
>  
> Native stacktrace:
>  
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x4ec59a]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x57c83b]
>  	/lib/x86_64-linux-gnu/libpthread.so.0(+0xf0a0) [0x2ae6e2f440a0]
>  	/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x2ae6e3183165]
>  	/lib/x86_64-linux-gnu/libc.so.6(abort+0x180) [0x2ae6e31863e0]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x748f16]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x748d03]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x748e64]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x73c21b]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x73d75e]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x64505f]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x64173e]
>  	[0x40bb373b]
 



or when running the Debugger testsuite:


>  ***** MonoTests.DebuggerTests.Domains
>  
> * Assertion at mono-threads.c:144, condition `(suspend_posts + resume_posts + abort_posts) == waits_done' not met
>  
>  Stacktrace:
>  
>  
>  
> Native stacktrace:
>  
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x4ec59a]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x57c83b]
>  	/lib/x86_64-linux-gnu/libpthread.so.0(+0xf0a0) [0x2af5e5e510a0]
>  	/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x2af5e6090165]
>  	/lib/x86_64-linux-gnu/libc.so.6(abort+0x180) [0x2af5e60933e0]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x748f16]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x748d03]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x748e64]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x73c21b]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x73d75e]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x5138f7]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono(mono_g_hash_table_foreach+0xc0) [0x674981]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x513b88]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x515f31]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x51614e]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x51616e]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x635fb4]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x41aee6]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono(mono_main+0x187e) [0x4b8d32]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x414fb9]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x414fe9]
>  	/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd) [0x2af5e607cead]
>  	/var/lib/jenkins/workspace/test-mono-mainline/label/debian-amd64/mono/mini/mono() [0x414b79]
Comment 1 Alex Rønne Petersen 2015-09-03 16:26:00 UTC
Here's a native backtrace for `threadpool-exceptions5.exe`:

> (gdb) bt
> #0  0x00007ffff712d0d5 in raise () from /lib/x86_64-linux-gnu/libc.so.6
> #1  0x00007ffff713083b in abort () from /lib/x86_64-linux-gnu/libc.so.6
> #2  0x000000000076ef6b in monoeg_log_default_handler (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR, message=0x7fffe40d86d0 "suspend_thread suspend took 617 ms, which is more than the allowed 200 ms", unused_data=0x0) at goutput.c:233
> #3  0x000000000076ed55 in monoeg_g_logv (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR, format=0x82e650 "suspend_thread suspend took %d ms, which is more than the allowed %d ms", args=0x7fffed0726f8) at goutput.c:113
> #4  0x000000000076ee0e in monoeg_g_log (log_domain=0x0, log_level=G_LOG_LEVEL_ERROR, format=0x82e650 "suspend_thread suspend took %d ms, which is more than the allowed %d ms") at goutput.c:123
> #5  0x0000000000762765 in mono_threads_wait_pending_operations () at mono-threads.c:191
> #6  0x00000000007631a8 in mono_thread_info_suspend_sync (tid=140737167963904, interrupt_kernel=1, error_condition=0x7fffed072c78) at mono-threads.c:642
> #7  0x00000000007635bf in suspend_sync_nolock (id=140737167963904, interrupt_kernel=1) at mono-threads.c:838
> #8  0x00000000007636bc in mono_thread_info_safe_suspend_and_run (id=140737167963904, interrupt_kernel=1, callback=0x663329 <suspend_thread_critical>, user_data=0x7fffed072d00) at mono-threads.c:886
> #9  0x0000000000663534 in suspend_thread_internal (thread=0x7ffff7f54530, interrupt=1) at threads.c:4519
> #10 0x00000000006611ea in mono_thread_suspend_all_other_threads () at threads.c:3135
> #11 0x00000000005f46bc in ves_icall_System_Environment_Exit (result=0) at icall.c:6006
> #12 0x000000004002d012 in ?? ()
> #13 0x0000000000b07d80 in ?? ()
> #14 0x0000000000000000 in ?? ()
Comment 2 Alex Rønne Petersen 2015-09-03 16:27:35 UTC
And full backtrace for all threads: https://gist.github.com/alexrp/aff02b8d3080c57a82b1
Comment 3 Alexander Köplinger 2015-09-04 18:30:56 UTC
I'm not seeing these asserts anymore with https://github.com/mono/mono/commit/0e6617b6648d9e6e161605e652ff1750cc828441. Thanks!
Comment 4 Rodrigo Kumpera 2015-09-04 22:22:31 UTC
Me neither. Forgot to mark this bug as fixed.