Steps to Reproduce:
1. Start a new conversation.
2. Type a note.
3. Wait for a reply.
4. Press Command-Z to Undo.
5. App crashes consistently.
Analysis:
• Cause: Invalid memory access (segmentation fault) at “0x0000000000000014”.
• Key Symbol: “objc_msgSend”, indicating a message was sent to a null or deallocated object.
Conclusion:
• The crash is due to sending a message to a null or invalid object during an undo operation managed by “NSUndoManager”. This likely results from an object being released prematurely or not properly retained.
Potential Fixes:
1. Check Object Lifecycle: Ensure objects involved in the undo operation are properly retained and not prematurely deallocated.
2. Safe Message Passing: Add checks to ensure objects are not null before sending messages.
3. Debugging Tools: Use Xcode’s Instruments, particularly the Zombies instrument, to detect use-after-free issues.
Expected Result:
• No crash during undo operations.
Actual Result:
• App crashes consistently during the undo operation.
Additional Information:
• Browser: None, macOS app latest Version 1.2024.170 (1719338033)
• OS: macOS
Detailed Explanation:
1. “objc_msgSend”: Message sent to a non-existent (null) object.
2. “popAndInvoke” and “undoNestedGroup”: Crash occurred during an undo operation.
3. User Interaction: Likely triggered by selecting a menu item or performing an action.
4. Main Event Loop: Crash occurred during normal application execution.
Critical Stack Trace:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x194e71c34 objc_msgSend + 52
1 Foundation 0x19650bdf0 -[_NSUndoStack popAndInvoke] + 116
2 Foundation 0x19650bba4 -[NSUndoManager undoNestedGroup] + 196