Bug 8415 - System.Threading.ThreadInterruptedException
Summary: System.Threading.ThreadInterruptedException
Status: RESOLVED INVALID
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 6.0.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Rolf Bjarne Kvinge [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2012-11-14 23:05 UTC by Pierce Boggan [MSFT]
Modified: 2012-12-12 17:55 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Application output for the crash (2.82 KB, text/plain)
2012-11-29 10:35 UTC, kye
Details
another report (41.92 KB, text/plain)
2012-12-06 16:29 UTC, kye
Details
still have uncaught ThreadInterruptedException, which kills the program (79.83 KB, text/plain)
2012-12-12 16:49 UTC, kye
Details
ErrorReport3.zip has latest testcases (1.35 MB, application/x-zip-compressed)
2012-12-12 17:55 UTC, kye
Details


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 INVALID

Description Pierce Boggan [MSFT] 2012-11-14 23:05:48 UTC
Info:
MT 6.0.6
MD 3.0.4.7
Mono 2.10.9

New issue in 6.0.6 (DNE before).

Initial StackTrace:
2012-11-14 14:26:35.800 ExamplesClient[49463:23813] Unhandled exception:
System.Threading.ThreadInterruptedException: Thread interrupted

at recursionsw.voyager.lib.util.Console.log (Int64 code, System.Object
anObjectValue, System.String topic) [0x00000] in <filename unknown>:0 

at recursionsw.voyager.lib.util.Console.log (System.Object
anObjectValue, System.String topic) [0x00000] in <filename unknown>:0 

at recursionsw.voyager.messageprotocol.vrmp.dgc.DGC+Reaper.Run ()
[0x00000] in <filename unknown>:0 

at System.Threading.Thread.StartInternal () [0x0001d] in
/Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading/Threa
d.cs:697 

[ERROR] FATAL UNHANDLED EXCEPTION:
System.Threading.ThreadInterruptedException: Thread interrupted

at recursionsw.voyager.lib.util.Console.log (Int64 code, System.Object
anObjectValue, System.String topic) [0x00000] in <filename unknown>:0 

at recursionsw.voyager.lib.util.Console.log (System.Object
anObjectValue, System.String topic) [0x00000] in <filename unknown>:0 

at recursionsw.voyager.messageprotocol.vrmp.dgc.DGC+Reaper.Run ()
[0x00000] in <filename unknown>:0 

at System.Threading.Thread.StartInternal () [0x0001d] in
/Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading/Threa
d.cs:697
Comment 3 Rolf Bjarne Kvinge [MSFT] 2012-11-15 05:31:04 UTC
I can't reproduce this, I tried switching between the Basics1 and Basics2 samples and on device or in the simulator and they seemed to work just fine. Is there a particular set of examples that has to be run for this to happen?
Comment 4 kye 2012-11-15 09:30:21 UTC
once server8000 and server9000 are running, you can run Basics1, Basics2, Basics2Http, Message1, Message2, Message3, ... Message7, Naming1, Naming2, Space1, Space2, Space3. The crash should be relatively easy to reproduce in the simulator. Especially if you try to launch the next example before the previous example finish running completely.
Comment 5 Rolf Bjarne Kvinge [MSFT] 2012-11-15 11:05:22 UTC
OK, after trying for a while it happened once.
Comment 6 Rolf Bjarne Kvinge [MSFT] 2012-11-20 08:52:25 UTC
Unfortunately I have not been able to reproduce this more than that one time, which makes it very hard to track down.

Can you set MONO_TRACE=E:all environment option (this shows where and how: http://screencast.com/t/JYJGsG0zo), rerun until it fails again and attach the entire application output? This will log all the exceptions when they're thrown, so it might provide more clues as to what's going on.
Comment 7 kye 2012-11-29 10:35:04 UTC
Created attachment 3026 [details]
Application output for the crash
Comment 8 kye 2012-12-03 14:03:33 UTC
I am able to set the MONO_TRACE=E:all and capture the application output. And I put the attachment out on Nov 29. Let me know if you need anything else. Thanks
Comment 9 Rolf Bjarne Kvinge [MSFT] 2012-12-04 08:02:18 UTC
Sorry about the late response: this output does not contain the information I was looking for, it looks like the MONO_TRACE variable hasn't been set correctly.

There should be a line like this in the output:

[0xac010a28:] EXCEPTION handling: System.Threading.ThreadInterruptedException: Thread interrupted
Comment 10 Rolf Bjarne Kvinge [MSFT] 2012-12-04 08:07:34 UTC
Here is sample output from running just Basics1: https://gist.github.com/b6fc44ea210bc3fd8943
Comment 11 kye 2012-12-06 16:26:22 UTC
Sorry I was tied up with something else. Anyway I have an output
Comment 12 kye 2012-12-06 16:29:48 UTC
Created attachment 3068 [details]
another report
Comment 13 kye 2012-12-06 16:39:07 UTC
By the way,  this time I set MONO_TRACE to E:all on both ExampleCommon and ExampleClient. 

Using ExampleClient as an example. I did
1. Right click ExampleClient -> options 
2. In option window under Run -> General 
3. put MONO_TRACE as variable and E:all as Value.
Comment 14 Rolf Bjarne Kvinge [MSFT] 2012-12-07 05:45:05 UTC
This is what I was looking for, I will try to find out what's going on now.
Comment 15 Rolf Bjarne Kvinge [MSFT] 2012-12-11 18:13:59 UTC
There is a race condition in your code.

Look in recursionsw.voyager.messageprotocol.vrmp.dgc.DGC/Updater (or Reaper, which has the same problem).

The problem is that Thread.Interrupt is called when you're not inside the try/catch handler in Updater:Run. Since you set stopSignalled to true just before calling Thread.Interrupt (in Updater:stop), you may actually completely finish executing the Run method (since the loop in Run loops until stopSignalled is set to true) before Thread.Interrupt is called - thus interrupting the thread outside of a try/catch handler.
Comment 16 kye 2012-12-12 16:44:51 UTC
Thanks for the info. We think we fixed that uncaught ThreadInterruptedException you mentioned + some other places. But seems there are still some uncaught ThreadInterruptedException. So the program is still crashing. I have new attachment errorReprot3. Thanks.
Comment 17 kye 2012-12-12 16:49:17 UTC
Created attachment 3090 [details]
still have uncaught ThreadInterruptedException, which kills the program

still have uncaught ThreadInterruptedException, which kills the program
Comment 18 Rolf Bjarne Kvinge [MSFT] 2012-12-12 17:34:20 UTC
I will need an updated test case for these issues.
Comment 19 kye 2012-12-12 17:55:17 UTC
Created attachment 3091 [details]
ErrorReport3.zip has latest testcases