Bug 60363 - Sporadic failures in WaitAnyWithSecondMutexAbandoned has reoccured on jenkins builds.
Summary: Sporadic failures in WaitAnyWithSecondMutexAbandoned has reoccured on jenkins...
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: master
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: johan.lorensson
Depends on:
Reported: 2017-10-25 08:46 UTC by johan.lorensson
Modified: 2017-11-07 00:24 UTC (History)
3 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 for Bug 60363 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description johan.lorensson 2017-10-25 08:46:32 UTC
The following commit, https://github.com/mono/mono/commit/52b96a92338bac9107cefc3cf316120c8449e397, changed the behavior to use mono_thread_join to wait upon a thread in ves_icall_System_Threading_Thread_Join_internal. Since the finalizer thread is periodically running mono_threads_join_threads, there might be a small risk that the finalizer thread is currently waiting on the same thread id, and then mono_thread_join won’t find the thread id in the list and assumes the thread has already completed. This issue was explained in https://github.com/mono/mono/pull/5599, but with above commit it is now causing sporadic failures.

The fix is not make it possible for a mono_thread_join to detect if another thread is joining the same thread id and wait until that thread has completed its join (should be a quite small window). That will prevent threads doing mono_thread_join in parallel on the same thread id to race.