Safari 17.6 still crashes on closing the preview of a webpage on macOS Monterey 12.7.6
This issue has been here for a while since Safari 17.5 on macOS Monterey 12.7.5 and still seems to exist at the latest available Safari 17.6 on macOS Monterey 12.7.6. Multiple similar cases have been reported: After updating to Safari Version 17.5 (17… - Apple Community, Safari 17.5 crashing on McBook Air 2021 M… - Apple Community, Safari crashing repeatedly - Apple Community, https://www.reddit.com/r/Safari/comments/1d4kxwx/bug_safari_175_crashes_after_dismissing_peeked/,
To reproduce this issue, open any website, preview a link and tap anywhere else to close the preview window. Safari would crash. Problem seem to happen during the deallocation of the preview window in libobjc. The exception looks like a bug.
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001bc15f564
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: Namespace SIGNAL, Code 5 Trace/BPT trap: 5
Terminating Process: exc handler [3249]
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libobjc.A.dylib 0x1bc15f564 object_getClass + 48
1 Foundation 0x1bd258d9c _NSKeyValueObservationInfoGetObservances + 276
2 Foundation 0x1bd3d7f24 NSKeyValueWillChangeWithPerThreadPendingNotifications + 240
3 AppKit 0x1bef2b964 -[NSView _viewDidChangeAppearance:] + 220
4 AppKit 0x1bef2a50c -[NSView _setSuperview:] + 1520
5 AppKit 0x1bef5189c -[NSView removeFromSuperview] + 148
6 AppKit 0x1befca1ac -[NSView removeFromSuperviewWithoutNeedingDisplay] + 52
7 AppKit 0x1bef5783c -[NSView _finalize] + 956
8 AppKit 0x1bef57348 -[NSView dealloc] + 136
9 AppKit 0x1befd5214 -[NSVisualEffectView dealloc] + 260
10 AppKit 0x1bf247900 -[NSPopoverFrame dealloc] + 88
11 libobjc.A.dylib 0x1bc160d44 AutoreleasePoolPage::releaseUntil(objc_object**) + 196
12 libobjc.A.dylib 0x1bc15d6a4 objc_autoreleasePoolPop + 212
13 AppKit 0x1bef07fcc -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3804
14 Safari 0x103208b24 -[BrowserApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 236
15 AppKit 0x1beef97ec -[NSApplication run] + 596
16 AppKit 0x1beecaf08 NSApplicationMain + 1132
17 Safari 0x1035f9fa0 SafariMain + 524
18 dyld 0x100bdd08c start + 520