Cocoa app tries to launch lldb on crash?

假如想象 提交于 2019-12-11 17:43:44

问题


A couple of users are reporting that sometimes when my app crashes, the receive a message box like this:

The lldb command requires the command line developer tools. Would you like to install the tools now?

The crash (SIGABRT) looks like a race condition somewhere in my code. But why is it seemingly trying to launch lldb when this happens? I've never seen anything like this, it seems fairly isolated to a couple of users, and I can't reproduce locally - although I do have the developer tools installed.

It's almost like JIT debugging in a .NET, but I've never heard of that in Cocoa and my Google searches on this are fruitless.


Edit:

If I run ps we can see both the Problem Reporter and Install Command Line Developer Tools:

19582   0.0  0.4  2568032  33224   ??  S    10:22AM   0:00.72 /System/Library/CoreServices/Problem Reporter.app/Contents/MacOS/Problem Reporter
19579   0.0  0.2  2531748  13276   ??  S    10:22AM   0:00.16 /System/Library/CoreServices/Install Command Line Developer Tools.app/Contents/MacOS/Install Command Line Developer Tools

There is nothing else suspicious in the list. If I run ps with the -f switch, I can see that the parent process for Install Command Line Developer Tools is launchd.


回答1:


The CrashReporter tool that Apple ships does not try to connect a debugger to crashed programs. There used to be an option to do that in Leopard or thereabouts (not on by default), but that capability was turned off by Mountain Lion (maybe even SnowLeopard). I don't think it is possible to install any Xcode with lldb in it on Leopard, so it seems unlikely it is an old Apple CrashReporter that is trying to hook the debugger up to the app. OTOH, it is possible to replace the Apple's CrashReporter tool with another that could do this, and some third party vendors do do this. Maybe that is what is going on?

If you got the users who see this to send you the output of "ps auwwx" when the dialog box is present, you might be able to spot the culprit.



来源:https://stackoverflow.com/questions/20332171/cocoa-app-tries-to-launch-lldb-on-crash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!