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.
System.SystemException: Thread creation failed.
at System.Threading.Thread.Start () [0x0005c] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading/Thread.cs:724
at System.Threading.Thread.Start (System.Object parameter) [0x00007] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading/Thread.cs:966
at System.Net.WebClient.UploadStringAsync (System.Uri address, System.String method, System.String data, System.Object userToken) [0x00082] in /Developer/MonoTouch/Source/mono/mcs/class/System/System.Net/WebClient.cs:1338
at Avalanche.iOS.iPhone.MonoCommunicator.InternalExecute (Avalanche.Engine.ExecuteFunctionMessage message) [0x001a4] in /Users/Transfer/Projects/Dev/Dev/Src/Engine/MonoCommunicator.cs:780
I get this exception sometimes.. I will add more stacktraces when it happens again.
Happend again, same stacktrace as the one before. After this error occured clicking inside of the app crashed the app.
Henning, did you get any message on the console related to thread creation before that error?
Can you provide us with a test case?
i have same error, may be it happened in backgound working
0x00df28af monotouch_unhandled_exception_handler (monotouch-glue.m:1439)
0x00d63edc mono_invoke_unhandled_exception_hook (mini-exceptions.c:2561)
0x00d1f06a mono_thread_abort (mini.c:2629)
0x00d661da mono_handle_exception_internal + 2138
0x00d662a8 mono_handle_exception (mini-exceptions.c:1902)
0x00d9889c mono_arm_throw_exception (exceptions-arm.c:164)
0x007db50f throw_exception + 67
0x0074ad0f System.Threading.Thread:Start (Thread.cs:966)
0x001ae82b System.Net.WebClient:UploadStringAsync (WebClient.cs:1338)
0x001ae63f System.Net.WebClient:UploadStringAsync (WebClient.cs:1304)
0x001ae5f3 System.Net.WebClient:UploadStringAsync (WebClient.cs:1101)
Marek/Martin, is the last backtrace a bug in WebClient?
Check with Martin but the implementation is definitely not optimal. It looks like it can create unlimited number of threads which we probably don't have well on limited systems like iOS.
This bug has been in the NEEDINFO state with no changes for the last 90 days. Can we put this back into the NEW or CONFIRMED state, or are we still awaiting response?
If there is no change in the status of this bug over the next two weeks, this bug will be marked as NORESPONSE.
I don't know if it is the same bug or just related, but it seems close enough.
That is the crash that happens sometimes in our app when adding a thread. Symptoms seem exactly the same - random crash with most informative "Thread creation failed". The app had a total of 22 threads by the moment it has crashed (according to the crashlytics).
From case 63931:
I have a random crash in my application with the following stacktrace
System.Exception: System.SystemException: Thread creation failed.
at System.Threading.Thread.Start () [0x00000] in <filename unknown>:0
at gr.entersoft.esmobile.AppConstants+<updateSessionToken>c__AnonStorey0.<>m__1 (System.Object sender, MonoTouch.UIKit.UIButtonEventArgs args) [0x00000] in <filename unknown>:0
at MonoTouch.UIKit.UIAlertView+_UIAlertViewDelegate.Clicked (MonoTouch.UIKit.UIAlertView alertview, Int32 buttonIndex) [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string,intptr,intptr)
at MonoTouch.UIKit.UIApplication.Main (System.String args, System.String principalClassName, System.String delegateClassName) [0x00000] in <filename unknown>:0
at gr.entersoft.esmobile.Application.Main (System.String args) [0x00000] in <filename unknown>:0
I don't have a test project that reproduces the problem because it is random.
my version info is
=== Xamarin Studio ===
Version 4.2.3 (build 59)
Installation UUID: c3fb9926-4ae4-4f38-9ddf-04578ff14659
Mono 3.2.6 ((no/9b58377)
GTK+ 2.24.23 theme: Raleigh
Package version: 302060000
Apple Developer Tools
Xcode 5.0.1 (3335.23)
Version: 220.127.116.11 (Enterprise Edition)
Build date: 2014-17-02 17:43:23-0500
Mac OS X 10.8.5
Re comment #20: that doesn't look like the same stack trace as the original reporter, but in any case that trace doesn't reveal much about the cause of this exception, so we'd need a test project in order to figure out what's happening.
I can reproduce this easily enough by just creating an unlimited number of threads. On my iPad Air 2 I get to about 1400 threads before something goes wrong.
However that is not a bug, but a system limit (it seems the app runs out of memory), and at that point there's not much we can do about it.
So if this happens to someone, please provide the following:
1) The output from the device log. This is important, since it will make us able to determine the exact reason why thread creation failed. In my case for instance (when hitting the system limit), this is printed: "<Warning>: warning: create_thread: CreateThread error 0x0".
2) Any crash reports. This will help us determine if it really is a system limit, or if it's something else (since the crash report will show how many running threads there are).
We have not received any further information. If anyone is still experiencing this issue please provide all the requested information and re-open the bug report. Thanks!
Can anyone still reproduce this issue? I was able to visit the URL below and find its still occurring in various versions of Safari and internet explorer 11, but it is intermittent.
iPad latest also gives me trouble, anyone confirm?
@Tristan, please provide the information requested in comment #22 if you can reproduce this.