We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1317

Summary: Crashed in NSPersistentUIManager
Product: SDL Reporter: Sam Lantinga <slouken>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED WORKSFORME QA Contact: Sam Lantinga <slouken>
Severity: critical    
Priority: P2    
Version: HG 2.0   
Hardware: x86   
OS: Mac OS X 10.7   

Description Sam Lantinga 2011-10-22 00:50:50 UTC
I was sitting at the main menu in Maelstrom compiled with SDL 1.3, and it crashed:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x00000000770496f8
[Switching to process 429 thread 0xc50b]
0x00007fff8b3d13d4 in objc_msgSend_vtable15 ()
(gdb) bt
#0  0x00007fff8b3d13d4 in objc_msgSend_vtable15 ()
#1  0x00007fff911b9c0f in -[NSData(NSData) subdataWithRange:] ()
#2  0x00007fff89a9c87a in -[NSPersistentUIWindowInfo copyAllPublicProperties] ()
#3  0x00007fff8a24a748 in -[NSPersistentUIManager writePublicPlistWithOpenWindowIDs:optionallyWaitingUntilDone:] ()
#4  0x00007fff89a9c4f1 in __-[NSPersistentUIManager flushAllChangesOptionallyWaitingUntilDone:updatingSnapshots:]_block_invoke_3 ()
#5  0x00007fff8883c8ba in _dispatch_call_block_and_release ()
#6  0x00007fff8883e10a in _dispatch_queue_drain ()
#7  0x00007fff8883df66 in _dispatch_queue_invoke ()
#8  0x00007fff8883d760 in _dispatch_worker_thread2 ()
#9  0x00007fff88a4b3da in _pthread_wqthread ()
#10 0x00007fff88a4cb85 in start_wqthread ()

A similar crash was reported in Eclipse in Mac OS X 10.7 as well:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=341666
----------
Thread 0 Crashed:
0   libobjc.A.dylib                   0x00007fff9227eead objc_msgSend_vtable5 +
21
1   com.apple.AppKit                  0x00007fff8f4ae598 -[NSApplication
encodeRestorableStateWithCoder:] + 96
2   com.apple.AppKit                  0x00007fff8f9e8b49 -[NSPersistentUIRecord
generateArchive:] + 177
3   com.apple.AppKit                  0x00007fff8f9e827b
recursivelyEncodeInvalidPersistentState + 406
4   com.apple.AppKit                  0x00007fff8f9e7a3b
-[NSPersistentUIManager flushAllChangesOptionallyWaitingUntilDone:] + 1515
5   com.apple.AppKit                  0x00007fff8f865dde __-[NSWindow
_close]_block_invoke_1 + 97
6   com.apple.AppKit                  0x00007fff8f3f7ac6 -[NSWindow _close] +
363
7   libswt-pi-cocoa-3655.jnilib       0x0000000108e110fc
Java_org_eclipse_swt_internal_cocoa_OS_objc_1msgSend__JJ + 46

The app's delegate has been deallocated while it is still attached to the
application, so Appkit crashes while trying to message it.  Whoever is
responsible for setting the NSApp's delegate in the Eclipse Cocoa port should
clear it when that delegate is deallocated.
----------
Comment 1 Sam Lantinga 2012-01-07 20:02:14 UTC
Ryan, any ideas on this?
Comment 2 Ryan C. Gordon 2018-08-04 23:45:25 UTC
This bug is ancient and no one could ever reproduce it, so I'm closing it. Please reopen it if you're still experiencing this problem with SDL 2.0.8 or later!

--ryan.