首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >不明系统异常:信号11

不明系统异常:信号11
EN

Stack Overflow用户
提问于 2013-03-21 10:59:57
回答 1查看 2.5K关注 0票数 0

我的一些用户报告说,有时他们会收到上述错误。不幸的是,我无法从日志文件中看出任何东西。可能在代码中某个地方某个对象被过度释放了。我能抓到它并记录下来吗?

通常,我会使用仪器和NSZobieEnabled,但不幸的是,它不会发生在我的机器上。有机会记录这个对象吗?

代码语言:javascript
复制
1   ExceptionHandling                   0x00000001000879e2 -[NSExceptionHandler _handleException:mask:] + 168
    2   ExceptionHandling                   0x00000001000877ba NSExceptionHandlerUncaughtSignalHandler + 35
    3   libsystem_c.dylib                   0x00007fff9836d8ea _sigtramp + 26
    4   ???                                 0x0000000001440013 0x0 + 21233683
    5   CoreFoundation                      0x00007fff985b525f -[NSArray initWithArray:range:copyItems:] + 591
    6   AppKit                              0x00007fff94a193f3 recursivelyEncodeInvalidPersistentState + 1118
    7   AppKit                              0x00007fff94a194a6 recursivelyEncodeInvalidPersistentState + 1297
    8   AppKit                              0x00007fff94a194a6 recursivelyEncodeInvalidPersistentState + 1297
    9   AppKit                              0x00007fff94a194a6 recursivelyEncodeInvalidPersistentState + 1297
    10  AppKit                              0x00007fff94a194a6 recursivelyEncodeInvalidPersistentState + 1297
    11  AppKit                              0x00007fff94a178aa -[NSPersistentUIManager flushAllChangesOptionallyWaitingUntilDone:updatingSnapshots:] + 1037
    12  AppKit                              0x00007fff94a17467 -[NSPersistentUIManager flushPersistentStateAndClose:waitingUntilDone:] + 180
    13  AppKit                              0x00007fff94a7eba5 -[NSApplication terminate:] + 1701
    14  AppKit                              0x00007fff94aa357e -[NSApplication _terminateFromSender:askIfShouldTerminate:saveWindows:] + 280
    15  AppKit                              0x00007fff94aad4a2 __52-[NSApplication(NSAppleEventHandling) _handleAEQuit]_block_invoke_0 + 46
    16  libdispatch.dylib                   0x00007fff8bd9af01 _dispatch_call_block_and_release + 15
    17  libdispatch.dylib                   0x00007fff8bd970b6 _dispatch_client_callout + 8
    18  libdispatch.dylib                   0x00007fff8bd9c0c8 _dispatch_main_queue_callback_4CF + 275
    19  CoreFoundation                      0x00007fff985a20fe __CFRunLoopRun + 1614
    20  CoreFoundation                      0x00007fff985a16b2 CFRunLoopRunSpecific + 290
    21  HIToolbox                           0x00007fff93fbf0a4 RunCurrentEventLoopInMode + 209
    22  HIToolbox                           0x00007fff93fbed84 ReceiveNextEventCommon + 166
    23  HIToolbox                           0x00007fff93fbecd3 BlockUntilNextEventMatchingListInMode + 62
    24  AppKit                              0x00007fff94858613 _DPSNextEvent + 685
    25  AppKit                              0x00007fff94857ed2 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
    26  AppKit                              0x00007fff9484f283 -[NSApplication run] + 517
    27  AppKit                              0x00007fff947f3cb6 NSApplicationMain + 869
EN

回答 1

Stack Overflow用户

发布于 2013-03-21 11:05:48

信号11意味着你在某个地方有分割错误..。因此,它可能与目标C对象以外的其他东西相关,就像在这种情况下,您可能会有异常(即使可能发生分段错误)。

所以NSZombieEnabled在这里帮不上忙。

尝试学习有关信号提交的知识。您可以为信号11 (SIGSEGV)定义一个处理程序,这样您就可以记录一些事情了。

(非常)基本上:

代码语言:javascript
复制
#include <signal.h>
#include <stdlib.h>

static void __handler( int sig );
static void __handler( int sig )
{
    /* Debug... */

    exit( EXIT_FAILURE );
}

int main( void )
{
    signal( SIGSEGV, __handler );

    return 0;
}
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15545611

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档