我很难弄清楚我在哨兵和 crashlytics 上看到的这个问题。我不确定如何复制错误,堆栈跟踪对我来说有点神秘。有谁有想法吗?
OS Version: iOS 11.4.1 (15G77)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: BUS_NOOP at 0x0000000102cb2c30
Crashed Thread: 8
Application Specific Information:
Final state > onDisconnectedImpl >> > pMethodNf > src/ActiveDispatcher.cpp >
Attempted to dereference garbage pointer 0x102cb2c30.
Thread 8 Crashed:
0 <unknown> 0x102cb2c30 _ZTVNSt3__120__shared_ptr_emplaceIN5boost4asio20basic_waitable_timerINS_6chrono12steady_clockENS2_11wait_traitsIS5_EENS2_22waitable_timer_serviceIS5_S7_EEEENS_9allocatorISA_EEEE
1 TwilioChatClient 0x102a81588 rtd::TNTwilsockClient::onDisconnectedImpl(std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<rtd::TNTwilsockClient> > const&)
2 TwilioChatClient 0x102a9397c TwilioPoco::ActiveRunnable<void, std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::shared_ptr<rtd::TNTwilsockClient> >, rtd::TNTwilsockClient>::run()
3 TwilioChatClient 0x1027fb47c TwilioPoco::ActiveDispatcher::run()
4 TwilioChatClient 0x1027f802c TwilioPoco::ThreadImpl::runnableEntry(void*)
5 libsystem_pthread.dylib 0x3037d8220 <redacted>
6 libsystem_pthread.dylib 0x3037d8110 _pthread_start
Run Code Online (Sandbox Code Playgroud)
我的第一次回答尝试不够详细,无法提供帮助 - 我很抱歉。让我们再试一次。
根据 App Specific infoAttempted to dereference garbage pointer以及您进入分配器的几帧这一事实,我相信您遇到了堆损坏。这些类型的崩溃可能很难调试。
堆损坏是内存损坏的一种特殊情况,很难追踪。主要原因是堆栈跟踪通常根本无法捕获损坏的来源。通常,崩溃只是症状。
您甚至无法确定 TwilioChatClient 库是否负责。对于一个不相关的系统来说,覆盖 Twilio 使用的一些内存是完全可能的,也是常见的。更糟糕的是,这可能在现在无效的内存被使用之前发生得更早。
在这些情况下,我通常建议:
Zombies在仪器中试用对堆损坏进行推理是很困难的,通常甚至是不可能的。复制错误也是不可能的,因为内存损坏崩溃通常是不确定的。
因此,只需尝试查找并解决尽可能多的问题。其中一个完全有可能对各种崩溃负责,其中之一可能就是这个。