当 运行 多个 Http 调用时 Sigabrt -6 xamarin.forms 线程池

Sigabrt -6 xamarin.forms threadpool when running multiple Http calls

我们有一个 Xamarin.Forms 应用程序崩溃 'signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr -------- java_vm_ext.cc:534] JNI DETECTED ERROR IN APPLICATION: use of deleted global reference 0x3ce2'

我们 运行 使用 Task.WhenAll()

使用 HttpClient 并行调用 Web 服务

崩溃是随机的,因此我们无法确定根本原因。

    07-27 19:21:52.443 11988-11988/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'google/walleye/walleye:8.1.0/OPM2.171026.006.G1/4820017:user/release-keys'
Revision: 'MP1'
ABI: 'arm64'
pid: 11908, tid: 11942, name: Threadpool work  >>> com.companyname.appname <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
07-27 19:21:52.446 11988-11988/? A/DEBUG: Abort message: 'java_vm_ext.cc:534] JNI DETECTED ERROR IN APPLICATION: use of deleted global reference 0x3ce2'
    x0   0000000000000000  x1   0000000000002ea6  x2   0000000000000006  x3   0000000000000008
    x4   0000000000000000  x5   0000000000000000  x6   0000000000000000  x7   7f7f7f7f7f7f7f7f
    x8   0000000000000083  x9   0000000010000000  x10  00000070d01fb5f0  x11  0000000000000001
    x12  00000070d01fb0e8  x13  ffffffffffffffff  x14  ff00000000000000  x15  ffffffffffffffff
    x16  0000006366ab0fa8  x17  0000007174b8052c  x18  0000000000000000  x19  0000000000002e84
07-27 19:21:52.447 11988-11988/? A/DEBUG:     x20  0000000000002ea6  x21  0000000000000083  x22  0000000000000002  x23  00000070d01fe588
    x24  00000070d01fb689  x25  00000000000006aa  x26  00000070eb715600  x27  00000000000006a9
    x28  0000000000000043  x29  00000070d01fb630  x30  0000007174b35760
    sp   00000070d01fb5f0  pc   0000007174b35788  pstate 0000000060000000
07-27 19:21:52.449 11988-11988/? A/DEBUG: backtrace:
    #00 pc 000000000001d788  /system/lib64/libc.so (abort+120)
    #01 pc 0000000000475af0  /system/lib64/libart.so (art::Runtime::Abort(char const*)+552)
    #02 pc 000000000056b3ec  /system/lib64/libart.so (android::base::LogMessage::~LogMessage()+1004)
    #03 pc 00000000002fe620  /system/lib64/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+1712)
    #04 pc 00000000002fe878  /system/lib64/libart.so (art::JavaVMExt::JniAbortF(char const*, char const*, ...)+180)
    #05 pc 00000000004a1fc8  /system/lib64/libart.so (art::Thread::DecodeJObject(_jobject*) const+464)
    #06 pc 000000000010d3d8  /system/lib64/libart.so (art::ScopedCheck::CheckInstance(art::ScopedObjectAccess&, art::ScopedCheck::InstanceKind, _jobject*, bool)+96)
    #07 pc 000000000010c03c  /system/lib64/libart.so (art::ScopedCheck::Check(art::ScopedObjectAccess&, bool, char const*, art::JniValueType*)+644)
    #08 pc 000000000010f310  /system/lib64/libart.so (art::CheckJNI::DeleteRef(char const*, _JNIEnv*, _jobject*, art::IndirectRefKind)+632)
07-27 19:21:52.450 11988-11988/? A/DEBUG:     #09 pc 000000000000f384  <anonymous:0000007174a43000>

我们减少了创建的 HttpClient 并行实例的数量。这为我们解决了问题。