Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IINA failed with EXC_BAD_ACCESS during quit #3823

Open
1 task
low-batt opened this issue Jun 13, 2022 · 2 comments
Open
1 task

IINA failed with EXC_BAD_ACCESS during quit #3823

low-batt opened this issue Jun 13, 2022 · 2 comments
Assignees

Comments

@low-batt
Copy link
Contributor

System and IINA version:

  • macOS 12.4
  • IINA 1.3.0 develop branch

Expected behavior:
INA terminates cleanly.

Actual behavior:
While running under Xcode 13.4 on a M1 Mac with additional sanity checks enabled IINA failed in MPVController.shouldRenderUpdateFrame with EXC_BAD_ACCESS during application termination. Xcode shows the failure occuring here:

func shouldRenderUpdateFrame() -> Bool {
  guard let mpvRenderContext = mpvRenderContext else { return false }
  let flags: UInt64 = mpv_render_context_update(mpvRenderContext) <= Thread 24: EXC_BAD_ACCESS (code=1, address=0x5555555555555565)
  return flags & UInt64(MPV_RENDER_UPDATE_FRAME.rawValue) > 0
}

Looking at thread 24's stack shows the thread was executing within mpv:

  thread #24, queue = 'com.colliderli.iina.mpvgl'
    frame #0: 0x00000001023f8600 libsystem_pthread.dylib`pthread_mutex_lock + 20
    frame #1: 0x00000001039e99d8 libmpv.1.dylib`mp_dispatch_queue_process + 48
    frame #2: 0x0000000103a6b428 libmpv.1.dylib`mpv_render_context_update + 28
    frame #3: 0x00000001010cf5f0 IINA`MPVController.shouldRenderUpdateFrame(self=0x0000000109439320) at MPVController.swift:413:25
    frame #4: 0x0000000100e4f510 IINA`ViewLayer.canDraw(ctx=0x10aa8c100, pf=0x000000011ee0f7c0, t=151958.21627058336, ts=nil, self=0x0000000108135460) at ViewLayer.swift:91:33

The main thread had just commanded mpv to quit:

* thread #1, queue = 'com.apple.main-thread'
  * frame #0: 0x0000000189d0e270 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001023f5e18 libsystem_pthread.dylib`_pthread_cond_wait + 1236
    frame #2: 0x00000001039e9c90 libmpv.1.dylib`mp_dispatch_lock + 216
    frame #3: 0x0000000103a00c88 libmpv.1.dylib`run_client_command + 144
    frame #4: 0x00000001010d1048 IINA`MPVController.command(command=(rawValue = "quit"), args=0 values, checkError=true, returnValueCallback=nil, self=0x0000000109439320) at MPVController.swift:445:23
    frame #5: 0x00000001010cfa44 IINA`MPVController.mpvQuit(self=0x0000000109439320) at MPVController.swift:419:5
    frame #6: 0x0000000100fe3074 IINA`PlayerCore.terminateMPV(sendQuit=true, self=0x0000000109716840) at PlayerCore.swift:337:11

There are known problems with coordinating termination. See issue #3590. Must confirm this issue is fixed as a part of correcting IINA to properly coordinate shutdown.

Xcode Console with Stack Traces:
IINA(31458,0x10250c580) malloc: enabling scribbling to detect mods to free blocks
23:42:01.218 [iina][d] IINA 1.3.0 Build 131
23:42:01.220 [iina][d] Copyright © 2017-2022
23:42:01.220 [iina][d] Collider LI, et al.
23:42:01.220 [iina][d] Released under GPLv3.
23:42:01.220 [iina][d] FFmpeg 4.4.2
23:42:01.220 [iina][d]   libavcodec 58.134.100
23:42:01.220 [iina][d]   libavformat 58.76.100
23:42:01.220 [iina][d]   libavutil 56.70.100
23:42:01.220 [iina][d]   libswscale 5.9.100
23:42:01.220 [iina][d] App will launch
23:42:01.221 [iina][d] Got arguments ["-NSDocumentRevisionsDebugMode", "YES"]
23:42:01.221 [iina][d] IINA arguments: []
23:42:01.221 [iina][d] Filenames from arguments: []
IINA 1.3.0 Build 131
This binary is not intended for being used as a command line tool. Please use the bundled iina-cli.
Please ignore this message if you are running in a debug environment.
23:42:01.248 [iina][d] App launched
2022-06-12 23:42:01.255039-0400 IINA[31458:1963255] [logging-persist] cannot open file at line 45530 of [9ff244ce07]
2022-06-12 23:42:01.255095-0400 IINA[31458:1963255] [logging-persist] os_unix.c:45530: (0) open(/var/db/DetachedSignatures) - Undefined error: 0
23:42:01.285 [player0][d] Set path to /Users/low-batt/Library/Developer/Xcode/DerivedData/iina-echacgeisxgbwucwumppkhklmnkd/Build/Products/Debug/IINA.app/Contents/MacOS:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin
2022-06-12 23:42:01.303276-0400 IINA[31458:1962689] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x11542b870> F8BB1C28-BAE8-11D6-9C31-00039315CD46
23:42:01.312 [iina][d] Using mpv 0.34.1
23:42:01.314 [iina][d] Loading key bindings
23:42:01.317 [iina][d] Set key bindings
23:42:01.327 [player0][d] Track list changed
23:42:01.399 [iina][d] Setting up MediaPlayer integration
2022-06-12 23:42:01.454789-0400 IINA[31458:1962689] Metal API Validation Enabled
23:42:05.126 [player0][d] Open URL: file:///Users/low-batt/Downloads/sw/org/youtube-dl/Cocoa%20Programming%20L9%20-%20NSPopUpButton%20%5BRKYSY2Ey9Os%5D.mp4
23:42:05.126 [player0][d] Opening /Users/low-batt/Downloads/sw/org/youtube-dl/Cocoa Programming L9 - NSPopUpButton [RKYSY2Ey9Os].mp4 in main window
2022-06-12 23:42:05.148813-0400 IINA[31458:1962689] [Nib Loading] Could not connect action, target class IINA.MainWindowController does not respond to -additionalInfoTitle:
23:42:05.264 [iina][d] Created OpenGL pixel format with [__C._CGLPixelFormatAttribute(rawValue: 5), __C._CGLPixelFormatAttribute(rawValue: 96), __C._CGLPixelFormatAttribute(rawValue: 99), __C._CGLPixelFormatAttribute(rawValue: 12800), __C._CGLPixelFormatAttribute(rawValue: 73), __C._CGLPixelFormatAttribute(rawValue: 101), __C._CGLPixelFormatAttribute(rawValue: 0)]
23:42:05.276 [iina][d] Falling back to nominal display refresh rate: 120.0 from 0.0
23:42:05.278 [iina][d] window!.screen: Built-in Retina Display visible frame (0.0, 22.0, 1728.0, 1057.0)
23:42:05.278 [iina][d] NSScreen.main: Built-in Retina Display visible frame (0.0, 22.0, 1728.0, 1057.0)
23:42:05.278 [iina][d] NSScreen.screens[0]: Built-in Retina Display visible frame (0.0, 22.0, 1728.0, 1057.0)
23:42:05.279 [iina][d] MainWindowLastPosition (288.0, 191.0) matched: Built-in Retina Display visible frame (0.0, 22.0, 1728.0, 1057.0)
23:42:05.288 [player0][d] File started
23:42:05.289 [player0][d] Track list changed
23:42:05.289 [player0][d] Started auto load
23:42:05.289 [fmatcher][d] **Start matching
23:42:05.299 [player0][d] Track list changed
23:42:05.322 [fmatcher][d] Getting all media files...
23:42:05.353 [fmatcher][d] Got all media files, video=32, audio=0
23:42:05.355 [fmatcher][d] Getting all sub files...
23:42:05.356 [fmatcher][d] Searching subtitles from 2 directories...
23:42:05.359 [fmatcher][d] Got 9 subtitles
23:42:05.360 [fmatcher][d] Grouping video files...
23:42:05.360 [fgroup][d] Start grouping 32 files
23:42:05.362 [fmatcher][d] Finished with 1 groups
23:42:05.362 [fmatcher][d] Grouping sub files...
23:42:05.362 [fgroup][d] Start grouping 9 files
23:42:05.370 [fmatcher][d] Finished with 1 groups
23:42:05.371 [fmatcher][d] Matching video and sub series...
23:42:05.371 [fmatcher][d] Calculated editing distance
23:42:05.371 [fmatcher][d] Finished matching.
23:42:05.371 [fmatcher][d] Matching subs with matched series, prefixes=0...
23:42:05.371 [fmatcher][d] Matching for 5.1 Audio Speaker Test [5.1 Audio Speaker Test]
23:42:05.371 [fmatcher][d] No matched sub for this file
23:42:05.371 [fmatcher][d] Matching for 5.1 Channel Audio Test [_TX--Fku9NQ]
23:42:05.371 [fmatcher][d] No matched sub for this file
23:42:05.372 [fmatcher][d] Matching for 6 Steps For Constraints In Xcode Interface Builder [0bfUB1XrWvM]
23:42:05.372 [fmatcher][d] No matched sub for this file
23:42:05.372 [fmatcher][d] Matching for AppleScript-Cocoa - Connecting Interfaces-ASOC-001HD
23:42:05.372 [fmatcher][d] No matched sub for this file
23:42:05.372 [fmatcher][d] Matching for bbb_sunflower_2160p_30fps_normal [bbb_sunflower_2160p_30fps_normal]
23:42:05.372 [fmatcher][d] No matched sub for this file
23:42:05.372 [fmatcher][d] Matching for bbb_sunflower_2160p_60fps_normal [bbb_sunflower_2160p_60fps_normal]
23:42:05.372 [fmatcher][d] No matched sub for this file
23:42:05.372 [fmatcher][d] Matching for bbb_sunflower_native_60fps_normal [bbb_sunflower_native_60fps_normal]
23:42:05.372 [fmatcher][d] No matched sub for this file
23:42:05.372 [fmatcher][d] Matching for big_buck_bunny_480p_surround-fix [big_buck_bunny_480p_surround-fix]
23:42:05.372 [fmatcher][d] No matched sub for this file
23:42:05.372 [fmatcher][d] Matching for Boeing MQ-25 Becomes First Unmanned Aircraft to Refuel Another Aircraft-q2uGkF2J1Y0
23:42:05.372 [fmatcher][d] No matched sub for this file
23:42:05.372 [fmatcher][d] Matching for cmaf [cmaf]
23:42:05.373 [fmatcher][d] No matched sub for this file
23:42:05.373 [fmatcher][d] Matching for Cocoa Programming L9 - NSPopUpButton [RKYSY2Ey9Os]
23:42:05.373 [fmatcher][d] No matched sub for this file
23:42:05.373 [fmatcher][d] Matching for hls_vod_mvp [hls_vod_mvp]
23:42:05.373 [fmatcher][d] No matched sub for this file
23:42:05.373 [fmatcher][d] Matching for How to create a Preferences Window (Xcode 9, Swift 4) [raLK95FyQso]
23:42:05.373 [fmatcher][d] No matched sub for this file
23:42:05.373 [fmatcher][d] Matching for How to Persist Data in Xcode 9 with User Defaults [U6odvRpv6SA]
23:42:05.373 [fmatcher][d] No matched sub for this file
23:42:05.373 [fmatcher][d] Matching for How to Save Settings to User Defaults Swift Xcode Tutorial [Hf_sianDJWY]
23:42:05.373 [fmatcher][d] No matched sub for this file
23:42:05.373 [fmatcher][d] Matching for How To Setup and Use SwiftLint _ Xcode 12, Swift 5 [yi6IACTWrlE]
23:42:05.373 [fmatcher][d] No matched sub for this file
23:42:05.373 [fmatcher][d] Matching for How To Store Data Permanently With User Defaults In xCode 10 (Swift 4.2) PART 2 [FzOsiD0V_j4]
23:42:05.374 [fmatcher][d] No matched sub for this file
23:42:05.374 [fmatcher][d] Matching for iOS  - Swift - Cast generic type into same generic type but with a subclass of associated type [SeC_JSOkzDE]
23:42:05.374 [fmatcher][d] No matched sub for this file
23:42:05.374 [fmatcher][d] Matching for Lecture - 1 Introduction to Basic Electronics [w8Dq8blTmSA]
23:42:05.374 [fmatcher][d] No matched sub for this file
23:42:05.374 [fmatcher][d] Matching for Lecture 1 _ Introduction to Convolutional Neural Networks for Visual Recognition [vT1JzLTH4G4]
23:42:05.374 [fmatcher][d] No matched sub for this file
23:42:05.374 [fmatcher][d] Matching for Lecture 2 _ Image Classification [OoUX-nOEjG0]
23:42:05.374 [fmatcher][d] No matched sub for this file
23:42:05.374 [fmatcher][d] Matching for Lecture 3 _ Loss Functions and Optimization [h7iBpEHGVNc]
23:42:05.374 [fmatcher][d] No matched sub for this file
23:42:05.374 [fmatcher][d] Matching for master [master]
23:42:05.374 [fmatcher][d] No matched sub for this file
23:42:05.374 [fmatcher][d] Matching for OSX Dev Day 93 - NSPopUpButton [7nwNqsxffAw]
23:42:05.375 [fmatcher][d] No matched sub for this file
23:42:05.375 [fmatcher][d] Matching for Shotcut Tutorial - Keyframes [j9xb1Rzn2Sg]
23:42:05.375 [fmatcher][d] No matched sub for this file
23:42:05.375 [fmatcher][d] Matching for SOUND TEST 5.1 [106673473]
23:42:05.375 [fmatcher][d] No matched sub for this file
23:42:05.375 [fmatcher][d] Matching for Supporting specific accessibility needs with SwiftUI – Flashzilla SwiftUI Tutorial 6_15-CKNptYFho7k
23:42:05.375 [fmatcher][d] No matched sub for this file
23:42:05.375 [fmatcher][d] Matching for The Heart of the Universe - English audio - Multiple language subtitles [292216028]
23:42:05.376 [fmatcher][d] Matched 9 subtitles
23:42:05.376 [fmatcher][d] Matching for Vidding Tips - Converting media to mp4 including 6 channel audio [aSKcKFMZKNY]
23:42:05.376 [fmatcher][d] No matched sub for this file
23:42:05.376 [fmatcher][d] Matching for VR 360 Video of Top 5 Roller Coaster Rides 4K Virtual Reality [hNAbQYU0wpg]
23:42:05.376 [fmatcher][d] No matched sub for this file
23:42:05.376 [fmatcher][d] Matching for Xcode 11 Tutorial - Connecting Outlets & Actions _ Manual Files in Assistant Editor [ZmXmweob2dw]
23:42:05.376 [fmatcher][d] No matched sub for this file
23:42:05.376 [fmatcher][d] Matching for Xcode How to make drop down list. NSPopUpButton [9Pvvot8e_b8]
23:42:05.376 [fmatcher][d] No matched sub for this file
23:42:05.376 [fmatcher][d] **Finished matching
23:42:05.472 [player0][d] File loaded
23:42:05.472 [player0][d] Track list changed
23:42:05.490 [iina][d] !!!!!!!!!!!!! Optional("osd-level,speed,edition,pause,volume,mute,audio-delay,fullscreen,ontop,border,gamma,brightness,contrast,saturation,hue,deinterlace,vf,af,panscan,aid,vid,sid,sub-delay,sub-speed,sub-pos,sub-visibility,sub-scale,sub-use-margins,sub-ass-force-margins,sub-ass-vsfilter-aspect-compat,sub-ass-override,ab-loop-a,ab-loop-b,video-aspect-override")
23:42:05.493 [player0][d] Getting thumbnails
23:42:05.495 [player0][d] Found thumbnail cache
23:42:05.495 [player0][d] Playback restarted
23:42:05.496 [thumbcache][d] Reading thumbnail cache...
23:42:05.498 [thumbcache][d] Reading from /Users/low-batt/Library/Caches/com.colliderli.iina/thumb_cache/beba854e5206f089e0386cae84458f6a
23:42:05.519 [player0][d] Track list changed
23:42:05.547 [thumbcache][d] Finished reading thumbnail cache, 101 in total
23:42:17.254 [player0][d] Playback restarted
23:42:19.859 [player0][d] Playback restarted
23:42:35.441 [player1][d] Set path to /Users/low-batt/Library/Developer/Xcode/DerivedData/iina-echacgeisxgbwucwumppkhklmnkd/Build/Products/Debug/IINA.app/Contents/MacOS:/Users/low-batt/Library/Developer/Xcode/DerivedData/iina-echacgeisxgbwucwumppkhklmnkd/Build/Products/Debug/IINA.app/Contents/MacOS:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin
23:42:35.470 [player1][d] Open URL: file:///Users/low-batt/Documents/builds/iina/issue-3812/video/05.mp4
23:42:35.470 [player1][d] Opening /Users/low-batt/Documents/builds/iina/issue-3812/video/05.mp4 in main window
23:42:35.472 [player1][d] Track list changed
2022-06-12 23:42:35.482819-0400 IINA[31458:1962689] [Nib Loading] Could not connect action, target class IINA.MainWindowController does not respond to -additionalInfoTitle:
23:42:35.525 [iina][d] Created OpenGL pixel format with [__C._CGLPixelFormatAttribute(rawValue: 5), __C._CGLPixelFormatAttribute(rawValue: 96), __C._CGLPixelFormatAttribute(rawValue: 99), __C._CGLPixelFormatAttribute(rawValue: 12800), __C._CGLPixelFormatAttribute(rawValue: 73), __C._CGLPixelFormatAttribute(rawValue: 101), __C._CGLPixelFormatAttribute(rawValue: 0)]
23:42:35.530 [iina][d] Falling back to nominal display refresh rate: 120.0 from 0.0
23:42:35.533 [iina][d] window!.screen: Built-in Retina Display visible frame (0.0, 22.0, 1728.0, 1057.0)
23:42:35.534 [iina][d] NSScreen.main: Built-in Retina Display visible frame (0.0, 22.0, 1728.0, 1057.0)
23:42:35.534 [iina][d] NSScreen.screens[0]: Built-in Retina Display visible frame (0.0, 22.0, 1728.0, 1057.0)
23:42:35.534 [iina][d] MainWindowLastPosition (288.0, 191.0) matched: Built-in Retina Display visible frame (0.0, 22.0, 1728.0, 1057.0)
23:42:35.543 [player1][d] File started
23:42:35.543 [player1][d] Track list changed
23:42:35.543 [player1][d] Started auto load
23:42:35.544 [fmatcher][d] **Start matching
23:42:35.545 [fmatcher][d] Getting all media files...
23:42:35.568 [fmatcher][d] Got all media files, video=8, audio=0
23:42:35.568 [fmatcher][d] Getting all sub files...
23:42:35.569 [fmatcher][d] Searching subtitles from 0 directories...
23:42:35.569 [fmatcher][d] Got 0 subtitles
23:42:35.569 [fmatcher][d] Grouping video files...
23:42:35.569 [fgroup][d] Start grouping 8 files
23:42:35.569 [fmatcher][d] Finished with 1 groups
23:42:35.569 [fmatcher][d] Grouping sub files...
23:42:35.569 [fgroup][d] Start grouping 0 files
23:42:35.569 [fmatcher][d] Finished with 1 groups
23:42:35.569 [fmatcher][d] Matching video and sub series...
23:42:35.570 [fmatcher][d] Calculated editing distance
23:42:35.570 [fmatcher][d] Finished matching.
23:42:35.570 [fmatcher][d] Matching subs with matched series, prefixes=0...
23:42:35.570 [fmatcher][d] Matching for 01
23:42:35.570 [fmatcher][d] No matched sub for this file
23:42:35.570 [fmatcher][d] Matching for 02
23:42:35.570 [fmatcher][d] No matched sub for this file
23:42:35.570 [fmatcher][d] Matching for 03
23:42:35.570 [fmatcher][d] No matched sub for this file
23:42:35.570 [fmatcher][d] Matching for 04
23:42:35.570 [fmatcher][d] No matched sub for this file
23:42:35.570 [fmatcher][d] Matching for 05
23:42:35.570 [fmatcher][d] No matched sub for this file
23:42:35.570 [fmatcher][d] Matching for 06
23:42:35.570 [fmatcher][d] No matched sub for this file
23:42:35.570 [fmatcher][d] Matching for 07
23:42:35.571 [fmatcher][d] No matched sub for this file
23:42:35.571 [fmatcher][d] Matching for 08
23:42:35.572 [fmatcher][d] No matched sub for this file
23:42:35.572 [fmatcher][d] **Finished matching
23:42:35.585 [player1][d] File loaded
23:42:35.586 [player1][d] Track list changed
23:42:35.590 [iina][d] !!!!!!!!!!!!! Optional("osd-level,speed,edition,pause,volume,mute,audio-delay,fullscreen,ontop,border,gamma,brightness,contrast,saturation,hue,deinterlace,vf,af,panscan,aid,vid,sid,sub-delay,sub-speed,sub-pos,sub-visibility,sub-scale,sub-use-margins,sub-ass-force-margins,sub-ass-vsfilter-aspect-compat,sub-ass-override,ab-loop-a,ab-loop-b,video-aspect-override")
23:42:35.618 [player1][d] Getting thumbnails
23:42:35.619 [player1][d] Found thumbnail cache
23:42:35.619 [thumbcache][d] Reading thumbnail cache...
23:42:35.620 [thumbcache][d] Reading from /Users/low-batt/Library/Caches/com.colliderli.iina/thumb_cache/4368556bfe9a0a85e8de57eb700ce0b8
23:42:35.620 [player1][d] Playback restarted
23:42:35.620 [thumbcache][d] Finished reading thumbnail cache, 1 in total
23:42:35.625 [player1][d] Track list changed
23:42:39.847 [player1][d] Write watch later config
23:42:39.889 [player1][d] Track list changed
23:42:54.762 [iina][d] App should terminate
23:42:54.762 [player0][d] Write watch later config
(lldb) bt all
* thread #1, queue = 'com.apple.main-thread'
  * frame #0: 0x0000000189d0e270 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001023f5e18 libsystem_pthread.dylib`_pthread_cond_wait + 1236
    frame #2: 0x00000001039e9c90 libmpv.1.dylib`mp_dispatch_lock + 216
    frame #3: 0x0000000103a00c88 libmpv.1.dylib`run_client_command + 144
    frame #4: 0x00000001010d1048 IINA`MPVController.command(command=(rawValue = "quit"), args=0 values, checkError=true, returnValueCallback=nil, self=0x0000000109439320) at MPVController.swift:445:23
    frame #5: 0x00000001010cfa44 IINA`MPVController.mpvQuit(self=0x0000000109439320) at MPVController.swift:419:5
    frame #6: 0x0000000100fe3074 IINA`PlayerCore.terminateMPV(sendQuit=true, self=0x0000000109716840) at PlayerCore.swift:337:11
    frame #7: 0x0000000100b936cc IINA`AppDelegate.applicationShouldTerminate(sender=0x0000000108a091c0, self=0x0000000109712a60) at AppDelegate.swift:287:9
    frame #8: 0x0000000100b937f8 IINA`@objc AppDelegate.applicationShouldTerminate(_:) at <compiler-generated>:0
    frame #9: 0x000000018cc0f694 AppKit`-[NSApplication _docController:shouldTerminate:] + 88
    frame #10: 0x000000018cc0f51c AppKit`__91-[NSDocumentController(NSInternal) _closeAllDocumentsWithDelegate:shouldTerminateSelector:]_block_invoke + 392
    frame #11: 0x000000018cc0f1a0 AppKit`-[NSDocumentController(NSInternal) _closeAllDocumentsWithDelegate:shouldTerminateSelector:] + 1088
    frame #12: 0x000000018cc0ed24 AppKit`-[NSDocumentController(NSInternal) __closeAllDocumentsWithDelegate:shouldTerminateSelector:] + 256
    frame #13: 0x000000018cc0e97c AppKit`-[NSApplication _shouldTerminate] + 768
    frame #14: 0x000000018cbff0b8 AppKit`-[NSApplication terminate:] + 740
    frame #15: 0x000000018cb7d844 AppKit`-[NSApplication(NSResponder) sendAction:to:from:] + 460
    frame #16: 0x000000018cc7372c AppKit`-[NSMenuItem _corePerformAction] + 444
    frame #17: 0x000000018cc73420 AppKit`-[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 100
    frame #18: 0x000000018ccbc018 AppKit`-[NSMenu performActionForItemAtIndex:] + 200
    frame #19: 0x000000018ccbbf38 AppKit`-[NSMenu _internalPerformActionForItemAtIndex:] + 100
    frame #20: 0x000000018ccbbd44 AppKit`-[NSCarbonMenuImpl _carbonCommandProcessEvent:handlerCallRef:] + 116
    frame #21: 0x000000018cc572b0 AppKit`NSSLMMenuEventHandler + 728
    frame #22: 0x0000000192a236c8 HIToolbox`DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 1084
    frame #23: 0x0000000192a22b4c HIToolbox`SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, HandlerCallRec*) + 356
    frame #24: 0x0000000192a38e50 HIToolbox`SendEventToEventTarget + 40
    frame #25: 0x0000000192a99870 HIToolbox`SendHICommandEvent(unsigned int, HICommand const*, unsigned int, unsigned int, unsigned char, void const*, OpaqueEventTargetRef*, OpaqueEventTargetRef*, OpaqueEventRef**) + 416
    frame #26: 0x0000000192abe9ac HIToolbox`SendMenuCommandWithContextAndModifiers + 56
    frame #27: 0x0000000192abe93c HIToolbox`SendMenuItemSelectedEvent + 352
    frame #28: 0x0000000192abe768 HIToolbox`FinishMenuSelection(SelectionData*, MenuResult*, MenuResult*) + 100
    frame #29: 0x0000000192abf128 HIToolbox`MenuSelectCore(MenuData*, Point, double, unsigned int, OpaqueMenuRef**, unsigned short*) + 560
    frame #30: 0x0000000192abee48 HIToolbox`_HandleMenuSelection2 + 416
    frame #31: 0x000000018cb16964 AppKit`_NSHandleCarbonMenuEvent + 300
    frame #32: 0x000000018cb16744 AppKit`_DPSEventHandledByCarbon + 68
    frame #33: 0x000000018c978824 AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3280
    frame #34: 0x000000018c96a250 AppKit`-[NSApplication run] + 596
    frame #35: 0x000000018c93b96c AppKit`NSApplicationMain + 1132
    frame #36: 0x0000000100bab844 IINA`main at AppDelegate.swift:22:7
    frame #37: 0x000000010249908c dyld`start + 520
  thread #2
    frame #0: 0x00000001023fba94 libsystem_pthread.dylib`start_wqthread
  thread #4
    frame #0: 0x00000001023fba94 libsystem_pthread.dylib`start_wqthread
  thread #10, queue = 'com.colliderli.iina.controller'
    frame #0: 0x0000000189d0e270 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001023f5e18 libsystem_pthread.dylib`_pthread_cond_wait + 1236
    frame #2: 0x00000001039e9c90 libmpv.1.dylib`mp_dispatch_lock + 216
    frame #3: 0x0000000103a01464 libmpv.1.dylib`mpv_get_property + 92
    frame #4: 0x00000001010d9874 IINA`MPVController.getInt(name="dwidth", self=0x0000000109439320) at MPVController.swift:510:5
    frame #5: 0x00000001010ee3f0 IINA`MPVController.onVideoReconfig(self=0x0000000109439320) at MPVController.swift:844:18
    frame #6: 0x00000001010e8054 IINA`MPVController.handleEvent(event=0x10937d130, self=0x0000000109439320) at MPVController.swift:749:7
    frame #7: 0x00000001010e53c0 IINA`closure #1 in MPVController.readEvents(self=0x0000000109439320) at MPVController.swift:701:14
    frame #8: 0x00000001006aa72c IINA`thunk for @escaping @callee_guaranteed () -> () at <compiler-generated>:0
    frame #9: 0x000000010289ec60 libclang_rt.asan_osx_dynamic.dylib`__wrap_dispatch_async_block_invoke + 196
    frame #10: 0x00000001038a8804 libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame #11: 0x00000001038aa3a8 libdispatch.dylib`_dispatch_client_callout + 20
    frame #12: 0x00000001038b3778 libdispatch.dylib`_dispatch_lane_serial_drain + 980
    frame #13: 0x00000001038b47e0 libdispatch.dylib`_dispatch_lane_invoke + 440
    frame #14: 0x00000001038c40c8 libdispatch.dylib`_dispatch_workloop_worker_thread + 1232
    frame #15: 0x00000001023f3f84 libsystem_pthread.dylib`_pthread_wqthread + 288
  thread #11, name = 'mpv/mpv core'
    frame #0: 0x00000001028c2b34 libclang_rt.asan_osx_dynamic.dylib`__sanitizer::BufferedStackTrace::UnwindFast(unsigned long, unsigned long, unsigned long, unsigned long, unsigned int) + 228
    frame #1: 0x00000001028a9394 libclang_rt.asan_osx_dynamic.dylib`__sanitizer::BufferedStackTrace::UnwindImpl(unsigned long, unsigned long, void*, bool, unsigned int) + 160
    frame #2: 0x000000010289fcf0 libclang_rt.asan_osx_dynamic.dylib`wrap_free + 244
    frame #3: 0x0000000103384018 libavutil.56.dylib`___lldb_unnamed_symbol20$$libavutil.56.dylib + 92
    frame #4: 0x0000000105149974 libavcodec.58.dylib`av_packet_unref + 24
    frame #5: 0x00000001039d32dc libmpv.1.dylib`packet_destroy + 36
    frame #6: 0x0000000103a7d300 libmpv.1.dylib`ta_free + 96
    frame #7: 0x00000001039bccd0 libmpv.1.dylib`clear_queue + 128
    frame #8: 0x00000001039bb04c libmpv.1.dylib`update_stream_selection_state + 408
    frame #9: 0x00000001039bae1c libmpv.1.dylib`demuxer_select_track + 164
    frame #10: 0x0000000103a16c9c libmpv.1.dylib`mp_switch_track_n + 608
    frame #11: 0x0000000103a17078 libmpv.1.dylib`mp_deselect_track + 96
    frame #12: 0x0000000103a1f1b0 libmpv.1.dylib`error_on_track + 40
    frame #13: 0x00000001039e9a74 libmpv.1.dylib`mp_dispatch_queue_process + 204
    frame #14: 0x0000000103a20ca8 libmpv.1.dylib`mp_wait_events + 80
    frame #15: 0x0000000103a22df0 libmpv.1.dylib`run_playloop + 2344
    frame #16: 0x0000000103a19c4c libmpv.1.dylib`mp_play_files + 6628
    frame #17: 0x00000001039fff1c libmpv.1.dylib`core_thread + 72
    frame #18: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #12, name = 'mpv/log-file'
    frame #0: 0x0000000189d0ea90 libsystem_kernel.dylib`__write_nocancel + 8
    frame #1: 0x0000000189c3c5b0 libsystem_c.dylib`__swrite + 24
    frame #2: 0x0000000189c1b444 libsystem_c.dylib`_swrite + 108
    frame #3: 0x0000000189c1956c libsystem_c.dylib`__sflush + 232
    frame #4: 0x0000000189c1940c libsystem_c.dylib`fflush + 36
    frame #5: 0x0000000102892858 libclang_rt.asan_osx_dynamic.dylib`wrap_fflush + 100
    frame #6: 0x00000001039b2ba4 libmpv.1.dylib`log_file_thread + 228
    frame #7: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #13, name = 'mpv/lua script (ytdl_hook)'
    frame #0: 0x0000000103f0c6ac libluajit-5.1.2.dylib`gc_onestep + 32
    frame #1: 0x0000000103f0c604 libluajit-5.1.2.dylib`lj_gc_step + 88
    frame #2: 0x0000000103f15f94 libluajit-5.1.2.dylib`lua_pushstring + 152
    frame #3: 0x0000000103a1ced0 libmpv.1.dylib`pushnode + 460
    frame #4: 0x0000000103a1b99c libmpv.1.dylib`script_raw_wait_event + 164
    frame #5: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #6: 0x0000000103f17490 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #7: 0x0000000103a1b5e4 libmpv.1.dylib`script_autofree_trampoline + 116
    frame #8: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #9: 0x0000000103a1b444 libmpv.1.dylib`load_scripts + 376
    frame #10: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #11: 0x0000000103f17490 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #12: 0x0000000103a1ad7c libmpv.1.dylib`run_lua + 956
    frame #13: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #14: 0x0000000103f174d0 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #15: 0x0000000103a1a888 libmpv.1.dylib`load_lua + 276
    frame #16: 0x0000000103a256a4 libmpv.1.dylib`run_script + 100
    frame #17: 0x0000000103a25728 libmpv.1.dylib`script_thread + 32
    frame #18: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #14, name = 'mpv/lua script (stats)'
    frame #0: 0x0000000103a1a94c libmpv.1.dylib`mp_lua_alloc
    frame #1: 0x0000000103f19aa0 libluajit-5.1.2.dylib`lj_mem_newgco + 44
    frame #2: 0x0000000103f0e054 libluajit-5.1.2.dylib`newtab + 116
    frame #3: 0x0000000103f0df84 libluajit-5.1.2.dylib`lj_tab_new + 12
    frame #4: 0x0000000103f16274 libluajit-5.1.2.dylib`lua_createtable + 60
    frame #5: 0x0000000103a1ce88 libmpv.1.dylib`pushnode + 388
    frame #6: 0x0000000103a1b99c libmpv.1.dylib`script_raw_wait_event + 164
    frame #7: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #8: 0x0000000103f17490 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #9: 0x0000000103a1b5e4 libmpv.1.dylib`script_autofree_trampoline + 116
    frame #10: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #11: 0x0000000103a1b444 libmpv.1.dylib`load_scripts + 376
    frame #12: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #13: 0x0000000103f17490 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #14: 0x0000000103a1ad7c libmpv.1.dylib`run_lua + 956
    frame #15: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #16: 0x0000000103f174d0 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #17: 0x0000000103a1a888 libmpv.1.dylib`load_lua + 276
    frame #18: 0x0000000103a256a4 libmpv.1.dylib`run_script + 100
    frame #19: 0x0000000103a25728 libmpv.1.dylib`script_thread + 32
    frame #20: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #15, name = 'mpv/lua script (console)'
    frame #0: 0x0000000103f0b6e0 libluajit-5.1.2.dylib`lj_fff_res + 64
    frame #1: 0x0000000103a1b444 libmpv.1.dylib`load_scripts + 376
    frame #2: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #3: 0x0000000103f17490 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #4: 0x0000000103a1ad7c libmpv.1.dylib`run_lua + 956
    frame #5: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #6: 0x0000000103f174d0 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #7: 0x0000000103a1a888 libmpv.1.dylib`load_lua + 276
    frame #8: 0x0000000103a256a4 libmpv.1.dylib`run_script + 100
    frame #9: 0x0000000103a25728 libmpv.1.dylib`script_thread + 32
    frame #10: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #16, name = 'mpv/ipc socket listener'
    frame #0: 0x0000000189d12eb0 libsystem_kernel.dylib`poll + 8
    frame #1: 0x000000010288b2a8 libclang_rt.asan_osx_dynamic.dylib`wrap_poll + 856
    frame #2: 0x00000001039e6f48 libmpv.1.dylib`ipc_thread + 368
    frame #3: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #17, name = 'AMCP Logging Spool'
    frame #0: 0x0000000189d0a8ec libsystem_kernel.dylib`semaphore_wait_trap + 8
    frame #1: 0x00000001927b6a2c caulk`caulk::mach::semaphore::wait_or_error() + 28
    frame #2: 0x000000019279a7ac caulk`caulk::concurrent::details::worker_thread::run() + 56
    frame #3: 0x000000019279a3cc caulk`void* caulk::thread_proxy<std::__1::tuple<caulk::thread::attributes, void (caulk::concurrent::details::worker_thread::*)(), std::__1::tuple<caulk::concurrent::details::worker_thread*> > >(void*) + 96
    frame #4: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #20
    frame #0: 0x00000001023fba94 libsystem_pthread.dylib`start_wqthread
  thread #24, queue = 'com.colliderli.iina.mpvgl'
    frame #0: 0x00000001023f8600 libsystem_pthread.dylib`pthread_mutex_lock + 20
    frame #1: 0x00000001039e99d8 libmpv.1.dylib`mp_dispatch_queue_process + 48
    frame #2: 0x0000000103a6b428 libmpv.1.dylib`mpv_render_context_update + 28
    frame #3: 0x00000001010cf5f0 IINA`MPVController.shouldRenderUpdateFrame(self=0x0000000109439320) at MPVController.swift:413:25
    frame #4: 0x0000000100e4f510 IINA`ViewLayer.canDraw(ctx=0x10aa8c100, pf=0x000000011ee0f7c0, t=151958.21627058336, ts=nil, self=0x0000000108135460) at ViewLayer.swift:91:33
    frame #5: 0x0000000100e4f67c IINA`@objc ViewLayer.canDraw(inCGLContext:pixelFormat:forLayerTime:displayTime:) at <compiler-generated>:0
    frame #6: 0x0000000190d42388 QuartzCore`CAOpenGLLayerDraw(CAOpenGLLayer*, double, CVTimeStamp const*, unsigned int) + 692
    frame #7: 0x0000000190d41ee8 QuartzCore`-[CAOpenGLLayer _display] + 584
    frame #8: 0x0000000100e561f8 IINA`ViewLayer.display(self=0x0000000108135460) at ViewLayer.swift:172:11
    frame #9: 0x0000000100e56354 IINA`@objc ViewLayer.display() at <compiler-generated>:0
    frame #10: 0x0000000100e53f28 IINA`ViewLayer.draw(forced=false, self=0x0000000108135460) at ViewLayer.swift:148:5
    frame #11: 0x00000001011144b0 IINA`closure #1 in mpvUpdateCallback(layer=0x0000000108135460) at MPVController.swift:1278:11
    frame #12: 0x00000001006aa72c IINA`thunk for @escaping @callee_guaranteed () -> () at <compiler-generated>:0
    frame #13: 0x000000010289ec60 libclang_rt.asan_osx_dynamic.dylib`__wrap_dispatch_async_block_invoke + 196
    frame #14: 0x00000001038a8804 libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame #15: 0x00000001038aa3a8 libdispatch.dylib`_dispatch_client_callout + 20
    frame #16: 0x00000001038b3778 libdispatch.dylib`_dispatch_lane_serial_drain + 980
    frame #17: 0x00000001038b47e0 libdispatch.dylib`_dispatch_lane_invoke + 440
    frame #18: 0x00000001038c40c8 libdispatch.dylib`_dispatch_workloop_worker_thread + 1232
    frame #19: 0x00000001023f3f84 libsystem_pthread.dylib`_pthread_wqthread + 288
  thread #25, name = 'com.apple.NSEventThread'
    frame #0: 0x0000000189d0a8b0 libsystem_kernel.dylib`mach_msg_trap + 8
    frame #1: 0x0000000189d0ad20 libsystem_kernel.dylib`mach_msg + 76
    frame #2: 0x0000000189e152b0 CoreFoundation`__CFRunLoopServiceMachPort + 372
    frame #3: 0x0000000189e13760 CoreFoundation`__CFRunLoopRun + 1180
    frame #4: 0x0000000189e12b24 CoreFoundation`CFRunLoopRunSpecific + 600
    frame #5: 0x000000018cae6374 AppKit`_NSEventThread + 196
    frame #6: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #27, name = 'mpv/demux'
    frame #0: 0x0000000189d0e270 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001023f5e18 libsystem_pthread.dylib`_pthread_cond_wait + 1236
    frame #2: 0x00000001039b8050 libmpv.1.dylib`demux_thread + 236
    frame #3: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #28, name = 'mpv/worker'
    frame #0: 0x0000000189d0e270 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001023f5e18 libsystem_pthread.dylib`_pthread_cond_wait + 1236
    frame #2: 0x00000001039eb4e8 libmpv.1.dylib`worker_thread + 80
    frame #3: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #31, name = 'com.apple.coremedia.rootQueue.47'
    frame #0: 0x0000000189d0a904 libsystem_kernel.dylib`semaphore_timedwait_trap + 8
    frame #1: 0x00000001038aab50 libdispatch.dylib`_dispatch_sema4_timedwait + 64
    frame #2: 0x00000001038ab144 libdispatch.dylib`_dispatch_semaphore_wait_slow + 76
    frame #3: 0x00000001038c1d90 libdispatch.dylib`_dispatch_worker_thread + 348
    frame #4: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #36, name = 'com.apple.audio.IOThread.client'
    frame #0: 0x0000000189d0a8b0 libsystem_kernel.dylib`mach_msg_trap + 8
    frame #1: 0x0000000189d0ad20 libsystem_kernel.dylib`mach_msg + 76
    frame #2: 0x000000018ba59ef4 CoreAudio`HALB_MachPort::SendSimpleMessageWithSimpleReply(unsigned int, unsigned int, int, int&, bool, unsigned int) + 104
    frame #3: 0x000000018b8e7238 CoreAudio`HALC_ProxyIOContext::IOWorkLoop() + 3396
    frame #4: 0x000000018b8e5efc CoreAudio`invocation function for block in HALC_ProxyIOContext::HALC_ProxyIOContext(unsigned int, unsigned int) + 100
    frame #5: 0x000000018bab2304 CoreAudio`HALB_IOThread::Entry(void*) + 88
    frame #6: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #37, name = 'mpv/mpv core'
    frame #0: 0x0000000189d0e270 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001023f5e18 libsystem_pthread.dylib`_pthread_cond_wait + 1236
    frame #2: 0x00000001039e9ad0 libmpv.1.dylib`mp_dispatch_queue_process + 296
    frame #3: 0x0000000103a20ca8 libmpv.1.dylib`mp_wait_events + 80
    frame #4: 0x0000000103a237b8 libmpv.1.dylib`mp_idle + 108
    frame #5: 0x0000000103a23824 libmpv.1.dylib`idle_loop + 44
    frame #6: 0x0000000103a18484 libmpv.1.dylib`mp_play_files + 540
    frame #7: 0x00000001039fff1c libmpv.1.dylib`core_thread + 72
    frame #8: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #38, name = 'mpv/log-file'
    frame #0: 0x0000000189d0e270 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001023f5e18 libsystem_pthread.dylib`_pthread_cond_wait + 1236
    frame #2: 0x00000001039b2b38 libmpv.1.dylib`log_file_thread + 120
    frame #3: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #39, name = 'mpv/lua script (ytdl_hook)'
    frame #0: 0x0000000189d0e270 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001023f5e18 libsystem_pthread.dylib`_pthread_cond_wait + 1236
    frame #2: 0x00000001039ff7b4 libmpv.1.dylib`wait_wakeup + 88
    frame #3: 0x0000000103a0011c libmpv.1.dylib`mpv_wait_event + 420
    frame #4: 0x0000000103a1b970 libmpv.1.dylib`script_raw_wait_event + 120
    frame #5: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #6: 0x0000000103f17490 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #7: 0x0000000103a1b5e4 libmpv.1.dylib`script_autofree_trampoline + 116
    frame #8: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #9: 0x0000000103a1b444 libmpv.1.dylib`load_scripts + 376
    frame #10: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #11: 0x0000000103f17490 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #12: 0x0000000103a1ad7c libmpv.1.dylib`run_lua + 956
    frame #13: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #14: 0x0000000103f174d0 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #15: 0x0000000103a1a888 libmpv.1.dylib`load_lua + 276
    frame #16: 0x0000000103a256a4 libmpv.1.dylib`run_script + 100
    frame #17: 0x0000000103a25728 libmpv.1.dylib`script_thread + 32
    frame #18: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #40, name = 'mpv/lua script (stats)'
    frame #0: 0x0000000189d0e270 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001023f5e18 libsystem_pthread.dylib`_pthread_cond_wait + 1236
    frame #2: 0x00000001039ff7b4 libmpv.1.dylib`wait_wakeup + 88
    frame #3: 0x0000000103a0011c libmpv.1.dylib`mpv_wait_event + 420
    frame #4: 0x0000000103a1b970 libmpv.1.dylib`script_raw_wait_event + 120
    frame #5: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #6: 0x0000000103f17490 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #7: 0x0000000103a1b5e4 libmpv.1.dylib`script_autofree_trampoline + 116
    frame #8: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #9: 0x0000000103a1b444 libmpv.1.dylib`load_scripts + 376
    frame #10: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #11: 0x0000000103f17490 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #12: 0x0000000103a1ad7c libmpv.1.dylib`run_lua + 956
    frame #13: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #14: 0x0000000103f174d0 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #15: 0x0000000103a1a888 libmpv.1.dylib`load_lua + 276
    frame #16: 0x0000000103a256a4 libmpv.1.dylib`run_script + 100
    frame #17: 0x0000000103a25728 libmpv.1.dylib`script_thread + 32
    frame #18: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #41, name = 'mpv/lua script (console)'
    frame #0: 0x0000000189d0e270 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001023f5e18 libsystem_pthread.dylib`_pthread_cond_wait + 1236
    frame #2: 0x00000001039ff7b4 libmpv.1.dylib`wait_wakeup + 88
    frame #3: 0x0000000103a0011c libmpv.1.dylib`mpv_wait_event + 420
    frame #4: 0x0000000103a1b970 libmpv.1.dylib`script_raw_wait_event + 120
    frame #5: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #6: 0x0000000103f17490 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #7: 0x0000000103a1b5e4 libmpv.1.dylib`script_autofree_trampoline + 116
    frame #8: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #9: 0x0000000103a1b444 libmpv.1.dylib`load_scripts + 376
    frame #10: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #11: 0x0000000103f17490 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #12: 0x0000000103a1ad7c libmpv.1.dylib`run_lua + 956
    frame #13: 0x0000000103f0a838 libluajit-5.1.2.dylib`lj_BC_FUNCC + 44
    frame #14: 0x0000000103f174d0 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #15: 0x0000000103a1a888 libmpv.1.dylib`load_lua + 276
    frame #16: 0x0000000103a256a4 libmpv.1.dylib`run_script + 100
    frame #17: 0x0000000103a25728 libmpv.1.dylib`script_thread + 32
    frame #18: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #44
    frame #0: 0x00000001023fba94 libsystem_pthread.dylib`start_wqthread
  thread #46, name = 'com.apple.coremedia.rootQueue.47'
    frame #0: 0x0000000189d0a904 libsystem_kernel.dylib`semaphore_timedwait_trap + 8
    frame #1: 0x00000001038aab50 libdispatch.dylib`_dispatch_sema4_timedwait + 64
    frame #2: 0x00000001038ab144 libdispatch.dylib`_dispatch_semaphore_wait_slow + 76
    frame #3: 0x00000001038c1d90 libdispatch.dylib`_dispatch_worker_thread + 348
    frame #4: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #47, name = 'mpv/ipc socket listener'
    frame #0: 0x0000000189d12eb0 libsystem_kernel.dylib`poll + 8
    frame #1: 0x000000010288b2a8 libclang_rt.asan_osx_dynamic.dylib`wrap_poll + 856
    frame #2: 0x00000001039e6f48 libmpv.1.dylib`ipc_thread + 368
    frame #3: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #48, name = 'mpv/worker'
    frame #0: 0x0000000189d0e270 libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001023f5e18 libsystem_pthread.dylib`_pthread_cond_wait + 1236
    frame #2: 0x00000001039eb4e8 libmpv.1.dylib`worker_thread + 80
    frame #3: 0x00000001023f1890 libsystem_pthread.dylib`_pthread_start + 148
  thread #49
    frame #0: 0x00000001023fba94 libsystem_pthread.dylib`start_wqthread
  thread #50
    frame #0: 0x00000001028a2cf0 libclang_rt.asan_osx_dynamic.dylib`__asan_region_is_poisoned + 1240
    frame #1: 0x0000000102878c54 libclang_rt.asan_osx_dynamic.dylib`wrap_memcpy + 464
    frame #2: 0x0000000102444ce0 libBacktraceRecording.dylib`get_entry_from_free_list + 276
    frame #3: 0x0000000102444b14 libBacktraceRecording.dylib`add_thread_info_to_list + 176
    frame #4: 0x00000001023f4e84 libsystem_pthread.dylib`_pthread_introspection_hook_callout_thread_start + 132
    frame #5: 0x00000001023f3e98 libsystem_pthread.dylib`_pthread_wqthread + 52
  thread #51
    frame #0: 0x0000000189d0c834 libsystem_kernel.dylib`__ulock_wait + 8
    frame #1: 0x0000000189d5d108 libsystem_platform.dylib`_os_unfair_lock_lock_slow + 204
    frame #2: 0x0000000102444c00 libBacktraceRecording.dylib`get_entry_from_free_list + 52
    frame #3: 0x0000000102444b14 libBacktraceRecording.dylib`add_thread_info_to_list + 176
    frame #4: 0x00000001023f4e84 libsystem_pthread.dylib`_pthread_introspection_hook_callout_thread_start + 132
    frame #5: 0x00000001023f3e98 libsystem_pthread.dylib`_pthread_wqthread + 52
(lldb) 

Steps to reproduce:

  • In Xcode edit the IINA scheme and enable:
    • Address Sanitizer
    • Detect use of stack after return
    • Undefined Behavior Sanitizer
    • Malloc Scribble
    • Zombie Objects
  • In Xcode start running IINA
  • In IINA open and start playing a video
  • While the video is still playing click the Quit IINA menu item
  • Execution will halt due to EXC_BAD_ACCESS
  • MPV does not have this problem.

Unknown. Would have to run mpv in Xcode with the same sanity checks enabled.

How often does this happen?
I've reproduced it several times now running under Xcode

@low-batt low-batt self-assigned this Jun 13, 2022
@pleasejustgo
Copy link

pleasejustgo commented Jun 13, 2022

Not sure if this is related but I just had IINA crash on me after I accidentally clicked on it's icon, then quit it a few seconds later.
crash.txt

@low-batt
Copy link
Contributor Author

@pleasejustgo Thanks for posting that crash report. It is related, but as it happened with the production version of IINA whereas the crash in this issue was artificially induced by building with Xcode sanity checks I thought it deserved its own issue and created #3824.

This is more confirmation that issues during IINA shutdown will sometimes disrupt saving position and settings for a video.

I will be working to get a fix merged for these failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants