Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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
Developer Community or GitHub 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.
The following crash: Assertion at ../../../../../mono/mono/utils/mono-threads.c:155, condition `result' not met
happens on code that works as expected on Xamarin.iOS 6.2, but causes this problem on Xamarin.iOS 6.4
The issue is in NSObject::InvokeInBackground, as a workaround, use the C# facilities for that. Such as ThreadPool.QueueUserWorkItem, Task.Run or simply create a new Thread.
One issue we found: InvokeInBackground creates a new thread eveyr time, which is very expensive.
So people should instead use the ThreadPool whenever possible.
Created attachment 4509 [details]
Crash from Case 42483
Created attachment 4512 [details]
Test Project from Case 42483
*** Bug 13714 has been marked as a duplicate of this bug. ***
Workaround for NSObject.InvokeInBackground (use System.Threading.Thread instead) committed.
Fix for NSThread is still pending.
Reopening since only a workaround has been committed.
The simple INvokeOnBackgroundThread went out in 6.4.3.
The case for the manual Thread case is still not handled.
Is there an ETA for the fix causing crashes when manually starting a thread?
Not yet. For now use System.Threading.Thread.
The same issue seem to be occurring using System.Treading.Thread
So to be clear, in what's cases should this issue occur?
System.Threading.Thread is not affected, perhaps another bit of your code was using either NSThread or InvokeInBackground (that one was fixed)
Well that is strange, I've search through our entire solution and besides System.Threading.Thread and System.Threading.Tasks.Task we dont use anything else. So nothing like NSThread or InvokeInBackground.
Then that is likely a different reason.
Please file a complete bug report with your version numbers, SDK versions, ideally the test case and so on.
Ok, will do.
I'll try to create a propper testcase.
My app sometimes crashes in the simulator with this error message (mono-thread.c:155, condition 'result' not met).
My app makes use of DispatchQueues, most of the time there are three queues running simultaneously, like three threads. Then I searched my solution for InvokeInBackground, but found none. The only references to other libraries are bindings to native ObjC libraries, so I'm pretty sure my app does not call Mono's NSObject wrappers.
Also, the crash occurs *sometimes*. There's no way to deterministically reproduce it.
Also, before the crash happens, there are some error logs like this:
failed to suspend thread 0xb033c000, hopefully it is dead
I can confirm that behavior, I also do sometimes see messages like "failed to suspend thread 0xb033c000, hopefully it is dead"
NSThread's initWithTarget:selector:object: has been fixed too now.