简体   繁体   中英

Cocoa document based app crashes when window save popup menu disappeared after alert panel appears

OS X 10.10.3. What can cause the following crash in Cocoa document based document app? It occurs only when a window save popup panel disappeared: 保存弹出面板

if a "file already exists" alert sheet appears: 更换警报表

UPDATE: sometimes the app crashes also when simply close the popup but with guarantee when alert sheet appears.

The crash stack:

    Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000061890cbbec0

VM Regions Near 0x61890cbbec0:
    MALLOC_LARGE           000000011da03000-000000011eca3000 [ 18.6M] rw-/rwx SM=ZER  
--> 
    __TEXT                 0000123400000000-00001234004a5000 [ 4756K] r-x/rwx SM=COW  /System/Library/Extensions/AppleIntelHD4000GraphicsGLDriver.bundle/Contents/MacOS/AppleIntelHD4000GraphicsGLDriver

Application Specific Information:
objc_msgSend() selector name: isKindOfClass:


Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib                 0x00007fff899120dd objc_msgSend + 29
1   com.apple.ViewBridge            0x00007fff8cadbe74 -[NSRemoteViewBase viewWillMoveToWindow:] + 367
2   com.apple.AppKit                0x00007fff94ca90de -[NSView _setWindow:] + 257
3   com.apple.CoreFoundation        0x00007fff8fafa705 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 133
4   com.apple.CoreFoundation        0x00007fff8faf9e09 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 313
5   com.apple.AppKit                0x00007fff9542d474 __21-[NSView _setWindow:]_block_invoke735 + 169
6   com.apple.AppKit                0x00007fff94ca9c54 -[NSView _setWindow:] + 3191
7   com.apple.AppKit                0x00007fff94cb73d7 -[NSVisualEffectView _setWindow:] + 214
8   com.apple.AppKit                0x00007fff94f12747 -[NSPopoverFrame _setWindow:] + 111
9   com.apple.AppKit                0x00007fff94ef961f -[NSWindow dealloc] + 1201
10  com.apple.AppKit                0x00007fff94f8c9f5 -[_NSPopoverWindow dealloc] + 74
11  com.apple.AppKit                0x00007fff94ca68cc -[NSWindow release] + 193
12  com.apple.CoreFoundation        0x00007fff8faf78ec __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
13  com.apple.CoreFoundation        0x00007fff8fae99f5 __CFRunLoopDoBlocks + 341
14  com.apple.CoreFoundation        0x00007fff8fae91ae __CFRunLoopRun + 910
15  com.apple.CoreFoundation        0x00007fff8fae8bd8 CFRunLoopRunSpecific + 296
16  com.apple.HIToolbox             0x00007fff92b7256f RunCurrentEventLoopInMode + 235
17  com.apple.HIToolbox             0x00007fff92b722ea ReceiveNextEventCommon + 431
18  com.apple.HIToolbox             0x00007fff92b7212b _BlockUntilNextEventMatchingListInModeWithFilter + 71
19  com.apple.AppKit                0x00007fff94d079bb _DPSNextEvent + 978
20  com.apple.AppKit                0x00007fff94d06f68 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 346
21  com.apple.AppKit                0x00007fff94cfcbf3 -[NSApplication run] + 594
22  com.apple.AppKit                0x00007fff94c79354 NSApplicationMain + 1832

I changed Base SDK from 10.9 to 10.10 in my app and it solved the problem. As I see crash occurs only on 10.10.3 and higher system version. If you want to crash TextEdit just change Base SDK to 10.9 or open TextEdit 1.9 or earlier version. Also someone already wrote radar http://openradar.appspot.com/20991953

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM