Xamarin-android: Xamarin Android Crash at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Created on 16 Dec 2019  路  4Comments  路  Source: xamarin/xamarin-android

Steps to Reproduce

  1. No stable steps for reproduce. Just in some cases during start Android app. Mostly on Amazon and Samsung devices with Android ~5.1.1.

Expected Behavior

Actual Behavior

System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: index
at System.Array.InternalArray__get_Item[T] (System.Int32 index) [0x00009] in <620c1bc5d654407197bbe331f96aba96>:0
at (wrapper managed-to-managed) System.Threading.Tasks.Task[].System.Collections.Generic.IList`1.get_Item(int)
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () <0x9d27c968 + 0x0003b> in <620c1bc5d654407197bbe331f96aba96>:0

Version Information

Mono Runtime need-info

Most helpful comment

@jonathanpeppers I'm hoping we can reopen this issue. This is blocking us from shipping to the Amazon store because we are getting a persistent crash on the 5th generation Amazon Kindle Fire device running Android 5.1. It crashes soon after startup or, at the latest, when the user starts doing anything meaningful. We have tried running a previous version of our app (built with an older version of Xamarin Android) on this device and we do not see the crash. The actual exception that causes the crash varies. The stack traces are very shallow and but they _always_ involve a call to System.Threading._ThreadPoolWaitCallback:PerformWaitCallback

Amazon Kindle Fire 5th Generation
Android 5.1
Xamarin.Android 11.2.2.1

Here is the debug output:

=================================================================
    Native Crash Reporting
=================================================================
Got a SEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

No native Android stacktrace (see debuggerd output).

=================================================================
    Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x9e54cf68):0x9e54cf58  80 96 
98 00 00 00 00 00 f0 d8 ff ff ff ff ff ff  ................
0x9e54cf68  60 32 f0 b8 00 00 00 00 00 00 00 00 00 00 00 00  `2..............
0x9e54cf78  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0x9e54cf88  00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00  ................

=================================================================
    Managed Stacktrace:
=================================================================
      at <unknown> <0xffffffff>
      at System.Threading._ThreadPoolWaitCallback:PerformWaitCallback <0x00033>
      at <Module>:runtime_invoke_bool <0x000bb>
=================================================================04-13 09:47:37.346 F/libc    (20033): Fatal signal 11 (SIGSEGV), code 2, fault addr 0x9e54cf68 in tid 20108 (Thread Pool Wor)

Attached is a log file with all the statements emitted at or around the point of the native crash.

logcat_output.txt

All 4 comments

@Panasjuk can you reproduce this yourself? Or any cases where you have a more detailed stack trace?

adb logcat output would help us know what is happening here.

We are unable to investigate this issue further without the requested information.

Hopefully you found a resolution meanwhile! If not, please try the latest version of the product and if the problem still occurs, reply with the requested information and reopen this issue.

I am getting this crash on an Amazon Kindle running Android 5.1.1 building with Xamarin.Android 11.1.0.17. It crashes with a native stack trace but when I do get a limited managed stack trace, it always seems to be related to a call to ThreadPoolWaitCallback:PerformWaitCallback. I will have to try and create a repro project for this. Starter apps for Xamarin.Android and Xamarin.Forms do not manifest this crash. It may show up when making extensive use of TPL and/or System.Reactive but until I can put together a repro project I can't say for sure. I am posting this just to call out that this is still an issue.

@jonathanpeppers I'm hoping we can reopen this issue. This is blocking us from shipping to the Amazon store because we are getting a persistent crash on the 5th generation Amazon Kindle Fire device running Android 5.1. It crashes soon after startup or, at the latest, when the user starts doing anything meaningful. We have tried running a previous version of our app (built with an older version of Xamarin Android) on this device and we do not see the crash. The actual exception that causes the crash varies. The stack traces are very shallow and but they _always_ involve a call to System.Threading._ThreadPoolWaitCallback:PerformWaitCallback

Amazon Kindle Fire 5th Generation
Android 5.1
Xamarin.Android 11.2.2.1

Here is the debug output:

=================================================================
    Native Crash Reporting
=================================================================
Got a SEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

No native Android stacktrace (see debuggerd output).

=================================================================
    Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x9e54cf68):0x9e54cf58  80 96 
98 00 00 00 00 00 f0 d8 ff ff ff ff ff ff  ................
0x9e54cf68  60 32 f0 b8 00 00 00 00 00 00 00 00 00 00 00 00  `2..............
0x9e54cf78  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
0x9e54cf88  00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00  ................

=================================================================
    Managed Stacktrace:
=================================================================
      at <unknown> <0xffffffff>
      at System.Threading._ThreadPoolWaitCallback:PerformWaitCallback <0x00033>
      at <Module>:runtime_invoke_bool <0x000bb>
=================================================================04-13 09:47:37.346 F/libc    (20033): Fatal signal 11 (SIGSEGV), code 2, fault addr 0x9e54cf68 in tid 20108 (Thread Pool Wor)

Attached is a log file with all the statements emitted at or around the point of the native crash.

logcat_output.txt

Was this page helpful?
0 / 5 - 0 ratings