iOS崩溃:system_error: mutex lock f

2023-04-03  本文已影响0人  OrrHsiao

用户手动结束App时,C++代码未处理崩溃或处理崩溃的代码与系统捕获崩溃的代码冲突
苹果开发者论坛问题链接

Right. This highlights an interesting quirk with the remove-from-the-multitasking-UI gesture. If the app is suspended in the background, it simply removes it from memory. If, however, the app is running, it attempts to cleanly terminate it. For example,

<pre style="margin: 0.8em 0px 0px; padding: 0px; font-size: 16px; font-weight: 400; font-style: normal; line-height: 1.33; tab-size: 4; word-break: break-word; color: rgb(51, 51, 51); font-variant-ligatures: normal; font-variant-caps: normal; letter-spacing: -0.078px; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">applicationWillTerminate(_:)</pre>

gets called in that case. It seems that your app has a bug that’s triggered by termination attempt.

Looking at your crash report I see two relevant things:

Normally the second point would result in a Last Exception Background section in the crash report, but that only happens for Objective-C exceptions and the first point suggests that this is actually a C++ exception. That’s further confirmed by this:

libc++abi.dylib: terminating with uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument

You need to investigate what

CConnClient

is doing on exit.

In most cases you can fix problems like this by simply removing the finaliser. After all, the entire process is going away Real Soon Now, so all that code to clean up is probably pointless.

Share and Enjoy

上一篇 下一篇

猜你喜欢

热点阅读