xcode 所有程序中的 SIGABRT 和 SIGTERM THREAD
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9319321/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SIGABRT AND SIGTERM THREAD in all the programs
提问by George
I use Xcode 4.2
and I get 90% of the time this message:
我使用Xcode 4.2
并在 90% 的情况下收到此消息:
@autoreleasepool
{
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
Thread 1: Program received signal "SIGABRT"
线程 1:程序接收信号“SIGABRT”
When it works and quit iOS Simulator
I get :
当它工作并退出时,iOS Simulator
我得到:
Thread!: program received signal SIGTERM
线程!:程序收到信号SIGTERM
NOW ALL the programs (even simple tutorials with single sound button) that worked perfect before when I quit Simulator
I get SIGTERM
and when I try to run again I get SIGABRT
.
I am getting paranoidddddddddd.
现在所有的程序(甚至是单声按钮简单的教程),当我退出工作之前完美的Simulator
,我得到SIGTERM
,当我尝试运行我再次得到SIGABRT
。我越来越偏执了。
Error: unknown error code. This generally means that another instance of this process was already running or is hung in the debugger.sharedlibrary apply-load-rules all Current language: auto; currently objective-c (gdb)
错误:未知的错误代码。这通常意味着该进程的另一个实例已经在运行或挂在 debugger.sharedlibrary apply-load-rules all 当前语言:auto; 当前目标-c (gdb)
What am I supposed to do?
我应该做些什么?
回答by jhilgert00
Some things for you to try that have helped me in the past (in this order):
您可以尝试一些过去对我有帮助的事情(按此顺序):
- Product > Clean
- Uninstall/delete your apps from your devices manually.
- In iOS Simulator, iOS Simulator > "Reset Content and Settings".
- Delete everything in your "Derived Data" for the projects causing the problems. (Screenshot) In Organizer > Projects.
- Quit xCode.
- Restart your machine.
- 产品 > 清洁
- 从您的设备手动卸载/删除您的应用程序。
- 在 iOS 模拟器中,iOS 模拟器 > “重置内容和设置”。
- 删除导致问题的项目的“派生数据”中的所有内容。(屏幕截图)在管理器 > 项目中。
- 退出 xCode。
- 重新启动您的机器。
I've noticed that Derived Data causes the most problems when you make multiple projects with the same name, wether it's on purpose, or by accident.
我注意到,当您制作多个同名项目时,派生数据会导致最多的问题,无论是有意还是无意。
Edit: More details..
编辑:更多细节..
The only time I've ever gotten SIGTERM is when you run a test on a "device" and then quit the app from the device before you hit stop in xCode, then try and launch it again on the device. If it was more of a SIGABRT problem, I always check my IBOutlets. SIGABRT happens every time you delete the code for an outlet, but don't delete the connection in IB. [xcode 4.2.1]
我唯一一次获得 SIGTERM 是当您在“设备”上运行测试然后在 xCode 中点击停止之前从设备退出应用程序,然后尝试在设备上再次启动它。如果这更像是一个 SIGABRT 问题,我总是检查我的 IBOutlets。每次删除插座的代码时都会发生 SIGABRT,但不要删除 IB 中的连接。[xcode 4.2.1]
回答by AtkinsonCM
The previous app is still 'stuck' in the simulator. Try completely quitting the simulator, cleaning your project, then trying to build again.
之前的应用程序仍然“卡在”模拟器中。尝试完全退出模拟器,清理您的项目,然后再次尝试构建。
Edit: A complete restart of your mac sounds like the next step. In my experience this error has always had to do with an issue with the simulator, rather than the code itself.
编辑:完全重启您的 mac 听起来像是下一步。根据我的经验,这个错误总是与模拟器的问题有关,而不是代码本身。
回答by rob mayoff
SIGABRT
means that your program is throwing an exception. If you don't explicitly set a breakpoint to trigger when the exception is thrown, then Xcode shows you the SIGABRT in main
, which is useless for debugging.
SIGABRT
意味着您的程序正在抛出异常。如果您没有明确设置在抛出异常时触发的断点,那么 Xcode 会向您显示 SIGABRT 中的 SIGABRT main
,这对调试无用。
You need to add an exception breakpointso you can see where the exception is being thrown.
您需要添加一个异常断点,以便您可以查看抛出异常的位置。