Bug 3736 - System.SystemException: Thread creation failed
Summary: System.SystemException: Thread creation failed
Status: RESOLVED NORESPONSE
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 5.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-03-02 18:15 UTC by René Ruppert
Modified: 2017-11-28 09:02 UTC (History)
15 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 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.

Related Links:
Status:
RESOLVED NORESPONSE

Comment 11 Henning 2013-06-13 06:26:28 UTC
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.
Comment 12 Henning 2013-07-02 04:26:40 UTC
Happend again, same stacktrace as the one before. After this error occured clicking inside of the app crashed the app.
Comment 13 Rodrigo Kumpera 2013-07-03 12:19:03 UTC
 Henning, did you get any message on the console related to thread creation before that error?

Can you provide us with a test case?
Comment 14 v.fumin 2013-07-16 11:44:37 UTC
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)
Comment 15 Rodrigo Kumpera 2013-07-16 11:48:49 UTC
Marek/Martin, is the last backtrace a bug in WebClient?
Comment 16 Marek Safar 2013-07-16 12:01:04 UTC
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.
Comment 17 PJ 2013-11-19 17:05:22 UTC
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.
Comment 18 Andrei 2013-12-04 09:11:06 UTC
I don't know if it is the same bug or just related, but it seems close enough.
http://crashes.to/s/602658beb39
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).
Comment 20 Jon Goldberger [MSFT] 2014-03-11 12:33:19 UTC
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

Runtime:

Mono 3.2.6 ((no/9b58377)

GTK+ 2.24.23 theme: Raleigh

GTK# (2.12.0.0)

Package version: 302060000



Apple Developer Tools

Xcode 5.0.1 (3335.23)

Build 5A2053



Xamarin.iOS

Version: 7.0.7.2 (Enterprise Edition)

Hash: fb4bc7b

Branch: 

Build date: 2014-17-02 17:43:23-0500



Operating System

Mac OS X 10.8.5
Comment 21 Rolf Bjarne Kvinge [MSFT] 2014-03-11 12:59:25 UTC
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.
Comment 22 Rolf Bjarne Kvinge [MSFT] 2016-02-11 15:33:26 UTC
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).
Comment 23 Sebastien Pouliot 2016-05-24 19:20:57 UTC
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!
Comment 24 tristan 2017-11-27 23:02:21 UTC
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.

https://www.learnthreejs.com/beginners-tutorial/

iPad latest also gives me trouble, anyone confirm?
Comment 25 Rolf Bjarne Kvinge [MSFT] 2017-11-28 09:02:39 UTC
@Tristan, please provide the information requested in comment #22 if you can reproduce this.