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

MPV exists unexpectedly with Bus Error #13085

Closed
hmelder opened this issue Dec 13, 2023 · 34 comments
Closed

MPV exists unexpectedly with Bus Error #13085

hmelder opened this issue Dec 13, 2023 · 34 comments

Comments

@hmelder
Copy link

hmelder commented Dec 13, 2023

  • mpv version: 0.37.0
  • macOS Version: 14.0
  • Source of the mpv binary or bundle: Homebrew

Expected behavior

mpv plays videos and exists normally when running with no arguments.

Actual behavior

When running mpv with no arguments, execution results in a bus error. This cannot be reproduced in a debugger (lldb), as mpv plays videos just fine there and exists normally.

Log file

log with "-v --no-config"
hugo@Hugos-MacBook-Pro ~ % mpv -v --no-config
[cplayer] Command line options: '-v' '--no-config'
[cplayer] mpv 0.37.0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
[cplayer]  built on Nov 21 2023 18:47:46
[cplayer] libplacebo version: v6.338.1
[cplayer] FFmpeg version: 6.1
[cplayer] FFmpeg library versions:
[cplayer]    libavutil       58.2.100 (runtime 58.29.100)
[cplayer]    libavcodec      60.3.100 (runtime 60.31.102)
[cplayer]    libavformat     60.3.100 (runtime 60.16.100)
[cplayer]    libswscale      7.1.100 (runtime 7.5.100)
[cplayer]    libavfilter     9.3.100 (runtime 9.12.100)
[cplayer]    libswresample   4.10.100 (runtime 4.12.100)
[cplayer]
[cplayer] Configuration: -Dhtml-build=enabled -Djavascript=enabled -Dlibmpv=true -Dlua=luajit -Dlibarchive=enabled -Duchardet=enabled -Dprefix=/opt/homebrew/Cellar/mpv/0.37.0_1 -Ddatadir=/opt/homebrew/Cellar/mpv/0.37.0_1/share/mpv -Dlibdir=/opt/homebrew/Cellar/mpv/0.37.0_1/lib -Dmandir=/opt/homebrew/Cellar/mpv/0.37.0_1/share/man -Dsysconfdir=/opt/homebrew/etc/mpv -Dbuildtype=release -Dwrap_mode=nofallback
[cplayer] List of enabled features: av-channel-layout avif-muxer bsd-fstatfs build-date cocoa coreaudio cplugins darwin ffmpeg gl gl-cocoa glob glob-posix gpl html-build iconv javascript jpeg jpegxl lavu-uuid lcms2 libarchive libass libavdevice libbluray libdl libm libplacebo luajit macos-cocoa-cb macos-media-player macos-touchbar manpage-build osx-thread-name posix posix-shm rubberband rubberband-3 shaderc swift threads uchardet vapoursynth vector videotoolbox-gl videotoolbox-pl vk-khr-display vulkan zimg zimg-st428 zlib
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Setting option 'config' = 'no' (flags = 8)
[cplayer] mpv 0.37.0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
[cplayer]  built on Nov 21 2023 18:47:46
[cplayer] libplacebo version: v6.338.1
[cplayer] FFmpeg version: 6.1
[cplayer] FFmpeg library versions:
[cplayer]    libavutil       58.2.100 (runtime 58.29.100)
[cplayer]    libavcodec      60.3.100 (runtime 60.31.102)
[cplayer]    libavformat     60.3.100 (runtime 60.16.100)
[cplayer]    libswscale      7.1.100 (runtime 7.5.100)
[cplayer]    libavfilter     9.3.100 (runtime 9.12.100)
[cplayer]    libswresample   4.10.100 (runtime 4.12.100)
[cplayer]
[cplayer] Usage:   mpv [options] [url|path/]filename
[cplayer]
[cplayer] Basic options:
[cplayer]  --start=<time>    seek to given (percent, seconds, or hh:mm:ss) position
[cplayer]  --no-audio        do not play sound
[cplayer]  --no-video        do not play video
[cplayer]  --fs              fullscreen playback
[cplayer]  --sub-file=<file> specify subtitle file to use
[cplayer]  --playlist=<file> specify playlist file
[cplayer]
[cplayer]  --list-options    list all mpv options
[cplayer]  --h=<string>      print options which contain the given string in their name
[cplayer]
zsh: bus error  mpv -v --no-config
lldb log with "-v --no-config"
(lldb) target create "mpv"
Current executable set to '/opt/homebrew/bin/mpv' (arm64).
(lldb) run -v --no-config
Process 8605 launched: '/opt/homebrew/bin/mpv' (arm64)
[cplayer] Command line options: '-v' '--no-config'
[cplayer] mpv 0.37.0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
[cplayer]  built on Nov 21 2023 18:47:46
[cplayer] libplacebo version: v6.338.1
[cplayer] FFmpeg version: 6.1
[cplayer] FFmpeg library versions:
[cplayer]    libavutil       58.2.100 (runtime 58.29.100)
[cplayer]    libavcodec      60.3.100 (runtime 60.31.102)
[cplayer]    libavformat     60.3.100 (runtime 60.16.100)
[cplayer]    libswscale      7.1.100 (runtime 7.5.100)
[cplayer]    libavfilter     9.3.100 (runtime 9.12.100)
[cplayer]    libswresample   4.10.100 (runtime 4.12.100)
[cplayer]
[cplayer] Configuration: -Dhtml-build=enabled -Djavascript=enabled -Dlibmpv=true -Dlua=luajit -Dlibarchive=enabled -Duchardet=enabled -Dprefix=/opt/homebrew/Cellar/mpv/0.37.0_1 -Ddatadir=/opt/homebrew/Cellar/mpv/0.37.0_1/share/mpv -Dlibdir=/opt/homebrew/Cellar/mpv/0.37.0_1/lib -Dmandir=/opt/homebrew/Cellar/mpv/0.37.0_1/share/man -Dsysconfdir=/opt/homebrew/etc/mpv -Dbuildtype=release -Dwrap_mode=nofallback
[cplayer] List of enabled features: av-channel-layout avif-muxer bsd-fstatfs build-date cocoa coreaudio cplugins darwin ffmpeg gl gl-cocoa glob glob-posix gpl html-build iconv javascript jpeg jpegxl lavu-uuid lcms2 libarchive libass libavdevice libbluray libdl libm libplacebo luajit macos-cocoa-cb macos-media-player macos-touchbar manpage-build osx-thread-name posix posix-shm rubberband rubberband-3 shaderc swift threads uchardet vapoursynth vector videotoolbox-gl videotoolbox-pl vk-khr-display vulkan zimg zimg-st428 zlib
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Setting option 'config' = 'no' (flags = 8)
[cplayer] mpv 0.37.0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
[cplayer]  built on Nov 21 2023 18:47:46
[cplayer] libplacebo version: v6.338.1
[cplayer] FFmpeg version: 6.1
[cplayer] FFmpeg library versions:
[cplayer]    libavutil       58.2.100 (runtime 58.29.100)
[cplayer]    libavcodec      60.3.100 (runtime 60.31.102)
[cplayer]    libavformat     60.3.100 (runtime 60.16.100)
[cplayer]    libswscale      7.1.100 (runtime 7.5.100)
[cplayer]    libavfilter     9.3.100 (runtime 9.12.100)
[cplayer]    libswresample   4.10.100 (runtime 4.12.100)
[cplayer]
[cplayer] Usage:   mpv [options] [url|path/]filename
[cplayer]
[cplayer] Basic options:
[cplayer]  --start=<time>    seek to given (percent, seconds, or hh:mm:ss) position
[cplayer]  --no-audio        do not play sound
[cplayer]  --no-video        do not play video
[cplayer]  --fs              fullscreen playback
[cplayer]  --sub-file=<file> specify subtitle file to use
[cplayer]  --playlist=<file> specify playlist file
[cplayer]
[cplayer]  --list-options    list all mpv options
[cplayer]  --h=<string>      print options which contain the given string in their name
[cplayer]
[cplayer] Set property: user-data/osc/visibility="auto" -> 1
[cplayer] Set property: user-data/osc/margins={"r":0,"l":0,"t":0,"b":0} -> 1
2023-12-13 13:21:08.293289+0100 mpv[8605:448051] [client] No error handler for XPC error: Connection invalid
Process 8605 exited with status = 0 (0x00000000)

Example with file:

hugo@Hugos-MacBook-Pro ~ % mpv Keith\ Jarrett\ \ \ In\ Molde,\ Norway\ 1973\ \[eenfomgZKNk\].opus -v --no-config
[cplayer] Command line options: 'Keith Jarrett   In Molde, Norway 1973 [eenfomgZKNk].opus' '-v' '--no-config'
[cplayer] mpv 0.37.0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
[cplayer]  built on Nov 21 2023 18:47:46
[cplayer] libplacebo version: v6.338.1
[cplayer] FFmpeg version: 6.1
[cplayer] FFmpeg library versions:
[cplayer]    libavutil       58.2.100 (runtime 58.29.100)
[cplayer]    libavcodec      60.3.100 (runtime 60.31.102)
[cplayer]    libavformat     60.3.100 (runtime 60.16.100)
[cplayer]    libswscale      7.1.100 (runtime 7.5.100)
[cplayer]    libavfilter     9.3.100 (runtime 9.12.100)
[cplayer]    libswresample   4.10.100 (runtime 4.12.100)
[cplayer]
[cplayer] Configuration: -Dhtml-build=enabled -Djavascript=enabled -Dlibmpv=true -Dlua=luajit -Dlibarchive=enabled -Duchardet=enabled -Dprefix=/opt/homebrew/Cellar/mpv/0.37.0_1 -Ddatadir=/opt/homebrew/Cellar/mpv/0.37.0_1/share/mpv -Dlibdir=/opt/homebrew/Cellar/mpv/0.37.0_1/lib -Dmandir=/opt/homebrew/Cellar/mpv/0.37.0_1/share/man -Dsysconfdir=/opt/homebrew/etc/mpv -Dbuildtype=release -Dwrap_mode=nofallback
[cplayer] List of enabled features: av-channel-layout avif-muxer bsd-fstatfs build-date cocoa coreaudio cplugins darwin ffmpeg gl gl-cocoa glob glob-posix gpl html-build iconv javascript jpeg jpegxl lavu-uuid lcms2 libarchive libass libavdevice libbluray libdl libm libplacebo luajit macos-cocoa-cb macos-media-player macos-touchbar manpage-build osx-thread-name posix posix-shm rubberband rubberband-3 shaderc swift threads uchardet vapoursynth vector videotoolbox-gl videotoolbox-pl vk-khr-display vulkan zimg zimg-st428 zlib
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Setting option 'config' = 'no' (flags = 8)
zsh: bus error  mpv Keith\ Jarrett\ \ \ In\ Molde,\ Norway\ 1973\ \[eenfomgZKNk\].opus -v
@hmelder hmelder added the os:mac label Dec 13, 2023
@hmelder
Copy link
Author

hmelder commented Dec 13, 2023

Happens on master too: mpv v0.37.0-90-g9b001b448c

commit 9b001b4 (HEAD -> master, origin/master, origin/HEAD)

@kasper93
Copy link
Contributor

Can you provide backtrace of a crash?

@noahlias
Copy link

noahlias commented Feb 8, 2024

I got the same error

λ mpv -v --no-config
[cplayer] Command line options: '-v' '--no-config'
[cplayer] mpv 0.36.0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
[cplayer]  built on Sun Jul 23 05:10:36 2023
[cplayer] FFmpeg version: 6.1.1
[cplayer] FFmpeg library versions:
[cplayer]    libavutil       58.2.100 (runtime 58.29.100)
[cplayer]    libavcodec      60.3.100 (runtime 60.31.102)
[cplayer]    libavformat     60.3.100 (runtime 60.16.100)
[cplayer]    libswscale      7.1.100 (runtime 7.5.100)
[cplayer]    libavfilter     9.3.100 (runtime 9.12.100)
[cplayer]    libswresample   4.10.100 (runtime 4.12.100)
[cplayer] 
[cplayer] Configuration: -Dhtml-build=enabled -Djavascript=enabled -Dlibmpv=true -Dlua=luajit -Dlibarchive=enabled -Duchardet=enabled -Dprefix=/opt/Homebrew/Cellar/mpv/0.36.0 -Ddatadir=/opt/Homebrew/Cellar/mpv/0.36.0/share/mpv -Dlibdir=/opt/Homebrew/Cellar/mpv/0.36.0/lib -Dmandir=/opt/Homebrew/Cellar/mpv/0.36.0/share/man -Dsysconfdir=/opt/Homebrew/etc/mpv -Dbuildtype=release -Dwrap_mode=nofallback
[cplayer] List of enabled features: av-channel-layout avif_muxer bsd-fstatfs build-date cocoa coreaudio cplugins darwin ffmpeg gl gl-cocoa glob glob-posix gpl html-build iconv javascript jpeg jpegxl lcms2 libarchive libass libavdevice libbluray libdl libm luajit macos-cocoa-cb macos-media-player macos-touchbar manpage-build osx-thread-name posix posix_shm rubberband rubberband-3 stdatomic threads uchardet vapoursynth vector videotoolbox-gl zimg zimg-st428 zlib
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Setting option 'config' = 'no' (flags = 8)
[cplayer] mpv 0.36.0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
[cplayer]  built on Sun Jul 23 05:10:36 2023
[cplayer] FFmpeg version: 6.1.1
[cplayer] FFmpeg library versions:
[cplayer]    libavutil       58.2.100 (runtime 58.29.100)
[cplayer]    libavcodec      60.3.100 (runtime 60.31.102)
[cplayer]    libavformat     60.3.100 (runtime 60.16.100)
[cplayer]    libswscale      7.1.100 (runtime 7.5.100)
[cplayer]    libavfilter     9.3.100 (runtime 9.12.100)
[cplayer]    libswresample   4.10.100 (runtime 4.12.100)
[cplayer] 
[cplayer] Usage:   mpv [options] [url|path/]filename
[cplayer] 
[cplayer] Basic options:
[cplayer]  --start=<time>    seek to given (percent, seconds, or hh:mm:ss) position
[cplayer]  --no-audio        do not play sound
[cplayer]  --no-video        do not play video
[cplayer]  --fs              fullscreen playback
[cp[1]    37764 bus error  mpv -v --no-config

the backtrace

(lldb) target create 'mpv'
Current executable set to '/opt/Homebrew/bin/mpv' (arm64).
(lldb) run -v --no-config
Process 38355 launched: '/opt/Homebrew/bin/mpv' (arm64)
[cplayer] Command line options: '-v' '--no-config'
[cplayer] mpv 0.36.0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
[cplayer]  built on Sun Jul 23 05:10:36 2023
[cplayer] FFmpeg version: 6.1.1
[cplayer] FFmpeg library versions:
[cplayer]    libavutil       58.2.100 (runtime 58.29.100)
[cplayer]    libavcodec      60.3.100 (runtime 60.31.102)
[cplayer]    libavformat     60.3.100 (runtime 60.16.100)
[cplayer]    libswscale      7.1.100 (runtime 7.5.100)
[cplayer]    libavfilter     9.3.100 (runtime 9.12.100)
[cplayer]    libswresample   4.10.100 (runtime 4.12.100)
[cplayer] 
[cplayer] Configuration: -Dhtml-build=enabled -Djavascript=enabled -Dlibmpv=true -Dlua=luajit -Dlibarchive=enabled -Duchardet=enabled -Dprefix=/opt/Homebrew/Cellar/mpv/0.36.0 -Ddatadir=/opt/Homebrew/Cellar/mpv/0.36.0/share/mpv -Dlibdir=/opt/Homebrew/Cellar/mpv/0.36.0/lib -Dmandir=/opt/Homebrew/Cellar/mpv/0.36.0/share/man -Dsysconfdir=/opt/Homebrew/etc/mpv -Dbuildtype=release -Dwrap_mode=nofallback
[cplayer] List of enabled features: av-channel-layout avif_muxer bsd-fstatfs build-date cocoa coreaudio cplugins darwin ffmpeg gl gl-cocoa glob glob-posix gpl html-build iconv javascript jpeg jpegxl lcms2 libarchive libass libavdevice libbluray libdl libm luajit macos-cocoa-cb macos-media-player macos-touchbar manpage-build osx-thread-name posix posix_shm rubberband rubberband-3 stdatomic threads uchardet vapoursynth vector videotoolbox-gl zimg zimg-st428 zlib
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Setting option 'config' = 'no' (flags = 8)
[cplayer] mpv 0.36.0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
[cplayer]  built on Sun Jul 23 05:10:36 2023
[cplayer] FFmpeg version: 6.1.1
[cplayer] FFmpeg library versions:
[cplayer]    libavutil       58.2.100 (runtime 58.29.100)
[cplayer]    libavcodec      60.3.100 (runtime 60.31.102)
[cplayer]    libavformat     60.3.100 (runtime 60.16.100)
[cplayer]    libswscale      7.1.100 (runtime 7.5.100)
[cplayer]    libavfilter     9.3.100 (runtime 9.12.100)
[cplayer]    libswresample   4.10.100 (runtime 4.12.100)
[cplayer] 
[cplayer] Usage:   mpv [options] [url|path/]filename
[cplayer] 
[cplayer] Basic options:
[cplayer]  --start=<time>    seek to given (percent, seconds, or hh:mm:ss) position
[cplayer]  --no-audio        do not play sound
[cplayer]  --no-video        do not play video
[cplayer]  --fs              fullscreen playback
[cplayer]  --sub-file=<file> specify subtitle file to use
[cplayer]  --playlist=<file> specify playlist file
[cplayer] 
[cplayer]  --list-options    list all mpv options
[cplayer]  --h=<string>      print options which contain the given string in their name
[cplayer] 
Process 38355 stopped
* thread #6, queue = 'com.apple.MediaPlayer.MPNowPlayingInfoCenter/accessQueue', stop reason = EXC_BAD_ACCESS (code=257, address=0xbad4007)
    frame #0: 0x000000000bad4007
error: memory read failed for 0xbad4007
(lldb) thread apply all backtrace
invalid command 'thread apply'.
(lldb) thread backtrace all
  thread #1, queue = 'Client CFPasteboard-AppleIntlFileCacheModificationDatePasteboard'
    frame #0: 0x0000000183355874 libsystem_kernel.dylib`mach_msg2_trap + 8
    frame #1: 0x0000000183367cf0 libsystem_kernel.dylib`mach_msg2_internal + 80
    frame #2: 0x000000018320362c libdispatch.dylib`_dispatch_mach_msg_send + 916
    frame #3: 0x0000000183202e48 libdispatch.dylib`_dispatch_mach_send_drain + 328
    frame #4: 0x00000001831ff3e0 libdispatch.dylib`_dispatch_mach_send_msg + 348
    frame #5: 0x00000001831ffc14 libdispatch.dylib`dispatch_mach_send_with_result_and_async_reply_4libxpc + 116
    frame #6: 0x00000001830b6d20 libxpc.dylib`_xpc_connection_enqueue + 164
    frame #7: 0x00000001830b6fc8 libxpc.dylib`xpc_connection_send_message_with_reply + 264
    frame #8: 0x000000018353b484 CoreFoundation`-[_CFPasteboardEntry requestDataForPasteboard:generation:immediatelyAvailableResult:] + 1000
    frame #9: 0x000000018346f31c CoreFoundation`__CFPasteboardCopyData_block_invoke + 144
    frame #10: 0x00000001831e4910 libdispatch.dylib`_dispatch_client_callout + 20
    frame #11: 0x00000001831f3cc4 libdispatch.dylib`_dispatch_lane_barrier_sync_invoke_and_complete + 56
    frame #12: 0x000000018346edc8 CoreFoundation`CFPasteboardCopyData + 544
    frame #13: 0x0000000186750430 CarbonCore`CacheFMMapData + 404
    frame #14: 0x000000018674f668 CarbonCore`IntlFCOpenComponentData + 248
    frame #15: 0x000000018da41160 HIToolbox`InitializeInputSourceCache + 332
    frame #16: 0x000000018da40eb4 HIToolbox`GetInputSourceCacheHeader + 140
    frame #17: 0x000000018da4e99c HIToolbox`islcGetInputMethodIndexFromBundleID + 96
    frame #18: 0x000000018da3e79c HIToolbox`ValidateEnabledInputSourceIDs + 508
    frame #19: 0x000000018dbad0d0 HIToolbox`CopyInputSourceEnabledPrefs + 200
    frame #20: 0x000000018dbabf40 HIToolbox`GetInputSourceEnabledPrefsIncludingThirdParty + 96
    frame #21: 0x000000018da3d2e8 HIToolbox`isPrefsCreateCacheFromEnabledAndDefaultInputSources + 84
    frame #22: 0x000000018da3cbac HIToolbox`islGetInputSourceListWithAdditions + 324
    frame #23: 0x000000018da4e74c HIToolbox`_CreateKeyboardInputSourcesArray_Mutable + 448
    frame #24: 0x000000018da53f54 HIToolbox`_CreateKeyboardInputSourcesArray + 24
    frame #25: 0x000000018da3c690 HIToolbox`UpdateSourceIndicatorMode + 76
    frame #26: 0x000000018da3bf80 HIToolbox`InitTSMFirstEventTime + 852
    frame #27: 0x000000018da3a8bc HIToolbox`_FirstEventTime + 1020
    frame #28: 0x000000018da3a364 HIToolbox`RunCurrentEventLoopInMode + 64
    frame #29: 0x000000018da3a0d8 HIToolbox`ReceiveNextEventCommon + 220
    frame #30: 0x000000018da39fdc HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 76
    frame #31: 0x0000000186c50ed0 AppKit`_DPSNextEvent + 660
    frame #32: 0x000000018743beec AppKit`-[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
    frame #33: 0x0000000186c4437c AppKit`-[NSApplication run] + 476
    frame #34: 0x0000000100106d74 mpv`cocoa_main + 588
    frame #35: 0x00000001830150e0 dyld`start + 2360
  thread #2
    frame #0: 0x0000000183390e28 libsystem_pthread.dylib`start_wqthread
  thread #3, queue = 'com.apple.CoreAnalytics::Client XPC Send'
    frame #0: 0x000000018335576c libsystem_kernel.dylib`_kernelrpc_mach_port_construct_trap + 8
    frame #1: 0x00000001833569e0 libsystem_kernel.dylib`mach_port_construct + 40
    frame #2: 0x00000001830d63ec libxpc.dylib`_xpc_try_mach_port_construct + 64
    frame #3: 0x00000001830d6438 libxpc.dylib`_xpc_mach_port_construct + 28
    frame #4: 0x00000001830b2908 libxpc.dylib`_xpc_mach_port_allocate + 36
    frame #5: 0x00000001830b6f5c libxpc.dylib`xpc_connection_send_message_with_reply + 156
    frame #6: 0x000000018b067458 CoreAnalytics`CoreAnalytics::Client::retryXpcMessageHelper_sync(applesauce::xpc::dict, XPCMessagePriority, bool, unsigned char, unsigned long long) const + 336
    frame #7: 0x000000018b067258 CoreAnalytics`CoreAnalytics::Client::retryXpcMessage_sync(applesauce::xpc::dict, XPCMessagePriority, bool) const + 116
    frame #8: 0x000000018b067030 CoreAnalytics`invocation function for block in CoreAnalytics::Client::sendXpcMessage_sync(applesauce::xpc::dict, XPCMessagePriority, bool) const + 288
    frame #9: 0x00000001831f3860 libdispatch.dylib`_dispatch_block_async_invoke2 + 148
    frame #10: 0x00000001831e4910 libdispatch.dylib`_dispatch_client_callout + 20
    frame #11: 0x00000001831ebea4 libdispatch.dylib`_dispatch_lane_serial_drain + 748
    frame #12: 0x00000001831ec9d4 libdispatch.dylib`_dispatch_lane_invoke + 380
    frame #13: 0x00000001831f761c libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 288
    frame #14: 0x00000001831f6e90 libdispatch.dylib`_dispatch_workloop_worker_thread + 404
    frame #15: 0x0000000183392114 libsystem_pthread.dylib`_pthread_wqthread + 288
  thread #4, name = 'mpv/playback core (OSX)'
    frame #0: 0x00000001833c2dc4 libsystem_platform.dylib`_platform_strlen + 4
    frame #1: 0x0000000100084f84 mpv`m_config_get_co_any + 164
    frame #2: 0x0000000100084b50 mpv`m_config_get_co + 12
    frame #3: 0x000000010009fa54 mpv`mp_property_generic_option + 68
    frame #4: 0x0000000100091cb4 mpv`do_action + 260
    frame #5: 0x0000000100091938 mpv`m_property_do + 696
    frame #6: 0x000000010009b6a4 mpv`mp_property_do + 76
    frame #7: 0x0000000100098eb0 mpv`getproperty_fn + 124
    frame #8: 0x0000000100099a54 mpv`mp_client_send_property_changes + 336
    frame #9: 0x00000001000b6090 mpv`mp_wait_events + 20
    frame #10: 0x0000000100097328 mpv`mp_shutdown_clients + 112
    frame #11: 0x00000001000b3308 mpv`mp_destroy + 24
    frame #12: 0x00000001000b3d28 mpv`mpv_main + 320
    frame #13: 0x0000000100106dfc mpv`playback_thread + 48
    frame #14: 0x0000000183396034 libsystem_pthread.dylib`_pthread_start + 136
  thread #5
    frame #0: 0x0000000183390e28 libsystem_pthread.dylib`start_wqthread
* thread #6, queue = 'com.apple.MediaPlayer.MPNowPlayingInfoCenter/accessQueue', stop reason = EXC_BAD_ACCESS (code=257, address=0xbad4007)
  * frame #0: 0x000000000bad4007
    frame #1: 0x000000018ddbcd60 ImageIO`invocation function for block in SetupTIFFErrorHandler() + 20
    frame #2: 0x00000001831e4910 libdispatch.dylib`_dispatch_client_callout + 20
    frame #3: 0x00000001831e614c libdispatch.dylib`_dispatch_once_callout + 32
    frame #4: 0x000000018dd285dc ImageIO`TIFFWritePlugin::writeAll() + 80
    frame #5: 0x000000018dd28544 ImageIO`IIO_Writer_TIFF::write(void*, void*) + 48
    frame #6: 0x000000018de16c94 ImageIO`IIOImageDestination::finalizeDestination() + 896
    frame #7: 0x000000018dd2834c ImageIO`CGImageDestinationFinalize + 180
    frame #8: 0x0000000186e55a40 AppKit`+[NSBitmapImageRep(NSBitmapImageFileTypeExtensions) representationOfImageRepsInArray:usingType:properties:] + 1832
    frame #9: 0x0000000186e547a0 AppKit`-[NSImage TIFFRepresentationUsingCompression:factor:] + 216
    frame #10: 0x00000001a97a32a4 MediaPlayer`MPArtworkImageJPEGRepresentation + 60
    frame #11: 0x00000001a96c8f44 MediaPlayer`-[MPMediaItemArtwork jpegDataWithSize:] + 48
    frame #12: 0x00000001a9751848 MediaPlayer`___MPToMRNowPlayingInfoDictionary_block_invoke + 288
    frame #13: 0x0000000192f97560 libswiftCore.dylib`$ss26_SwiftDeferredNSDictionaryC23enumerateKeysAndObjects7options5usingySi_ys9UnmanagedVyyXlG_AHSpys5UInt8VGtXBtFTf4dnn_n + 580
    frame #14: 0x0000000192d25940 libswiftCore.dylib`$ss26_SwiftDeferredNSDictionaryC23enumerateKeysAndObjects7options5usingySi_ys9UnmanagedVyyXlG_AHSpys5UInt8VGtXBtFTo + 48
    frame #15: 0x00000001a97515b4 MediaPlayer`_MPToMRNowPlayingInfoDictionary + 200
    frame #16: 0x00000001a9751310 MediaPlayer`-[MPNowPlayingInfoCenter(NowPlayingInfo) _onQueue_pushNowPlayingInfoAndRetry:] + 268
    frame #17: 0x00000001831e2cb8 libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame #18: 0x00000001831e4910 libdispatch.dylib`_dispatch_client_callout + 20
    frame #19: 0x00000001831ebea4 libdispatch.dylib`_dispatch_lane_serial_drain + 748
    frame #20: 0x00000001831ec9d4 libdispatch.dylib`_dispatch_lane_invoke + 380
    frame #21: 0x00000001831f761c libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 288
    frame #22: 0x00000001831f6e90 libdispatch.dylib`_dispatch_workloop_worker_thread + 404
    frame #23: 0x0000000183392114 libsystem_pthread.dylib`_pthread_wqthread + 288
  thread #7, name = 'mpv/terminal'
    frame #0: 0x00000001833609d4 libsystem_kernel.dylib`__select + 8
    frame #1: 0x0000000100110a8c mpv`polldev + 348
    frame #2: 0x0000000100110d78 mpv`terminal_thread + 180
    frame #3: 0x0000000183396034 libsystem_pthread.dylib`_pthread_start + 136
  thread #8, name = 'mpv/lua script (osc)'
    frame #0: 0x000000018335906c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001833965fc libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x000000010007fe80 mpv`mp_dispatch_lock + 188
    frame #3: 0x00000001000984ac mpv`run_client_command + 144
    frame #4: 0x00000001001195e0 mpv`script_commandv + 260
    frame #5: 0x000000010114606c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #6: 0x00000001001188d4 mpv`load_builtin + 400
    frame #7: 0x000000010114606c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #8: 0x0000000101195624 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1425 + 528
    frame #9: 0x000000010114606c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #10: 0x000000010011b9b0 mpv`require + 180
    frame #11: 0x0000000100118bf0 mpv`load_scripts + 120
    frame #12: 0x000000010114606c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #13: 0x0000000101152af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #14: 0x0000000100118614 mpv`run_lua + 956
    frame #15: 0x000000010114606c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #16: 0x0000000101152b34 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #17: 0x0000000100118110 mpv`load_lua + 276
    frame #18: 0x00000001000baf68 mpv`run_script + 100
    frame #19: 0x00000001000bafec mpv`script_thread + 32
    frame #20: 0x0000000183396034 libsystem_pthread.dylib`_pthread_start + 136
  thread #10, name = 'mpv/lua script (stats)'
    frame #0: 0x0000000183356530 libsystem_kernel.dylib`__mmap + 8
    frame #1: 0x00000001833564c0 libsystem_kernel.dylib`mmap + 60
    frame #2: 0x0000000101188064 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1211 + 120
    frame #3: 0x0000000101169a8c libluajit-5.1.2.dylib`___lldb_unnamed_symbol805 + 260
    frame #4: 0x00000001011685f0 libluajit-5.1.2.dylib`___lldb_unnamed_symbol803 + 7980
    frame #5: 0x0000000101146474 libluajit-5.1.2.dylib`___lldb_unnamed_symbol362 + 108
    frame #6: 0x000000010114e4fc libluajit-5.1.2.dylib`___lldb_unnamed_symbol564 + 88
    frame #7: 0x000000010114e728 libluajit-5.1.2.dylib`___lldb_unnamed_symbol567 + 216
    frame #8: 0x0000000101147984 libluajit-5.1.2.dylib`___lldb_unnamed_symbol465 + 28
    frame #9: 0x00000001001188d4 mpv`load_builtin + 400
    frame #10: 0x000000010114606c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #11: 0x0000000101195624 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1425 + 528
    frame #12: 0x000000010114606c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #13: 0x000000010011b9b0 mpv`require + 180
    frame #14: 0x0000000100118bf0 mpv`load_scripts + 120
    frame #15: 0x000000010114606c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #16: 0x0000000101152af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #17: 0x0000000100118614 mpv`run_lua + 956
    frame #18: 0x000000010114606c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #19: 0x0000000101152b34 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #20: 0x0000000100118110 mpv`load_lua + 276
    frame #21: 0x00000001000baf68 mpv`run_script + 100
    frame #22: 0x00000001000bafec mpv`script_thread + 32
    frame #23: 0x0000000183396034 libsystem_pthread.dylib`_pthread_start + 136
  thread #11, name = 'mpv/lua script (console)'
    frame #0: 0x000000018335906c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x00000001833965fc libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x000000010007fe80 mpv`mp_dispatch_lock + 188
    frame #3: 0x0000000100098de4 mpv`mpv_get_property + 92
    frame #4: 0x0000000100119b5c mpv`script_get_property_native + 156
    frame #5: 0x000000010114606c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #6: 0x0000000101152af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #7: 0x0000000100118ec0 mpv`script_autofree_trampoline + 116
    frame #8: 0x000000010114606c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #9: 0x00000001001188d4 mpv`load_builtin + 400
    frame #10: 0x000000010114606c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #11: 0x0000000101195624 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1425 + 528
    frame #12: 0x000000010114606c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #13: 0x000000010011b9b0 mpv`require + 180
    frame #14: 0x0000000100118bf0 mpv`load_scripts + 120
    frame #15: 0x000000010114606c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #16: 0x0000000101152af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #17: 0x0000000100118614 mpv`run_lua + 956
    frame #18: 0x000000010114606c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #19: 0x0000000101152b34 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #20: 0x0000000100118110 mpv`load_lua + 276
    frame #21: 0x00000001000baf68 mpv`run_script + 100
    frame #22: 0x00000001000bafec mpv`script_thread + 32
    frame #23: 0x0000000183396034 libsystem_pthread.dylib`_pthread_start + 136
  thread #12, name = 'mpv/lua script (auto_profiles)'
    frame #0: 0x000000018fc0c0c4 libunwind.dylib`libunwind::CFI_Parser<libunwind::LocalAddressSpace>::parseCIE(libunwind::LocalAddressSpace&, unsigned long, libunwind::CFI_Parser<libunwind::LocalAddressSpace>::CIE_Info*) + 168
    frame #1: 0x000000018fc0c480 libunwind.dylib`libunwind::CFI_Parser<libunwind::LocalAddressSpace>::findFDE(libunwind::LocalAddressSpace&, unsigned long, unsigned long, unsigned long, unsigned long, libunwind::CFI_Parser<libunwind::LocalAddressSpace>::FDE_Info*, libunwind::CFI_Parser<libunwind::LocalAddressSpace>::CIE_Info*) + 164
    frame #2: 0x000000018fc0ac58 libunwind.dylib`libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_arm64>::getInfoFromDwarfSection(unsigned long, libunwind::UnwindInfoSections const&, unsigned int) + 72
    frame #3: 0x000000018fc0ab18 libunwind.dylib`libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_arm64>::setInfoBasedOnIPRegister(bool) + 1312
    frame #4: 0x000000018fc0e3bc libunwind.dylib`unw_set_reg + 620
    frame #5: 0x00000001011486d8 libluajit-5.1.2.dylib`___lldb_unnamed_symbol480 + 308
    frame #6: 0x000000018fc0f1ac libunwind.dylib`unwind_phase2 + 596
    frame #7: 0x000000018fc0ef40 libunwind.dylib`_Unwind_RaiseException + 840
    frame #8: 0x000000010114895c libluajit-5.1.2.dylib`___lldb_unnamed_symbol483 + 96
    frame #9: 0x000000010116ee18 libluajit-5.1.2.dylib`___lldb_unnamed_symbol811 + 48
    frame #10: 0x00000001011880e4 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1211 + 248
    frame #11: 0x0000000101169a8c libluajit-5.1.2.dylib`___lldb_unnamed_symbol805 + 260
    frame #12: 0x00000001011685f0 libluajit-5.1.2.dylib`___lldb_unnamed_symbol803 + 7980
    frame #13: 0x0000000101146474 libluajit-5.1.2.dylib`___lldb_unnamed_symbol362 + 108
    frame #14: 0x000000010114e4fc libluajit-5.1.2.dylib`___lldb_unnamed_symbol564 + 88
    frame #15: 0x000000010114e328 libluajit-5.1.2.dylib`___lldb_unnamed_symbol562 + 136
    frame #16: 0x0000000101147900 libluajit-5.1.2.dylib`___lldb_unnamed_symbol461 + 52
    frame #17: 0x00000001001188d4 mpv`load_builtin + 400
    frame #18: 0x000000010114606c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #19: 0x0000000101195624 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1425 + 528
    frame #20: 0x000000010114606c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #21: 0x000000010011b9b0 mpv`require + 180
    frame #22: 0x0000000100118bf0 mpv`load_scripts + 120
    frame #23: 0x000000010114606c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #24: 0x0000000101152af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #25: 0x0000000100118614 mpv`run_lua + 956
    frame #26: 0x000000010114606c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #27: 0x0000000101152b34 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #28: 0x0000000100118110 mpv`load_lua + 276
    frame #29: 0x00000001000baf68 mpv`run_script + 100
    frame #30: 0x00000001000bafec mpv`script_thread + 32
    frame #31: 0x0000000183396034 libsystem_pthread.dylib`_pthread_start + 136
(lldb) 

@kasper93
Copy link
Contributor

kasper93 commented Feb 8, 2024

@Akemi Do you have an idea why this might happen?

@Akemi
Copy link
Member

Akemi commented Feb 8, 2024

just assuming that the recent backtrace is the same problem as from the OP. at least the backtrace is a bit more revealing of the underlying problem. seems like we are pushing some broken image data or the wrong size via the MPMediaItemArtwork to the MPNowPlayingInfoCenter.nowPlayingInfo dict and it tries to read broken data or out of bounds.

since it's some swift <> c interaction (https://github.com/mpv-player/mpv/blob/master/osdep/macos/remote_command_center.swift#L107-L112), it's highly possible i did something wrong there. just wondering why it doesn't happen everywhere. so it must be some kind of race condition?

i am refactoring this part of the code atm anyway, maybe i can find something.

* thread #6, queue = 'com.apple.MediaPlayer.MPNowPlayingInfoCenter/accessQueue', stop reason = EXC_BAD_ACCESS (code=257, address=0xbad4007)
  * frame #0: 0x000000000bad4007
    frame #1: 0x000000018ddbcd60 ImageIO`invocation function for block in SetupTIFFErrorHandler() + 20
    frame #2: 0x00000001831e4910 libdispatch.dylib`_dispatch_client_callout + 20
    frame #3: 0x00000001831e614c libdispatch.dylib`_dispatch_once_callout + 32
    frame #4: 0x000000018dd285dc ImageIO`TIFFWritePlugin::writeAll() + 80
    frame #5: 0x000000018dd28544 ImageIO`IIO_Writer_TIFF::write(void*, void*) + 48
    frame #6: 0x000000018de16c94 ImageIO`IIOImageDestination::finalizeDestination() + 896
    frame #7: 0x000000018dd2834c ImageIO`CGImageDestinationFinalize + 180
    frame #8: 0x0000000186e55a40 AppKit`+[NSBitmapImageRep(NSBitmapImageFileTypeExtensions) representationOfImageRepsInArray:usingType:properties:] + 1832
    frame #9: 0x0000000186e547a0 AppKit`-[NSImage TIFFRepresentationUsingCompression:factor:] + 216
    frame #10: 0x00000001a97a32a4 MediaPlayer`MPArtworkImageJPEGRepresentation + 60
    frame #11: 0x00000001a96c8f44 MediaPlayer`-[MPMediaItemArtwork jpegDataWithSize:] + 48
    frame #12: 0x00000001a9751848 MediaPlayer`___MPToMRNowPlayingInfoDictionary_block_invoke + 288
    frame #13: 0x0000000192f97560 libswiftCore.dylib`$ss26_SwiftDeferredNSDictionaryC23enumerateKeysAndObjects7options5usingySi_ys9UnmanagedVyyXlG_AHSpys5UInt8VGtXBtFTf4dnn_n + 580
    frame #14: 0x0000000192d25940 libswiftCore.dylib`$ss26_SwiftDeferredNSDictionaryC23enumerateKeysAndObjects7options5usingySi_ys9UnmanagedVyyXlG_AHSpys5UInt8VGtXBtFTo + 48
    frame #15: 0x00000001a97515b4 MediaPlayer`_MPToMRNowPlayingInfoDictionary + 200
    frame #16: 0x00000001a9751310 MediaPlayer`-[MPNowPlayingInfoCenter(NowPlayingInfo) _onQueue_pushNowPlayingInfoAndRetry:] + 268
    frame #17: 0x00000001831e2cb8 libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame #18: 0x00000001831e4910 libdispatch.dylib`_dispatch_client_callout + 20
    frame #19: 0x00000001831ebea4 libdispatch.dylib`_dispatch_lane_serial_drain + 748
    frame #20: 0x00000001831ec9d4 libdispatch.dylib`_dispatch_lane_invoke + 380
    frame #21: 0x00000001831f761c libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 288
    frame #22: 0x00000001831f6e90 libdispatch.dylib`_dispatch_workloop_worker_thread + 404
    frame #23: 0x0000000183392114 libsystem_pthread.dylib`_pthread_wqthread + 288

@Akemi
Copy link
Member

Akemi commented Feb 8, 2024

@noahlias is that problem well reproducible on your end? can you build mpv yourself and could test a patch?

[edit]
it might just be a case of the usual cocoa "do it on the main queue" shit.

@noahlias
Copy link

noahlias commented Feb 9, 2024

@noahlias is that problem well reproducible on your end? can you build mpv yourself and could test a patch?

[edit] it might just be a case of the usual cocoa "do it on the main queue" shit.

what mean?
I build it manually and delete the homebrew version but it got the same error.

mpv on  tags/v0.36.0 via 🅒 base 
λ meson setup build            
The Meson build system
Version: 1.3.1
Source dir: /Users/alias/Downloads/m/Misc/projects/mpv
Build dir: /Users/alias/Downloads/m/Misc/projects/mpv/build
Build type: native build
Project name: mpv
Project version: 0.36.0
C compiler for the host machine: cc (clang 15.0.0 "Apple clang version 15.0.0 (clang-1500.1.0.2.5)")
C linker for the host machine: cc ld64 1022.1
Host machine cpu family: aarch64
Host machine cpu: aarch64
Program python3 found: YES (/opt/Homebrew/Caskroom/miniforge/base/bin/python3)
Found pkg-config: YES (/opt/Homebrew/bin/pkg-config) 0.29.2
Run-time dependency libavcodec found: YES 60.31.102
Run-time dependency libavfilter found: YES 9.12.100
Run-time dependency libavformat found: YES 60.16.100
Run-time dependency libavutil found: YES 58.29.100
Run-time dependency libswresample found: YES 4.12.100
Run-time dependency libswscale found: YES 7.5.100
Run-time dependency libass found: YES 0.17.1
Run-time dependency threads found: YES
Compiler for C supports arguments -Werror=implicit-function-declaration: YES 
Compiler for C supports arguments -Wno-error=deprecated-declarations: YES 
Compiler for C supports arguments -Wno-error=unused-function: YES 
Compiler for C supports arguments -Wempty-body: YES 
Compiler for C supports arguments -Wdisabled-optimization: YES 
Compiler for C supports arguments -Wstrict-prototypes: YES 
Compiler for C supports arguments -Wno-format-zero-length: YES 
Compiler for C supports arguments -Wno-redundant-decls: YES 
Compiler for C supports arguments -Wvla: YES 
mpv on  tags/v0.36.0 via 🅒 base took 12s 
λ meson compile -C build
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /opt/Homebrew/Caskroom/miniforge/base/bin/ninja -C /Users/alias/Downloads/m/Misc/projects/mpv/build
ninja: Entering directory `/Users/alias/Downloads/m/Misc/projects/mpv/build'
[22/246] Generating generated/osdep/swift_targets with a custom command
../osdep/macos/libmpv_helper.swift:127:13: warning: 'glGetIntegerv' was deprecated in macOS 10.14: OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings)
            glGetIntegerv(GLenum(GL_DRAW_FRAMEBUFFER_BINDING), &i)
            ^
../osdep/macos/libmpv_helper.swift:148:13: warning: 'glClearColor' was deprecated in macOS 10.14: OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings)
            glClearColor(0, 0, 0, 1)
            ^
../osdep/macos/libmpv_helper.swift:149:13: warning: 'glClear' was deprecated in macOS 10.14: OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings)
            glClear(GLbitfield(GL_COLOR_BUFFER_BIT))
            ^
../osdep/macos/libmpv_helper.swift:152:20: warning: 'CGLFlushDrawable' was deprecated in macOS 10.14: OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings)
        if !skip { CGLFlushDrawable(ctx) }
                   ^
../osdep/macos/swift_extensions.swift:38:55: warning: 'kIOMasterPortDefault' was deprecated in macOS 12.0: renamed to 'kIOMainPortDefault'
            let result = IOServiceGetMatchingServices(kIOMasterPortDefault, matching, &iter)
                                                      ^
../osdep/macos/swift_extensions.swift:38:55: note: use 'kIOMainPortDefault' instead
            let result = IOServiceGetMatchingServices(kIOMasterPortDefault, matching, &iter)
                                                      ^~~~~~~~~~~~~~~~~~~~
                                                      kIOMainPortDefault
../video/out/mac/common.swift:307:47: warning: 'kIOMasterPortDefault' was deprecated in macOS 12.0: renamed to 'kIOMainPortDefault'
        let srv = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("AppleLMUController"))
                                              ^
../video/out/mac/common.swift:307:47: note: use 'kIOMainPortDefault' instead
        let srv = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("AppleLMUController"))
                                              ^~~~~~~~~~~~~~~~~~~~
                                              kIOMainPortDefault
../video/out/mac/common.swift:313:54: warning: 'kIOMasterPortDefault' was deprecated in macOS 12.0: renamed to 'kIOMainPortDefault'
        lightSensorIOPort = IONotificationPortCreate(kIOMasterPortDefault)
                                                     ^
../video/out/mac/common.swift:313:54: note: use 'kIOMainPortDefault' instead
        lightSensorIOPort = IONotificationPortCreate(kIOMasterPortDefault)
                                                     ^~~~~~~~~~~~~~~~~~~~
                                                     kIOMainPortDefault
../video/out/mac/title_bar.swift:39:29: warning: 'light' was deprecated in macOS 10.14: Use a semantic material instead.  To force the appearance of a view hierarchy, set the `appearance` property to an appropriate NSAppearance value.
mpv on  tags/v0.36.0 via 🅒 base took 11s 
λ meson install -C build
ninja: Entering directory `/Users/alias/Downloads/m/Misc/projects/mpv/build'
[1/3] Generating generated/version.h with a custom command
Installing mpv.1 to /opt/Homebrew/share/man/man1
Installing mpv to /opt/Homebrew/bin
Installing /Users/alias/Downloads/m/Misc/projects/mpv/etc/mpv.conf to /opt/Homebrew/share/doc/mpv
Installing /Users/alias/Downloads/m/Misc/projects/mpv/etc/input.conf to /opt/Homebrew/share/doc/mpv
Installing /Users/alias/Downloads/m/Misc/projects/mpv/etc/mplayer-input.conf to /opt/Homebrew/share/doc/mpv
Installing /Users/alias/Downloads/m/Misc/projects/mpv/etc/restore-old-bindings.conf to /opt/Homebrew/share/doc/mpv
Installing /Users/alias/Downloads/m/Misc/projects/mpv/etc/mpv.bash-completion to /opt/Homebrew/share/bash-completion/completions
Installing /Users/alias/Downloads/m/Misc/projects/mpv/etc/_mpv.zsh to /opt/Homebrew/share/zsh/site-functions
Installing /Users/alias/Downloads/m/Misc/projects/mpv/etc/mpv.desktop to /opt/Homebrew/share/applications
Installing /Users/alias/Downloads/m/Misc/projects/mpv/etc/mpv.metainfo.xml to /opt/Homebrew/share/metainfo
Installing /Users/alias/Downloads/m/Misc/projects/mpv/etc/encoding-profiles.conf to /opt/Homebrew/etc/mpv
Installing /Users/alias/Downloads/m/Misc/projects/mpv/etc/mpv-icon-8bit-16x16.png to /opt/Homebrew/share/icons/hicolor/16x16/apps
Installing /Users/alias/Downloads/m/Misc/projects/mpv/etc/mpv-icon-8bit-32x32.png to /opt/Homebrew/share/icons/hicolor/32x32/apps
Installing /Users/alias/Downloads/m/Misc/projects/mpv/etc/mpv-icon-8bit-64x64.png to /opt/Homebrew/share/icons/hicolor/64x64/apps
Installing /Users/alias/Downloads/m/Misc/projects/mpv/etc/mpv-icon-8bit-128x128.png to /opt/Homebrew/share/icons/hicolor/128x128/apps
Installing /Users/alias/Downloads/m/Misc/projects/mpv/etc/mpv-gradient.svg to /opt/Homebrew/share/icons/hicolor/scalable/apps
Installing /Users/alias/Downloads/m/Misc/projects/mpv/etc/mpv-symbolic.svg to /opt/Homebrew/share/icons/hicolor/symbolic/apps
(base) 
mpv on  tags/v0.36.0 via 🅒 base took 2s 
λ mpv                   
mpv 0.36.0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
 built on Fri Feb 09 06:41:21 2024
libplacebo version: v6.338.2
FFmpeg version: 6.1.1
FFmpeg library versions:
   libavutil       58.29.100
   libavcodec      60.31.102
   libavformat     60.16.100
   libswscale      7.5.100
   libavfilter     9.12.100
   libswresample   4.12.100

Usage:   mpv [options] [url|path/]filename

Basic options:
 --start=<time>    seek to given (percent, seconds, or hh:mm:ss) position
 --no-audio        do not play sound
 --no-video        do not play video
 --fs              fullscreen playback
 --sub-file=<file> specify subtitle file to use
 --playlist=<file> specify playlist file

 --list-options    list all mpv options
 --h=<string>      print options which contain the given string in their name

[1]    21540 bus error  mpv

@Akemi
Copy link
Member

Akemi commented Feb 9, 2024

@noahlias is that problem well reproducible on your end? can you build mpv yourself and could test a patch?

what mean? I build it manually and delete the homebrew version but it got the same error.

with "well reproducible" i mean something like always reproducible, sometimes reproducible, sporadically reproducible, etc. if it's well reproducible i would give you a patch to try. hence my second question if you are able to build yourself and could apply a patch for testing, to see if it fixes the problem.

patch for mpv master, though should work with older versions too.

diff --git a/osdep/macos/remote_command_center.swift b/osdep/macos/remote_command_center.swift
index 6fb2229f3a..eae2492b0b 100644
--- a/osdep/macos/remote_command_center.swift
+++ b/osdep/macos/remote_command_center.swift
@@ -111,8 +111,10 @@ class RemoteCommandCenter: NSObject {
             nowPlayingInfo[MPMediaItemPropertyArtwork] = albumArt
         }
 
-        mpInfoCenter.nowPlayingInfo = nowPlayingInfo
-        mpInfoCenter.playbackState = .playing
+        DispatchQueue.main.async {
+            self.mpInfoCenter.nowPlayingInfo = self.nowPlayingInfo
+            self.mpInfoCenter.playbackState = .playing
+        }
 
         NotificationCenter.default.addObserver(
             self,
@@ -128,8 +130,10 @@ class RemoteCommandCenter: NSObject {
             cmd.removeTarget(nil)
         }
 
-        mpInfoCenter.nowPlayingInfo = nil
-        mpInfoCenter.playbackState = .unknown
+        DispatchQueue.main.async {
+            self.mpInfoCenter.nowPlayingInfo = nil
+            self.mpInfoCenter.playbackState = .unknown
+        }
     }
 
     @objc func makeCurrent(notification: NSNotification) {

@noahlias
Copy link

@noahlias is that problem well reproducible on your end? can you build mpv yourself and could test a patch?

what mean? I build it manually and delete the homebrew version but it got the same error.

with "well reproducible" i mean something like always reproducible, sometimes reproducible, sporadically reproducible, etc. if it's well reproducible i would give you a patch to try. hence my second question if you are able to build yourself and could apply a patch for testing, to see if it fixes the problem.

patch for mpv master, though should work with older versions too.

diff --git a/osdep/macos/remote_command_center.swift b/osdep/macos/remote_command_center.swift
index 6fb2229f3a..eae2492b0b 100644
--- a/osdep/macos/remote_command_center.swift
+++ b/osdep/macos/remote_command_center.swift
@@ -111,8 +111,10 @@ class RemoteCommandCenter: NSObject {
             nowPlayingInfo[MPMediaItemPropertyArtwork] = albumArt
         }
 
-        mpInfoCenter.nowPlayingInfo = nowPlayingInfo
-        mpInfoCenter.playbackState = .playing
+        DispatchQueue.main.async {
+            self.mpInfoCenter.nowPlayingInfo = self.nowPlayingInfo
+            self.mpInfoCenter.playbackState = .playing
+        }
 
         NotificationCenter.default.addObserver(
             self,
@@ -128,8 +130,10 @@ class RemoteCommandCenter: NSObject {
             cmd.removeTarget(nil)
         }
 
-        mpInfoCenter.nowPlayingInfo = nil
-        mpInfoCenter.playbackState = .unknown
+        DispatchQueue.main.async {
+            self.mpInfoCenter.nowPlayingInfo = nil
+            self.mpInfoCenter.playbackState = .unknown
+        }
     }
 
     @objc func makeCurrent(notification: NSNotification) {

ok, it works, I modify it and rebuild the mpv binary.
image

the mpv -v --no-config works without the bus error
image

Thank you!

@llyyr
Copy link
Contributor

llyyr commented Feb 10, 2024

You didn't apply the diff correctly, not sure if it matters though. You can copy the diff then pbpaste | git apply to apply it

@noahlias
Copy link

noahlias commented Feb 10, 2024

You didn't apply the diff correctly, not sure if it matters though. You can copy the diff then pbpaste | git apply to apply it

Oh, I found the first two lines I didn't apply correctly,So I modified it and rebuilt it and it didn't work.
image

It comes to bus error
image

Perhaps my first unintentional operation succeeded?
I confirmed that pre-modified works.

        DispatchQueue.main.async {
            self.mpInfoCenter.nowPlayingInfo = nil
            self.mpInfoCenter.playbackState = .unknown
        }

        NotificationCenter.default.addObserver(
            self,
            selector: #selector(self.makeCurrent),
            name: NSApplication.willBecomeActiveNotification,
            object: nil
        )
    }

    @objc func stop() {
        for (cmd, _) in config {
            cmd.isEnabled = false
            cmd.removeTarget(nil)
        }

        DispatchQueue.main.async {
            self.mpInfoCenter.nowPlayingInfo = nil
            self.mpInfoCenter.playbackState = .unknown
        }
    }

@Akemi
Copy link
Member

Akemi commented Feb 10, 2024

yeah the first attempt worked because no nowPlayingInfo will ever be set to the InfoCenter, so it can't trigger the error. though you won't have any now nowPlayingInfo either.

i will look further into it.

@Akemi
Copy link
Member

Akemi commented Feb 10, 2024

would be nice if you could try this please.

i pushed a fix to my branch mac_remote_artwork
this commit Akemi@bae0e8a
or file https://github.com/Akemi/mpv/blob/bae0e8abd3afbe4e9b734d539aca3d4cce5c97b1/osdep/macos/remote_command_center.swift

alternatively also this patch:

diff --git a/osdep/macos/remote_command_center.swift b/osdep/macos/remote_command_center.swift
index 6fb2229f3a..364d031a94 100644
--- a/osdep/macos/remote_command_center.swift
+++ b/osdep/macos/remote_command_center.swift
@@ -87,10 +87,15 @@ class RemoteCommandCenter: NSObject {
 
     var mpInfoCenter: MPNowPlayingInfoCenter { get { return MPNowPlayingInfoCenter.default() } }
     var isPaused: Bool = false { didSet { updatePlaybackState() } }
+    var cover: NSImage?
 
     @objc override init() {
         super.init()
 
+        if let app = NSApp as? Application, let icon = app.getMPVIcon() {
+            cover = icon.copy() as? NSImage
+        }
+
         for cmd in disabledCommands {
             cmd.isEnabled = false
         }
@@ -104,7 +109,7 @@ class RemoteCommandCenter: NSObject {
             }
         }
 
-        if let app = NSApp as? Application, let icon = app.getMPVIcon() {
+        if let icon = cover {
             let albumArt = MPMediaItemArtwork(boundsSize: icon.size) { _ in
                 return icon
             }

@noahlias
Copy link

Akemi/mpv@bae0e8a/osdep/macos/remote_command_center.swift

I modify it with the new patch and the same error.
image

and the error
image

the trace
image

@Akemi
Copy link
Member

Akemi commented Feb 10, 2024

too bad. sry i need some more testing in this case. pushed something to the same branch again with terminal test outputs.

commit Akemi@852056b
file https://github.com/Akemi/mpv/blob/852056b582099fcef195ab9008926828e9d82a45/osdep/macos/remote_command_center.swift
patch https://github.com/Akemi/mpv/commit/852056b582099fcef195ab9008926828e9d82a45.patch

could you please test with the patch as is and show me the terminal output when it crashes.
after that, test with the same patch and give me the terminal output, but please swap those https://github.com/Akemi/mpv/blob/852056b582099fcef195ab9008926828e9d82a45/osdep/macos/remote_command_center.swift#L112-L113 two lines, eg comment return icon (line 112) and remove the comment from //return NSImage(named: NSImage.trashFullName)! (line 113). the block should look like this afterwards:

            let albumArt = MPMediaItemArtwork(boundsSize: icon.size) { _ in
                print("----- MPMediaItemArtwork \(Thread.current) \(OperationQueue.current?.underlyingQueue?.label ?? "None")")
                //return icon
                return NSImage(named: NSImage.trashFullName)!
            }

also wondering if the second test will also crash.

@noahlias
Copy link

noahlias commented Feb 10, 2024

too bad. sry i need some more testing in this case. pushed something to the same branch again with terminal test outputs.

commit Akemi@852056b file Akemi/mpv@852056b/osdep/macos/remote_command_center.swift patch Akemi/mpv@852056b.patch

could you please test with the patch as is and show me the terminal output when it crashes. after that, test with the same patch and give me the terminal output, but please swap those Akemi/mpv@852056b/osdep/macos/remote_command_center.swift#L112-L113 two lines, eg comment return icon (line 112) and remove the comment from //return NSImage(named: NSImage.trashFullName)! (line 113). the block should look like this afterwards:

            let albumArt = MPMediaItemArtwork(boundsSize: icon.size) { _ in
                print("----- MPMediaItemArtwork \(Thread.current) \(OperationQueue.current?.underlyingQueue?.label ?? "None")")
                //return icon
                return NSImage(named: NSImage.trashFullName)!
            }

also wondering if the second test will also crash.

The first compile.

λ ./build/mpv --no-config
----- start <NSThread: 0x60000184a500>{number = 2, name = (null)} None
----- start update info
----- start end
----- MPMediaItemArtwork <NSThread: 0x6000018454c0>{number = 3, name = (null)} None
mpv v0.37.0-dirty Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
 built on Feb 11 2024 07:54:51
libplacebo version: v6.338.2
FFmpeg version: 6.1.1
FFmpeg library versions:
   libavutil       58.29.100
   libavcodec      60.31.102
   libavformat     60.16.100
   libswscale      7.5.100
   libavfilter     9.12.100
   libswresample   4.12.100

Usage:   mpv [options] [url|path/]filename

Basic options:
 --start=<time>    seek to given (percent, seconds, or hh:mm:ss) position
 --no-audio        do not play sound
 --no-video        do not play video
 --fs              fullscreen playback
 --sub-file=<file> specify subtitle file to use
 --playlist=<file> specify playlist file

 --list-options    list all mpv options
 --h=<string>      print options which contain the given string in their name

[1]    10557 bus error  ./build/mpv --no-config

The second compile.

mpv on  tags/v0.37.0 [!?] via 🅒 base took 13s
λ ./build/mpv --no-config
----- start <NSThread: 0x60000310da80>{number = 2, name = (null)} None
----- start update info
----- start end
----- MPMediaItemArtwork <NSThread: 0x600003101040>{number = 3, name = (null)} None
mpv v0.37.0-dirty Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
 built on Feb 11 2024 07:52:18
libplacebo version: v6.338.2
FFmpeg version: 6.1.1
FFmpeg library versions:
   libavutil       58.29.100
   libavcodec      60.31.102
   libavformat     60.16.100
   libswscale      7.5.100
   libavfilter     9.12.100
   libswresample   4.12.100

Usage:   mpv [options] [url|path/]filename

Basic options:
 --start=<time>    seek to given (percent, seconds, or hh:mm:ss) position
 --no-audio        do not play sound
 --no-video        do not play video
 --fs              fullscreen playback
 --sub-file=<file> specify subtitle file to use
 --playlist=<file> specify playlist file

 --list-options    list all mpv options
 --h=<string>      print options which contain the given string in their name

----- stop <NSThread: 0x60000310da80>{number = 2, name = (null)} None
----- stop end

the second play video also bus error

image

@Akemi
Copy link
Member

Akemi commented Feb 11, 2024

so the second one, eg the patch plus the adjustment to use return NSImage(named: NSImage.trashFullName)! also results in a bus error, but only if you play a file?

could you post the backtrace for the second compile while trying to play a video please? wondering if it still fails at the same place.

@noahlias
Copy link

noahlias commented Feb 11, 2024

Reference in new issue

Yeah, the mpv --no-config does not reduce the bus error but plays video bus error.
image

(lldb) target create "./build/mpv"
Current executable set to '/Users/alias/Downloads/m/Misc/projects/mpv/build/mpv' (arm64).
(lldb) run update_math.mp4 --no-config
Process 84093 launched: '/Users/alias/Downloads/m/Misc/projects/mpv/build/mpv' (arm64)
----- start <NSThread: 0x600000842840>{number = 2, name = (null)} None
----- start update info
----- start end
----- MPMediaItemArtwork <NSThread: 0x600000842bc0>{number = 3, name = (null)} None
Process 84093 stopped
* thread #2, queue = 'com.apple.MediaPlayer.MPNowPlayingInfoCenter/accessQueue', stop reason = EXC_BAD_ACCESS (code=257, address=0xbad4007)
    frame #0: 0x000000000bad4007
error: memory read failed for 0xbad4007
(lldb) thread backtrace all
  thread #1, queue = 'com.apple.main-thread'
    frame #0: 0x0000000185349874 libsystem_kernel.dylib`mach_msg2_trap + 8
    frame #1: 0x000000018535bcf0 libsystem_kernel.dylib`mach_msg2_internal + 80
    frame #2: 0x0000000188ac65fc IOKit`io_service_add_notification_bin + 488
    frame #3: 0x0000000188ac6380 IOKit`InternalIOServiceAddNotification + 272
    frame #4: 0x0000000188ac6248 IOKit`IOServiceAddMatchingNotification + 64
    frame #5: 0x000000018f64f7c8 Metal`MTLIOAccelServiceGetMatchingServices + 168
    frame #6: 0x000000018f64fcec Metal`MTLRegisterDevices + 116
    frame #7: 0x000000018f52b8b4 Metal`invocation function for block in MTLDeviceArrayInitialize() + 1300
    frame #8: 0x00000001851d8910 libdispatch.dylib`_dispatch_client_callout + 20
    frame #9: 0x00000001851da14c libdispatch.dylib`_dispatch_once_callout + 32
    frame #10: 0x000000018f501a24 Metal`MTLCopyAllDevices + 244
    frame #11: 0x00000001093ae118 AppleMetalOpenGLRenderer`GLDDeviceRec::initWithDisplayMask(unsigned int) + 140
    frame #12: 0x00000001093b39a4 AppleMetalOpenGLRenderer`gldCreateDevice + 72
    frame #13: 0x00000001edb993b0 libGFXShared.dylib`gfxInitializeLibrary + 1900
    frame #14: 0x00000001edd7ae00 GLEngine`gliInitializeLibrary + 28
    frame #15: 0x00000001edb863d0 OpenGL`___lldb_unnamed_symbol298 + 156
    frame #16: 0x00000001edb8627c OpenGL`___lldb_unnamed_symbol297 + 116
    frame #17: 0x00000001edb86058 OpenGL`___lldb_unnamed_symbol295 + 156
    frame #18: 0x00000001edb8d774 OpenGL`___lldb_unnamed_symbol343 + 2736
    frame #19: 0x00000001edb8cbf0 OpenGL`CGLChoosePixelFormat + 100
    frame #20: 0x0000000100032250 mpv`$s11macOS_swift7GLLayerC15findPixelFormat_8softwares13OpaquePointerVSg_s5Int32VSo9_CGLErrorVtAA7CocoaCBC_SbtFZTf4nnd_n at gl_layer.swift:283:23
    frame #21: 0x0000000100032998 mpv`$s11macOS_swift7GLLayerC17createPixelFormatys13OpaquePointerV_s5Int32VtAA7CocoaCBCFZTf4nd_n at <compiler-generated>:0
    frame #22: 0x0000000100021578 mpv`$s11macOS_swift7GLLayerC7cocoaCBAcA05CocoaF0C_tcfc at <compiler-generated>:0
    frame #23: 0x000000010001fad4 mpv`$s11macOS_swift7CocoaCBCyACs13OpaquePointerVcfc at gl_layer.swift:0
    frame #24: 0x000000010001fb18 mpv`$s11macOS_swift7CocoaCBCyACs13OpaquePointerVcfcTo at <compiler-generated>:0
    frame #25: 0x000000010010a9d0 mpv`-[Application setMpvHandle:](self=<unavailable>, _cmd=<unavailable>, ctx=<unavailable>) at macosx_application.m:189:23 [opt]
    frame #26: 0x00000001851d8910 libdispatch.dylib`_dispatch_client_callout + 20
    frame #27: 0x00000001851e7d9c libdispatch.dylib`_dispatch_async_and_wait_invoke + 92
    frame #28: 0x00000001851d8910 libdispatch.dylib`_dispatch_client_callout + 20
    frame #29: 0x00000001851e6fa8 libdispatch.dylib`_dispatch_main_queue_drain + 984
    frame #30: 0x00000001851e6bc0 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 44
    frame #31: 0x00000001854a8ea4 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
    frame #32: 0x0000000185466760 CoreFoundation`__CFRunLoopRun + 1996
    frame #33: 0x000000018546593c CoreFoundation`CFRunLoopRunSpecific + 608
    frame #34: 0x000000018fa2e448 HIToolbox`RunCurrentEventLoopInMode + 292
    frame #35: 0x000000018fa2e284 HIToolbox`ReceiveNextEventCommon + 648
    frame #36: 0x000000018fa2dfdc HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 76
    frame #37: 0x0000000188c44ed0 AppKit`_DPSNextEvent + 660
    frame #38: 0x000000018942feec AppKit`-[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
    frame #39: 0x0000000188c3837c AppKit`-[NSApplication run] + 476
    frame #40: 0x000000010010af14 mpv`cocoa_main [inlined] cocoa_run_runloop at macosx_application.m:269:5 [opt]
    frame #41: 0x000000010010aefc mpv`cocoa_main(argc=<unavailable>, argv=<unavailable>) at macosx_application.m:365:9 [opt]
    frame #42: 0x00000001850090e0 dyld`start + 2360
* thread #2, queue = 'com.apple.MediaPlayer.MPNowPlayingInfoCenter/accessQueue', stop reason = EXC_BAD_ACCESS (code=257, address=0xbad4007)
  * frame #0: 0x000000000bad4007
    frame #1: 0x000000018fdb0d60 ImageIO`invocation function for block in SetupTIFFErrorHandler() + 20
    frame #2: 0x00000001851d8910 libdispatch.dylib`_dispatch_client_callout + 20
    frame #3: 0x00000001851da14c libdispatch.dylib`_dispatch_once_callout + 32
    frame #4: 0x000000018fd1c5dc ImageIO`TIFFWritePlugin::writeAll() + 80
    frame #5: 0x000000018fd1c544 ImageIO`IIO_Writer_TIFF::write(void*, void*) + 48
    frame #6: 0x000000018fe0ac94 ImageIO`IIOImageDestination::finalizeDestination() + 896
    frame #7: 0x000000018fd1c34c ImageIO`CGImageDestinationFinalize + 180
    frame #8: 0x0000000188e49a40 AppKit`+[NSBitmapImageRep(NSBitmapImageFileTypeExtensions) representationOfImageRepsInArray:usingType:properties:] + 1832
    frame #9: 0x0000000188e487a0 AppKit`-[NSImage TIFFRepresentationUsingCompression:factor:] + 216
    frame #10: 0x00000001ab7972a4 MediaPlayer`MPArtworkImageJPEGRepresentation + 60
    frame #11: 0x00000001ab6bcf44 MediaPlayer`-[MPMediaItemArtwork jpegDataWithSize:] + 48
    frame #12: 0x00000001ab745848 MediaPlayer`___MPToMRNowPlayingInfoDictionary_block_invoke + 288
    frame #13: 0x0000000194f8b560 libswiftCore.dylib`$ss26_SwiftDeferredNSDictionaryC23enumerateKeysAndObjects7options5usingySi_ys9UnmanagedVyyXlG_AHSpys5UInt8VGtXBtFTf4dnn_n + 580
    frame #14: 0x0000000194d19940 libswiftCore.dylib`$ss26_SwiftDeferredNSDictionaryC23enumerateKeysAndObjects7options5usingySi_ys9UnmanagedVyyXlG_AHSpys5UInt8VGtXBtFTo + 48
    frame #15: 0x00000001ab7455b4 MediaPlayer`_MPToMRNowPlayingInfoDictionary + 200
    frame #16: 0x00000001ab745310 MediaPlayer`-[MPNowPlayingInfoCenter(NowPlayingInfo) _onQueue_pushNowPlayingInfoAndRetry:] + 268
    frame #17: 0x00000001851d6cb8 libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame #18: 0x00000001851d8910 libdispatch.dylib`_dispatch_client_callout + 20
    frame #19: 0x00000001851dfea4 libdispatch.dylib`_dispatch_lane_serial_drain + 748
    frame #20: 0x00000001851e09d4 libdispatch.dylib`_dispatch_lane_invoke + 380
    frame #21: 0x00000001851eb61c libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 288
    frame #22: 0x00000001851eae90 libdispatch.dylib`_dispatch_workloop_worker_thread + 404
    frame #23: 0x0000000185386114 libsystem_pthread.dylib`_pthread_wqthread + 288
  thread #3
    frame #0: 0x000000018534b524 libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #4, name = 'mpv'
    frame #0: 0x000000018534b62c libsystem_kernel.dylib`__ulock_wait + 8
    frame #1: 0x00000001851d9300 libdispatch.dylib`_dlock_wait + 56
    frame #2: 0x00000001851d90b4 libdispatch.dylib`_dispatch_thread_event_wait_slow + 56
    frame #3: 0x00000001851e7fb0 libdispatch.dylib`__DISPATCH_WAIT_FOR_QUEUE__ + 368
    frame #4: 0x00000001851e7b5c libdispatch.dylib`_dispatch_sync_f_slow + 148
    frame #5: 0x000000010010b46c mpv`-[EventsResponder setMpvHandle:](self=<unavailable>, _cmd=<unavailable>, ctx=<unavailable>) at macosx_events.m:250:9 [opt]
    frame #6: 0x000000010010b10c mpv`cocoa_set_mpv_handle(ctx=0x000000014272c130) at macosx_events.m:156:9 [opt]
    frame #7: 0x00000001000b59f8 mpv`mp_initialize(mpctx=0x0000000142820850, options=0x000000016fdfc350) at main.c:393:5 [opt]
    frame #8: 0x00000001000b5b74 mpv`mpv_main(argc=<unavailable>, argv=<unavailable>) at main.c:430:13 [opt]
    frame #9: 0x000000010010af94 mpv`playback_thread(ctx_obj=0x000000016fdfc0a0) at macosx_application.m:278:17 [opt]
    frame #10: 0x000000018538a034 libsystem_pthread.dylib`_pthread_start + 136
  thread #5
    frame #0: 0x000000018534b524 libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #6
    frame #0: 0x000000018534b524 libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #7
    frame #0: 0x0000000185384e28 libsystem_pthread.dylib`start_wqthread
  thread #8, name = 'terminal/input'
    frame #0: 0x00000001853549d4 libsystem_kernel.dylib`__select + 8
    frame #1: 0x000000010010fdd8 mpv`polldev(fds=<unavailable>, nfds=2, timeout=1000) at poll_wrapper.c:70:13 [opt]
    frame #2: 0x0000000100110158 mpv`terminal_thread(ptr=<unavailable>) at terminal-unix.c:430:17 [opt]
    frame #3: 0x000000018538a034 libsystem_pthread.dylib`_pthread_start + 136
  thread #9, name = 'lua/osc'
    frame #0: 0x000000018534d06c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x000000018538a5fc libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000100086294 mpv`mp_dispatch_lock [inlined] mp_cond_wait(cond=0x0000000142608db0, mutex=0x0000000142608d70) at threads-posix.h:181:12 [opt]
    frame #3: 0x0000000100086288 mpv`mp_dispatch_lock(queue=0x0000000142608d60) at dispatch.c:386:9 [opt]
    frame #4: 0x000000010009de14 mpv`mpv_get_property [inlined] run_locked(ctx=0x0000000142725ad0, fn=<unavailable>, fn_data=0x000000017025a6e8) at client.c:1062:5 [opt]
    frame #5: 0x000000010009de0c mpv`mpv_get_property(ctx=0x0000000142725ad0, name=<unavailable>, format=<unavailable>, data=<unavailable>) at client.c:1488:5 [opt]
    frame #6: 0x000000010011792c mpv`script_get_property_native(L=0x00000001006f8380, tmp=0x0000600003e740a0) at lua.c:924:15 [opt]
    frame #7: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #8: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #9: 0x0000000100116df4 mpv`script_autofree_trampoline(L=0x00000001006f8380) at lua.c:1286:13 [opt]
    frame #10: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #11: 0x0000000100116808 mpv`load_builtin(L=0x00000001006f8380) at lua.c:273:13 [opt]
    frame #12: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #13: 0x0000000101219624 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1425 + 528
    frame #14: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #15: 0x0000000100119494 mpv`require(L=0x00000001006f8380, name="@osc.lua") at lua.c:291:5 [opt]
    frame #16: 0x0000000100116b24 mpv`load_scripts(L=0x00000001006f8380) at lua.c:319:9 [opt]
    frame #17: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #18: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #19: 0x000000010011655c mpv`run_lua(L=0x00000001006f8380) at lua.c:429:9 [opt]
    frame #20: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #21: 0x00000001011d6b34 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #22: 0x0000000100116068 mpv`load_lua(args=<unavailable>) at lua.c:470:9 [opt]
    frame #23: 0x00000001000bd914 mpv`run_script(arg=0x0000600003346650) at scripting.c:92:9 [opt]
    frame #24: 0x00000001000bd964 mpv`script_thread(p=<unavailable>) at scripting.c:102:5 [opt]
    frame #25: 0x000000018538a034 libsystem_pthread.dylib`_pthread_start + 136
  thread #10, name = 'lua/ytdl_hook'
    frame #0: 0x000000018534d06c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x000000018538a5fc libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000100086294 mpv`mp_dispatch_lock [inlined] mp_cond_wait(cond=0x0000000142608db0, mutex=0x0000000142608d70) at threads-posix.h:181:12 [opt]
    frame #3: 0x0000000100086288 mpv`mp_dispatch_lock(queue=0x0000000142608d60) at dispatch.c:386:9 [opt]
    frame #4: 0x000000010009de14 mpv`mpv_get_property [inlined] run_locked(ctx=0x0000000142725d00, fn=<unavailable>, fn_data=0x00000001702e66e8) at client.c:1062:5 [opt]
    frame #5: 0x000000010009de0c mpv`mpv_get_property(ctx=0x0000000142725d00, name=<unavailable>, format=<unavailable>, data=<unavailable>) at client.c:1488:5 [opt]
    frame #6: 0x000000010011792c mpv`script_get_property_native(L=0x0000000100718380, tmp="/System/Library/Input Methods/50onPaletteServer.app") at lua.c:924:15 [opt]
    frame #7: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #8: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #9: 0x0000000100116df4 mpv`script_autofree_trampoline(L=0x0000000100718380) at lua.c:1286:13 [opt]
    frame #10: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #11: 0x0000000100116808 mpv`load_builtin(L=0x0000000100718380) at lua.c:273:13 [opt]
    frame #12: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #13: 0x0000000101219624 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1425 + 528
    frame #14: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #15: 0x0000000100119494 mpv`require(L=0x0000000100718380, name="@ytdl_hook.lua") at lua.c:291:5 [opt]
    frame #16: 0x0000000100116b24 mpv`load_scripts(L=0x0000000100718380) at lua.c:319:9 [opt]
    frame #17: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #18: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #19: 0x000000010011655c mpv`run_lua(L=0x0000000100718380) at lua.c:429:9 [opt]
    frame #20: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #21: 0x00000001011d6b34 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #22: 0x0000000100116068 mpv`load_lua(args=<unavailable>) at lua.c:470:9 [opt]
    frame #23: 0x00000001000bd914 mpv`run_script(arg=0x0000600003346f50) at scripting.c:92:9 [opt]
    frame #24: 0x00000001000bd964 mpv`script_thread(p=<unavailable>) at scripting.c:102:5 [opt]
    frame #25: 0x000000018538a034 libsystem_pthread.dylib`_pthread_start + 136
  thread #11, name = 'lua/stats'
    frame #0: 0x000000018534d06c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x000000018538a5fc libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000100086294 mpv`mp_dispatch_lock [inlined] mp_cond_wait(cond=0x0000000142608db0, mutex=0x0000000142608d70) at threads-posix.h:181:12 [opt]
    frame #3: 0x0000000100086288 mpv`mp_dispatch_lock(queue=0x0000000142608d60) at dispatch.c:386:9 [opt]
    frame #4: 0x000000010009de14 mpv`mpv_get_property [inlined] run_locked(ctx=0x0000000142725f30, fn=<unavailable>, fn_data=0x00000001703726e8) at client.c:1062:5 [opt]
    frame #5: 0x000000010009de0c mpv`mpv_get_property(ctx=0x0000000142725f30, name=<unavailable>, format=<unavailable>, data=<unavailable>) at client.c:1488:5 [opt]
    frame #6: 0x000000010011792c mpv`script_get_property_native(L=0x0000000100738380, tmp=0x0000600003e74190) at lua.c:924:15 [opt]
    frame #7: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #8: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #9: 0x0000000100116df4 mpv`script_autofree_trampoline(L=0x0000000100738380) at lua.c:1286:13 [opt]
    frame #10: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #11: 0x0000000100116808 mpv`load_builtin(L=0x0000000100738380) at lua.c:273:13 [opt]
    frame #12: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #13: 0x0000000101219624 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1425 + 528
    frame #14: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #15: 0x0000000100119494 mpv`require(L=0x0000000100738380, name="@stats.lua") at lua.c:291:5 [opt]
    frame #16: 0x0000000100116b24 mpv`load_scripts(L=0x0000000100738380) at lua.c:319:9 [opt]
    frame #17: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #18: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #19: 0x000000010011655c mpv`run_lua(L=0x0000000100738380) at lua.c:429:9 [opt]
    frame #20: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #21: 0x00000001011d6b34 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #22: 0x0000000100116068 mpv`load_lua(args=<unavailable>) at lua.c:470:9 [opt]
    frame #23: 0x00000001000bd914 mpv`run_script(arg=0x0000600003347050) at scripting.c:92:9 [opt]
    frame #24: 0x00000001000bd964 mpv`script_thread(p=<unavailable>) at scripting.c:102:5 [opt]
    frame #25: 0x000000018538a034 libsystem_pthread.dylib`_pthread_start + 136
  thread #12, name = 'lua/console'
    frame #0: 0x000000018534d06c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x000000018538a5fc libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000100086294 mpv`mp_dispatch_lock [inlined] mp_cond_wait(cond=0x0000000142608db0, mutex=0x0000000142608d70) at threads-posix.h:181:12 [opt]
    frame #3: 0x0000000100086288 mpv`mp_dispatch_lock(queue=0x0000000142608d60) at dispatch.c:386:9 [opt]
    frame #4: 0x000000010009de14 mpv`mpv_get_property [inlined] run_locked(ctx=0x000000014272bcd0, fn=<unavailable>, fn_data=0x00000001703fe6e8) at client.c:1062:5 [opt]
    frame #5: 0x000000010009de0c mpv`mpv_get_property(ctx=0x000000014272bcd0, name=<unavailable>, format=<unavailable>, data=<unavailable>) at client.c:1488:5 [opt]
    frame #6: 0x000000010011792c mpv`script_get_property_native(L=0x0000000100778380, tmp=0x0000600003e5ac10) at lua.c:924:15 [opt]
    frame #7: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #8: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #9: 0x0000000100116df4 mpv`script_autofree_trampoline(L=0x0000000100778380) at lua.c:1286:13 [opt]
    frame #10: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #11: 0x0000000100116808 mpv`load_builtin(L=0x0000000100778380) at lua.c:273:13 [opt]
    frame #12: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #13: 0x0000000101219624 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1425 + 528
    frame #14: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #15: 0x0000000100119494 mpv`require(L=0x0000000100778380, name="@console.lua") at lua.c:291:5 [opt]
    frame #16: 0x0000000100116b24 mpv`load_scripts(L=0x0000000100778380) at lua.c:319:9 [opt]
    frame #17: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #18: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #19: 0x000000010011655c mpv`run_lua(L=0x0000000100778380) at lua.c:429:9 [opt]
    frame #20: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #21: 0x00000001011d6b34 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #22: 0x0000000100116068 mpv`load_lua(args=<unavailable>) at lua.c:470:9 [opt]
    frame #23: 0x00000001000bd914 mpv`run_script(arg=0x00006000033471d0) at scripting.c:92:9 [opt]
    frame #24: 0x00000001000bd964 mpv`script_thread(p=<unavailable>) at scripting.c:102:5 [opt]
    frame #25: 0x000000018538a034 libsystem_pthread.dylib`_pthread_start + 136
  thread #13, name = 'lua/auto_profiles'
    frame #0: 0x000000018534d06c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x000000018538a5fc libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000100086294 mpv`mp_dispatch_lock [inlined] mp_cond_wait(cond=0x0000000142608db0, mutex=0x0000000142608d70) at threads-posix.h:181:12 [opt]
    frame #3: 0x0000000100086288 mpv`mp_dispatch_lock(queue=0x0000000142608d60) at dispatch.c:386:9 [opt]
    frame #4: 0x000000010009de14 mpv`mpv_get_property [inlined] run_locked(ctx=0x000000014272bf00, fn=<unavailable>, fn_data=0x000000017048a6e8) at client.c:1062:5 [opt]
    frame #5: 0x000000010009de0c mpv`mpv_get_property(ctx=0x000000014272bf00, name=<unavailable>, format=<unavailable>, data=<unavailable>) at client.c:1488:5 [opt]
    frame #6: 0x000000010011792c mpv`script_get_property_native(L=0x0000000100758380, tmp=0x0000600003e40550) at lua.c:924:15 [opt]
    frame #7: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #8: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #9: 0x0000000100116df4 mpv`script_autofree_trampoline(L=0x0000000100758380) at lua.c:1286:13 [opt]
    frame #10: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #11: 0x0000000100116808 mpv`load_builtin(L=0x0000000100758380) at lua.c:273:13 [opt]
    frame #12: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #13: 0x0000000101219624 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1425 + 528
    frame #14: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #15: 0x0000000100119494 mpv`require(L=0x0000000100758380, name="@auto_profiles.lua") at lua.c:291:5 [opt]
    frame #16: 0x0000000100116b24 mpv`load_scripts(L=0x0000000100758380) at lua.c:319:9 [opt]
    frame #17: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #18: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #19: 0x000000010011655c mpv`run_lua(L=0x0000000100758380) at lua.c:429:9 [opt]
    frame #20: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #21: 0x00000001011d6b34 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #22: 0x0000000100116068 mpv`load_lua(args=<unavailable>) at lua.c:470:9 [opt]
    frame #23: 0x00000001000bd914 mpv`run_script(arg=0x00006000033472d0) at scripting.c:92:9 [opt]
    frame #24: 0x00000001000bd964 mpv`script_thread(p=<unavailable>) at scripting.c:102:5 [opt]
    frame #25: 0x000000018538a034 libsystem_pthread.dylib`_pthread_start + 136
  thread #14, name = 'com.apple.NSEventThread'
    frame #0: 0x0000000185349874 libsystem_kernel.dylib`mach_msg2_trap + 8
    frame #1: 0x000000018535bcf0 libsystem_kernel.dylib`mach_msg2_internal + 80
    frame #2: 0x00000001853524b0 libsystem_kernel.dylib`mach_msg_overwrite + 476
    frame #3: 0x0000000185349bf8 libsystem_kernel.dylib`mach_msg + 24
    frame #4: 0x0000000185467b84 CoreFoundation`__CFRunLoopServiceMachPort + 160
    frame #5: 0x000000018546644c CoreFoundation`__CFRunLoopRun + 1208
    frame #6: 0x000000018546593c CoreFoundation`CFRunLoopRunSpecific + 608
    frame #7: 0x0000000188d6e160 AppKit`_NSEventThread + 144
    frame #8: 0x000000018538a034 libsystem_pthread.dylib`_pthread_start + 136

@Akemi
Copy link
Member

Akemi commented Feb 11, 2024

sry another round another test. could you please try this change.
commit Akemi@9c8cbe7
file https://github.com/Akemi/mpv/blob/9c8cbe7232cfac17579784959a88bb33af77dde9/osdep/macos/remote_command_center.swift
patch https://github.com/Akemi/mpv/commit/9c8cbe7232cfac17579784959a88bb33af77dde9.patch

i am interested in the terminal output again and in the case of a crash the whole backtrace again please.

@noahlias
Copy link

Akemi/mpv@9c8cbe7/osdep/macos/remote_command_center.swift

terminal output:
image

mpv on  tags/v0.37.0 [!?] via 🅒 base 
λ lldb                                   
(lldb) target create './build/mpv'
Current executable set to '/Users/alias/Downloads/m/Misc/projects/mpv/build/mpv' (arm64).
(lldb) run update_math.mp4 --no-config
Process 44559 launched: '/Users/alias/Downloads/m/Misc/projects/mpv/build/mpv' (arm64)
----- start <NSThread: 0x600001f03180>{number = 2, name = (null)} None
----- start update info
----- start end
----- MPMediaItemArtwork (256.0, 256.0) <NSThread: 0x600001f0e8c0>{number = 3, name = (null)} None
----- MPMediaItemArtwork1 <NSImage 0x600003b34460 Size={256, 256} RepProvider=<NSImageArrayRepProvider: 0x60000081c8c0, reps:(
    "NSBitmapImageRep 0x600002107cd0 Size={256, 256} ColorSpace=(not yet loaded) BPS=8 BPP=(not yet loaded) Pixels=512x512 Alpha=YES Planar=NO Format=(not yet loaded) CurrentBacking=nil (faulting) CGImageSource=0x600000a3d120",
    "NSBitmapImageRep 0x60000211a760 Size={512, 512} ColorSpace=(not yet loaded) BPS=8 BPP=(not yet loaded) Pixels=512x512 Alpha=YES Planar=NO Format=(not yet loaded) CurrentBacking=nil (faulting) CGImageSource=0x600000a3d120",
    "NSBitmapImageRep 0x60000211a920 Size={128, 128} ColorSpace=(not yet loaded) BPS=8 BPP=(not yet loaded) Pixels=256x256 Alpha=YES Planar=NO Format=(not yet loaded) CurrentBacking=nil (faulting) CGImageSource=0x600000a3d120",
    "NSBitmapImageRep 0x60000211aae0 Size={256, 256} ColorSpace=(not yet loaded) BPS=8 BPP=(not yet loaded) Pixels=256x256 Alpha=YES Planar=NO Format=(not yet loaded) CurrentBacking=nil (faulting) CGImageSource=0x600000a3d120",
    "NSBitmapImageRep 0x60000211aca0 Size={128, 128} ColorSpace=(not yet loaded) BPS=8 BPP=(not yet loaded) Pixels=128x128 Alpha=YES Planar=NO Format=(not yet loaded) CurrentBacking=nil (faulting) CGImageSource=0x600000a3d120",
    "NSBitmapImageRep 0x60000211ae60 Size={32, 32} ColorSpace=(not yet loaded) BPS=8 BPP=(not yet loaded) Pixels=64x64 Alpha=YES Planar=NO Format=(not yet loaded) CurrentBacking=nil (faulting) CGImageSource=0x600000a3d120",
    "NSBitmapImageRep 0x60000211b020 Size={16, 16} ColorSpace=(not yet loaded) BPS=8 BPP=(not yet loaded) Pixels=32x32 Alpha=YES Planar=NO Format=(not yet loaded) CurrentBacking=nil (faulting) CGImageSource=0x600000a3d120",
    "NSBitmapImageRep 0x60000211b170 Size={32, 32} ColorSpace=(not yet loaded) BPS=8 BPP=(not yet loaded) Pixels=32x32 Alpha=YES Planar=NO Format=(not yet loaded) CurrentBacking=nil (faulting) CGImageSource=0x600000a3d120",
    "NSBitmapImageRep 0x60000211b330 Size={16, 16} ColorSpace=(not yet loaded) BPS=8 BPP=(not yet loaded) Pixels=16x16 Alpha=YES Planar=NO Format=(not yet loaded) CurrentBacking=nil (faulting) CGImageSource=0x600000a3d120"
)>>
----- MPMediaItemArtwork2 <NSImage 0x600003b1dcc0 Size={256, 256} RepProvider=<NSImageArrayRepProvider: 0x6000008112a0, reps:(
    "NSCustomImageRep 0x6000029056d0 Size={256, 256} ColorSpace=Generic RGB colorspace BPS=0 Pixels=0x0 Alpha=NO AppearanceName=(null)"
)>>
----- MPMediaItemArtwork0 (0.0, 0.0, 256.0, 256.0)
----- MPMediaItemArtwork0 (0.0, 0.0, 256.0, 256.0)
----- MPMediaItemArtwork0 (0.0, 0.0, 256.0, 256.0)
Process 44559 stopped
* thread #2, queue = 'com.apple.MediaPlayer.MPNowPlayingInfoCenter/accessQueue', stop reason = EXC_BAD_ACCESS (code=257, address=0xbad4007)
    frame #0: 0x000000000bad4007
error: memory read failed for 0xbad4007

backtrace:

(lldb) thread backtrace all
  thread #1, queue = 'com.apple.main-thread'
    frame #0: 0x000000019022c690 HIToolbox`UpdateSourceIndicatorMode + 76
    frame #1: 0x000000019022bf80 HIToolbox`InitTSMFirstEventTime + 852
    frame #2: 0x000000019022a8bc HIToolbox`_FirstEventTime + 1020
    frame #3: 0x000000019022a364 HIToolbox`RunCurrentEventLoopInMode + 64
    frame #4: 0x000000019022a0d8 HIToolbox`ReceiveNextEventCommon + 220
    frame #5: 0x0000000190229fdc HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 76
    frame #6: 0x0000000189440ed0 AppKit`_DPSNextEvent + 660
    frame #7: 0x0000000189c2beec AppKit`-[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
    frame #8: 0x000000018943437c AppKit`-[NSApplication run] + 476
    frame #9: 0x000000010010adc4 mpv`cocoa_main [inlined] cocoa_run_runloop at macosx_application.m:269:5 [opt]
    frame #10: 0x000000010010adac mpv`cocoa_main(argc=<unavailable>, argv=<unavailable>) at macosx_application.m:365:9 [opt]
    frame #11: 0x00000001858050e0 dyld`start + 2360
* thread #2, queue = 'com.apple.MediaPlayer.MPNowPlayingInfoCenter/accessQueue', stop reason = EXC_BAD_ACCESS (code=257, address=0xbad4007)
  * frame #0: 0x000000000bad4007
    frame #1: 0x00000001905acd60 ImageIO`invocation function for block in SetupTIFFErrorHandler() + 20
    frame #2: 0x00000001859d4910 libdispatch.dylib`_dispatch_client_callout + 20
    frame #3: 0x00000001859d614c libdispatch.dylib`_dispatch_once_callout + 32
    frame #4: 0x00000001905185dc ImageIO`TIFFWritePlugin::writeAll() + 80
    frame #5: 0x0000000190518544 ImageIO`IIO_Writer_TIFF::write(void*, void*) + 48
    frame #6: 0x0000000190606c94 ImageIO`IIOImageDestination::finalizeDestination() + 896
    frame #7: 0x000000019051834c ImageIO`CGImageDestinationFinalize + 180
    frame #8: 0x0000000189645a40 AppKit`+[NSBitmapImageRep(NSBitmapImageFileTypeExtensions) representationOfImageRepsInArray:usingType:properties:] + 1832
    frame #9: 0x00000001896447a0 AppKit`-[NSImage TIFFRepresentationUsingCompression:factor:] + 216
    frame #10: 0x00000001abf9b2a4 MediaPlayer`MPArtworkImageJPEGRepresentation + 60
    frame #11: 0x00000001abec0f44 MediaPlayer`-[MPMediaItemArtwork jpegDataWithSize:] + 48
    frame #12: 0x00000001abf49848 MediaPlayer`___MPToMRNowPlayingInfoDictionary_block_invoke + 288
    frame #13: 0x0000000195787560 libswiftCore.dylib`$ss26_SwiftDeferredNSDictionaryC23enumerateKeysAndObjects7options5usingySi_ys9UnmanagedVyyXlG_AHSpys5UInt8VGtXBtFTf4dnn_n + 580
    frame #14: 0x0000000195515940 libswiftCore.dylib`$ss26_SwiftDeferredNSDictionaryC23enumerateKeysAndObjects7options5usingySi_ys9UnmanagedVyyXlG_AHSpys5UInt8VGtXBtFTo + 48
    frame #15: 0x00000001abf495b4 MediaPlayer`_MPToMRNowPlayingInfoDictionary + 200
    frame #16: 0x00000001abf49310 MediaPlayer`-[MPNowPlayingInfoCenter(NowPlayingInfo) _onQueue_pushNowPlayingInfoAndRetry:] + 268
    frame #17: 0x00000001859d2cb8 libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame #18: 0x00000001859d4910 libdispatch.dylib`_dispatch_client_callout + 20
    frame #19: 0x00000001859dbea4 libdispatch.dylib`_dispatch_lane_serial_drain + 748
    frame #20: 0x00000001859dc9d4 libdispatch.dylib`_dispatch_lane_invoke + 380
    frame #21: 0x00000001859e761c libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 288
    frame #22: 0x00000001859e6e90 libdispatch.dylib`_dispatch_workloop_worker_thread + 404
    frame #23: 0x0000000185b82114 libsystem_pthread.dylib`_pthread_wqthread + 288
  thread #3
    frame #0: 0x0000000185b47524 libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #4
    frame #0: 0x0000000185b47524 libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #5
    frame #0: 0x0000000185b47524 libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #6, name = 'mpv'
    frame #0: 0x0000000185b4762c libsystem_kernel.dylib`__ulock_wait + 8
    frame #1: 0x00000001859d5300 libdispatch.dylib`_dlock_wait + 56
    frame #2: 0x00000001859d50b4 libdispatch.dylib`_dispatch_thread_event_wait_slow + 56
    frame #3: 0x00000001859e3fb0 libdispatch.dylib`__DISPATCH_WAIT_FOR_QUEUE__ + 368
    frame #4: 0x00000001859e3b5c libdispatch.dylib`_dispatch_sync_f_slow + 148
    frame #5: 0x000000010010b31c mpv`-[EventsResponder setMpvHandle:](self=<unavailable>, _cmd=<unavailable>, ctx=<unavailable>) at macosx_events.m:250:9 [opt]
    frame #6: 0x000000010010afbc mpv`cocoa_set_mpv_handle(ctx=0x000000013e72f7f0) at macosx_events.m:156:9 [opt]
    frame #7: 0x00000001000b58a8 mpv`mp_initialize(mpctx=0x000000013f04c050, options=0x000000016fdfc628) at main.c:393:5 [opt]
    frame #8: 0x00000001000b5a24 mpv`mpv_main(argc=<unavailable>, argv=<unavailable>) at main.c:430:13 [opt]
    frame #9: 0x000000010010ae44 mpv`playback_thread(ctx_obj=0x000000016fdfc380) at macosx_application.m:278:17 [opt]
    frame #10: 0x0000000185b86034 libsystem_pthread.dylib`_pthread_start + 136
  thread #7
    frame #0: 0x0000000000000000
  thread #8
    frame #0: 0x0000000000000000
  thread #9
    frame #0: 0x0000000000000000
  thread #10, name = 'terminal/input'
    frame #0: 0x0000000185b509d4 libsystem_kernel.dylib`__select + 8
    frame #1: 0x000000010010fc88 mpv`polldev(fds=<unavailable>, nfds=2, timeout=1000) at poll_wrapper.c:70:13 [opt]
    frame #2: 0x0000000100110008 mpv`terminal_thread(ptr=<unavailable>) at terminal-unix.c:430:17 [opt]
    frame #3: 0x0000000185b86034 libsystem_pthread.dylib`_pthread_start + 136
  thread #11, name = 'lua/osc'
    frame #0: 0x0000000185b4906c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x0000000185b865fc libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000100086144 mpv`mp_dispatch_lock [inlined] mp_cond_wait(cond=0x000000013e72bda0, mutex=0x000000013e72bd60) at threads-posix.h:181:12 [opt]
    frame #3: 0x0000000100086138 mpv`mp_dispatch_lock(queue=0x000000013e72bd50) at dispatch.c:386:9 [opt]
    frame #4: 0x000000010009dcc4 mpv`mpv_get_property [inlined] run_locked(ctx=0x0000000148105a30, fn=<unavailable>, fn_data=0x00000001703726e8) at client.c:1062:5 [opt]
    frame #5: 0x000000010009dcbc mpv`mpv_get_property(ctx=0x0000000148105a30, name=<unavailable>, format=<unavailable>, data=<unavailable>) at client.c:1488:5 [opt]
    frame #6: 0x00000001001177dc mpv`script_get_property_native(L=0x00000001006f8380, tmp=0x00006000029055e0) at lua.c:924:15 [opt]
    frame #7: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #8: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #9: 0x0000000100116ca4 mpv`script_autofree_trampoline(L=0x00000001006f8380) at lua.c:1286:13 [opt]
    frame #10: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #11: 0x00000001001166b8 mpv`load_builtin(L=0x00000001006f8380) at lua.c:273:13 [opt]
    frame #12: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #13: 0x0000000101219624 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1425 + 528
    frame #14: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #15: 0x0000000100119344 mpv`require(L=0x00000001006f8380, name="@osc.lua") at lua.c:291:5 [opt]
    frame #16: 0x00000001001169d4 mpv`load_scripts(L=0x00000001006f8380) at lua.c:319:9 [opt]
    frame #17: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #18: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #19: 0x000000010011640c mpv`run_lua(L=0x00000001006f8380) at lua.c:429:9 [opt]
    frame #20: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #21: 0x00000001011d6b34 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #22: 0x0000000100115f18 mpv`load_lua(args=<unavailable>) at lua.c:470:9 [opt]
    frame #23: 0x00000001000bd7c4 mpv`run_script(arg=0x0000600002411250) at scripting.c:92:9 [opt]
    frame #24: 0x00000001000bd814 mpv`script_thread(p=<unavailable>) at scripting.c:102:5 [opt]
    frame #25: 0x0000000185b86034 libsystem_pthread.dylib`_pthread_start + 136
  thread #12, name = 'lua/ytdl_hook'
    frame #0: 0x0000000185b4906c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x0000000185b865fc libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000100086144 mpv`mp_dispatch_lock [inlined] mp_cond_wait(cond=0x000000013e72bda0, mutex=0x000000013e72bd60) at threads-posix.h:181:12 [opt]
    frame #3: 0x0000000100086138 mpv`mp_dispatch_lock(queue=0x000000013e72bd50) at dispatch.c:386:9 [opt]
    frame #4: 0x000000010009dcc4 mpv`mpv_get_property [inlined] run_locked(ctx=0x000000013e72e9f0, fn=<unavailable>, fn_data=0x00000001703fe6e8) at client.c:1062:5 [opt]
    frame #5: 0x000000010009dcbc mpv`mpv_get_property(ctx=0x000000013e72e9f0, name=<unavailable>, format=<unavailable>, data=<unavailable>) at client.c:1488:5 [opt]
    frame #6: 0x00000001001177dc mpv`script_get_property_native(L=0x0000000100718380, tmp=0x0000600002905630) at lua.c:924:15 [opt]
    frame #7: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #8: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #9: 0x0000000100116ca4 mpv`script_autofree_trampoline(L=0x0000000100718380) at lua.c:1286:13 [opt]
    frame #10: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #11: 0x00000001001166b8 mpv`load_builtin(L=0x0000000100718380) at lua.c:273:13 [opt]
    frame #12: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #13: 0x0000000101219624 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1425 + 528
    frame #14: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #15: 0x0000000100119344 mpv`require(L=0x0000000100718380, name="@ytdl_hook.lua") at lua.c:291:5 [opt]
    frame #16: 0x00000001001169d4 mpv`load_scripts(L=0x0000000100718380) at lua.c:319:9 [opt]
    frame #17: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #18: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #19: 0x000000010011640c mpv`run_lua(L=0x0000000100718380) at lua.c:429:9 [opt]
    frame #20: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #21: 0x00000001011d6b34 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #22: 0x0000000100115f18 mpv`load_lua(args=<unavailable>) at lua.c:470:9 [opt]
    frame #23: 0x00000001000bd7c4 mpv`run_script(arg=0x000060000240bfd0) at scripting.c:92:9 [opt]
    frame #24: 0x00000001000bd814 mpv`script_thread(p=<unavailable>) at scripting.c:102:5 [opt]
    frame #25: 0x0000000185b86034 libsystem_pthread.dylib`_pthread_start + 136
  thread #13, name = 'lua/stats'
    frame #0: 0x0000000185b4906c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x0000000185b865fc libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000100086144 mpv`mp_dispatch_lock [inlined] mp_cond_wait(cond=0x000000013e72bda0, mutex=0x000000013e72bd60) at threads-posix.h:181:12 [opt]
    frame #3: 0x0000000100086138 mpv`mp_dispatch_lock(queue=0x000000013e72bd50) at dispatch.c:386:9 [opt]
    frame #4: 0x000000010009dcc4 mpv`mpv_get_property [inlined] run_locked(ctx=0x000000013e72ed30, fn=<unavailable>, fn_data=0x000000017048a6e8) at client.c:1062:5 [opt]
    frame #5: 0x000000010009dcbc mpv`mpv_get_property(ctx=0x000000013e72ed30, name=<unavailable>, format=<unavailable>, data=<unavailable>) at client.c:1488:5 [opt]
    frame #6: 0x00000001001177dc mpv`script_get_property_native(L=0x0000000100738380, tmp=0x0000600002905680) at lua.c:924:15 [opt]
    frame #7: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #8: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #9: 0x0000000100116ca4 mpv`script_autofree_trampoline(L=0x0000000100738380) at lua.c:1286:13 [opt]
    frame #10: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #11: 0x00000001001166b8 mpv`load_builtin(L=0x0000000100738380) at lua.c:273:13 [opt]
    frame #12: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #13: 0x0000000101219624 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1425 + 528
    frame #14: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #15: 0x0000000100119344 mpv`require(L=0x0000000100738380, name="@stats.lua") at lua.c:291:5 [opt]
    frame #16: 0x00000001001169d4 mpv`load_scripts(L=0x0000000100738380) at lua.c:319:9 [opt]
    frame #17: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #18: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #19: 0x000000010011640c mpv`run_lua(L=0x0000000100738380) at lua.c:429:9 [opt]
    frame #20: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #21: 0x00000001011d6b34 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #22: 0x0000000100115f18 mpv`load_lua(args=<unavailable>) at lua.c:470:9 [opt]
    frame #23: 0x00000001000bd7c4 mpv`run_script(arg=0x000060000241d650) at scripting.c:92:9 [opt]
    frame #24: 0x00000001000bd814 mpv`script_thread(p=<unavailable>) at scripting.c:102:5 [opt]
    frame #25: 0x0000000185b86034 libsystem_pthread.dylib`_pthread_start + 136
  thread #14, name = 'lua/console'
    frame #0: 0x0000000185b4906c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x0000000185b865fc libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000100086144 mpv`mp_dispatch_lock [inlined] mp_cond_wait(cond=0x000000013e72bda0, mutex=0x000000013e72bd60) at threads-posix.h:181:12 [opt]
    frame #3: 0x0000000100086138 mpv`mp_dispatch_lock(queue=0x000000013e72bd50) at dispatch.c:386:9 [opt]
    frame #4: 0x000000010009dcc4 mpv`mpv_get_property [inlined] run_locked(ctx=0x000000013e72f170, fn=<unavailable>, fn_data=0x00000001705166e8) at client.c:1062:5 [opt]
    frame #5: 0x000000010009dcbc mpv`mpv_get_property(ctx=0x000000013e72f170, name=<unavailable>, format=<unavailable>, data=<unavailable>) at client.c:1488:5 [opt]
    frame #6: 0x00000001001177dc mpv`script_get_property_native(L=0x0000000100758380, tmp=0x000060000290c9b0) at lua.c:924:15 [opt]
    frame #7: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #8: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #9: 0x0000000100116ca4 mpv`script_autofree_trampoline(L=0x0000000100758380) at lua.c:1286:13 [opt]
    frame #10: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #11: 0x00000001001166b8 mpv`load_builtin(L=0x0000000100758380) at lua.c:273:13 [opt]
    frame #12: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #13: 0x0000000101219624 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1425 + 528
    frame #14: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #15: 0x0000000100119344 mpv`require(L=0x0000000100758380, name="@console.lua") at lua.c:291:5 [opt]
    frame #16: 0x00000001001169d4 mpv`load_scripts(L=0x0000000100758380) at lua.c:319:9 [opt]
    frame #17: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #18: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #19: 0x000000010011640c mpv`run_lua(L=0x0000000100758380) at lua.c:429:9 [opt]
    frame #20: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #21: 0x00000001011d6b34 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #22: 0x0000000100115f18 mpv`load_lua(args=<unavailable>) at lua.c:470:9 [opt]
    frame #23: 0x00000001000bd7c4 mpv`run_script(arg=0x000060000241dd50) at scripting.c:92:9 [opt]
    frame #24: 0x00000001000bd814 mpv`script_thread(p=<unavailable>) at scripting.c:102:5 [opt]
    frame #25: 0x0000000185b86034 libsystem_pthread.dylib`_pthread_start + 136
  thread #15, name = 'lua/auto_profiles'
    frame #0: 0x0000000185b4906c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x0000000185b865fc libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000100086144 mpv`mp_dispatch_lock [inlined] mp_cond_wait(cond=0x000000013e72bda0, mutex=0x000000013e72bd60) at threads-posix.h:181:12 [opt]
    frame #3: 0x0000000100086138 mpv`mp_dispatch_lock(queue=0x000000013e72bd50) at dispatch.c:386:9 [opt]
    frame #4: 0x000000010009dcc4 mpv`mpv_get_property [inlined] run_locked(ctx=0x000000013e72f4b0, fn=<unavailable>, fn_data=0x00000001705a26e8) at client.c:1062:5 [opt]
    frame #5: 0x000000010009dcbc mpv`mpv_get_property(ctx=0x000000013e72f4b0, name=<unavailable>, format=<unavailable>, data=<unavailable>) at client.c:1488:5 [opt]
    frame #6: 0x00000001001177dc mpv`script_get_property_native(L=0x0000000106720380, tmp=3 elements) at lua.c:924:15 [opt]
    frame #7: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #8: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #9: 0x0000000100116ca4 mpv`script_autofree_trampoline(L=0x0000000106720380) at lua.c:1286:13 [opt]
    frame #10: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #11: 0x00000001001166b8 mpv`load_builtin(L=0x0000000106720380) at lua.c:273:13 [opt]
    frame #12: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #13: 0x0000000101219624 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1425 + 528
    frame #14: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #15: 0x0000000100119344 mpv`require(L=0x0000000106720380, name="@auto_profiles.lua") at lua.c:291:5 [opt]
    frame #16: 0x00000001001169d4 mpv`load_scripts(L=0x0000000106720380) at lua.c:319:9 [opt]
    frame #17: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #18: 0x00000001011d6af4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #19: 0x000000010011640c mpv`run_lua(L=0x0000000106720380) at lua.c:429:9 [opt]
    frame #20: 0x00000001011ca06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #21: 0x00000001011d6b34 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #22: 0x0000000100115f18 mpv`load_lua(args=<unavailable>) at lua.c:470:9 [opt]
    frame #23: 0x00000001000bd7c4 mpv`run_script(arg=0x000060000241d8d0) at scripting.c:92:9 [opt]
    frame #24: 0x00000001000bd814 mpv`script_thread(p=<unavailable>) at scripting.c:102:5 [opt]
    frame #25: 0x0000000185b86034 libsystem_pthread.dylib`_pthread_start + 136
(lldb) 

@Akemi
Copy link
Member

Akemi commented Feb 12, 2024

tbh i have no idea what else could be done for now. though it might be worth gathering some more data.

if you have rosetta installed, do the builds from stolendata (https://laboratory.stolendata.net/~djinn/mpv_osx/) work or do they exhibit the same problem?
same question for the homebrew bottles?
i am interested in the full output/content of meson setup build, meson setup --reconfigure build or ./build/meson-logs/meson-log.txt.
what is your macOS version and xcode/CommandLineTool version?
are you running any other software that uses the MediaPlayer/MPRemoteCommandCenter at the same time, eg shows data here?
Screenshot 2024-02-10 at 00 55 28

maybe we are hunting down a macOS/SDK bug here. wouldn't be the first time tbh. sry i am asking for so many things.

@noahlias
Copy link

noahlias commented Feb 13, 2024

tbh i have no idea what else could be done for now. though it might be worth gathering some more data.

if you have rosetta installed, do the builds from stolendata (laboratory.stolendata.net/~djinn/mpv_osx) work or do they exhibit the same problem? same question for the homebrew bottles? i am interested in the full output/content of meson setup build, meson setup --reconfigure build or ./build/meson-logs/meson-log.txt. what is your macOS version and xcode/CommandLineTool version? are you running any other software that uses the MediaPlayer/MPRemoteCommandCenter at the same time, eg shows data here? Screenshot 2024-02-10 at 00 55 28

maybe we are hunting down a macOS/SDK bug here. wouldn't be the first time tbh. sry i am asking for so many things.

1: stolendata workswell but i want to use it in the terminal.
2: homebrew bottole install failed the latest verison and the previous verison Compile successfully works the bus error.

The 4.2.8 changelog can be found at:
  https://github.com/Homebrew/brew/releases/tag/4.2.8
Warning: Treating mpv as a formula. For the cask, use homebrew/cask/mpv
==> Fetching dependencies for mpv: openexr
==> Fetching openexr
==> Downloading https://ghcr.io/v2/homebrew/core/openexr/manifests/3.2.2
############################################################################################################################################################################################################ 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/openexr/blobs/sha256:52f5d88e6e1a095f9b0e915b10fa4e55df21082fb062d551e8337d6ff403cc4a
############################################################################################################################################################################################################ 100.0%
==> Fetching mpv
Warning: Building mpv from source as the bottle needs:
- HOMEBREW_CELLAR: /opt/homebrew/Cellar (yours is /opt/Homebrew/Cellar)
- HOMEBREW_PREFIX: /opt/homebrew (yours is /opt/Homebrew)
==> Downloading https://raw.githubusercontent.com/Homebrew/homebrew-core/ce96caf9bb48f92c40247fe8560c1b2d842acb5f/Formula/m/mpv.rb
############################################################################################################################################################################################################ 100.0%
==> Downloading https://github.com/mpv-player/mpv/archive/refs/tags/v0.37.0.tar.gz
Already downloaded: /Users/alias/Library/Caches/Homebrew/downloads/2565deae527bcb6afb2f66b07e6e1397ba1b5eed5e872ef8f20960fb69d78328--mpv-0.37.0.tar.gz
==> Installing dependencies for mpv: openexr
==> Installing mpv dependency: openexr
==> Downloading https://ghcr.io/v2/homebrew/core/openexr/manifests/3.2.2
Already downloaded: /Users/alias/Library/Caches/Homebrew/downloads/4d320fdcd92498fdeb8280528331f94679a35434012d33b2fc633a4ba4d98a08--openexr-3.2.2.bottle_manifest.json
==> Pouring openexr--3.2.2.arm64_sonoma.bottle.tar.gz
🍺  /opt/Homebrew/Cellar/openexr/3.2.2: 204 files, 7.9MB
==> Installing mpv
==> meson setup build -Dhtml-build=enabled -Djavascript=enabled -Dlibmpv=true -Dlua=luajit -Dlibarchive=enabled -Duchardet=enabled --sysconfdir=/opt/Homebrew/etc/mpv --datadir=/opt/Homebrew/Cellar/mpv/0.37.0_1/s
==> meson compile -C build --verbose
Last 15 lines from /Users/alias/Library/Logs/Homebrew/mpv/02.meson:
../video/out/mac/gl_layer.swift:299:36: warning: 'CGLErrorString' was deprecated in macOS 10.14: OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings)
        let errS = String(cString: CGLErrorString(err))
                                   ^
../video/out/mac/gl_layer.swift:312:21: warning: 'CGLCreateContext' was deprecated in macOS 10.14: OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings)
        let error = CGLCreateContext(pixelFormat, nil, &context)
                    ^
../video/out/mac/gl_layer.swift:315:40: warning: 'CGLErrorString' was deprecated in macOS 10.14: OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings)
            let errS = String(cString: CGLErrorString(error))
                                       ^
../video/out/mac/title_bar.swift:200:9: warning: will never be executed
        let style = UserDefaults.standard.string(forKey: "AppleInterfaceStyle")
        ^
ninja: build stopped: subcommand failed.
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /opt/Homebrew/opt/ninja/bin/ninja -C /private/tmp/mpv-20240213-96532-jfpe8z/mpv-0.37.0/build -v

Do not report this issue to Homebrew/brew or Homebrew/homebrew-core!

3: meson build info

λ meson setup --reconfigure build
The Meson build system
Version: 1.3.1
Source dir: /Users/alias/Downloads/m/Misc/projects/mpv
Build dir: /Users/alias/Downloads/m/Misc/projects/mpv/build
Build type: native build
Project name: mpv
Project version: 0.37.0
C compiler for the host machine: cc (clang 15.0.0 "Apple clang version 15.0.0 (clang-1500.1.0.2.5)")
C linker for the host machine: cc ld64 1022.1
Host machine cpu family: aarch64
Host machine cpu: aarch64
Program python3 found: YES (/usr/bin/python3)
Dependency libavcodec found: YES 60.31.102 (cached)
Dependency libavfilter found: YES 9.12.100 (cached)
Dependency libavformat found: YES 60.16.100 (cached)
Dependency libavutil found: YES 58.29.100 (cached)
Dependency libswresample found: YES 4.12.100 (cached)
Dependency libswscale found: YES 7.5.100 (cached)
Dependency libplacebo found: YES 6.338.2 (cached)
Dependency libass found: YES 0.17.1 (cached)
Compiler for C supports arguments -Werror=implicit-function-declaration: YES (cached)
Compiler for C supports arguments -Wempty-body: YES (cached)
Compiler for C supports arguments -Wdisabled-optimization: YES (cached)
Compiler for C supports arguments -Wstrict-prototypes: YES (cached)
Compiler for C supports arguments -Wno-format-zero-length: YES (cached)
Compiler for C supports arguments -Wno-redundant-decls: YES (cached)
Compiler for C supports arguments -Wvla: YES (cached)
Compiler for C supports arguments -Wno-format-truncation: NO (cached)
Compiler for C supports arguments -Wimplicit-fallthrough: YES (cached)
Compiler for C supports arguments -fno-math-errno: YES (cached)
Compiler for C supports arguments -Wformat -Werror=format-security: YES (cached)
Compiler for C supports link arguments -Wl,-z,noexecstack: NO (cached)
Compiler for C supports link arguments -Wl,--nxcompat,--no-seh,--dynamicbase: NO (cached)
Dependency dl found: YES unknown (cached)
Library atomic found: NO
Compiler for C supports link arguments -rdynamic: YES (cached)
Dependency threads found: YES unknown (cached)
Header "pthread.h" has symbol "pthread_condattr_setclock" with dependency threads: NO (cached)
Run-time dependency appleframeworks found: YES (Cocoa, IOKit, QuartzCore)
Checking for function "ppoll" : NO (cached)
Library windowsapp skipped: feature uwp disabled
Checking for function "glob" : YES (cached)
Header "sys/vt.h" has symbol "VT_GETMODE" : NO (cached)
Header "sys/consio.h" has symbol "VT_GETMODE" : NO (cached)
Checking for function "fstatfs" : YES (cached)
Checking for function "fstatfs" : NO (cached)
Checking if "vector check" compiles: YES (cached)
Program /Users/alias/Downloads/m/Misc/projects/mpv/TOOLS/docutils-wrapper.py found: YES (/Users/alias/Downloads/m/Misc/projects/mpv/TOOLS/docutils-wrapper.py)
Program /Users/alias/Downloads/m/Misc/projects/mpv/TOOLS/file2string.py found: YES (/Users/alias/Downloads/m/Misc/projects/mpv/TOOLS/file2string.py)
Program /Users/alias/Downloads/m/Misc/projects/mpv/TOOLS/matroska.py found: YES (/Users/alias/Downloads/m/Misc/projects/mpv/TOOLS/matroska.py)
Dependency libcdio skipped: feature cdda disabled
Dependency libcdio_paranoia skipped: feature cdda disabled
Dependency dvdnav skipped: feature dvdnav disabled
Dependency dvdread skipped: feature dvdnav disabled
Dependency iconv found: YES unknown (cached)
Dependency mujs found: YES 1.3.4 (cached)
Dependency lcms2 found: YES 2.16 (cached)
Found pkg-config: YES (/opt/Homebrew/bin/pkg-config) 0.29.2
Found CMake: /opt/Homebrew/bin/cmake (3.28.3)
Run-time dependency libarchive found: NO (tried pkgconfig, framework and cmake)
Dependency libavdevice found: YES 60.3.100 (cached)
Dependency libbluray found: YES 1.3.4 (cached)
Library m found: YES
Library rt found: NO
Dependency lua found: NO found 5.4.6 but need: '<5.3.0' ; matched: '>=5.1.0'
Dependency lua found: NO found 5.4.6 but need: '<5.3.0' ; matched: '>=5.1.0'
Run-time dependency lua found: NO (tried pkgconfig, framework and cmake)
Run-time dependency lua52 found: NO (tried pkgconfig, framework and cmake)
Run-time dependency lua5.2 found: NO (tried pkgconfig, framework and cmake)
Run-time dependency lua-5.2 found: NO (tried pkgconfig, framework and cmake)
Dependency luajit found: YES 2.1.1703358377 (cached)
Dependency rubberband found: YES 3.3.0 (cached)
Dependency sdl2 skipped: feature sdl2 disabled
Dependency uchardet found: YES 0.0.8 (cached)
Dependency vapoursynth found: YES 65 (cached)
Dependency vapoursynth-script found: YES 65 (cached)
Dependency zimg found: YES 3.0.5 (cached)
Dependency zlib found: YES 1.2.11 (cached)
Run-time dependency alsa found: NO (tried pkgconfig, framework and cmake)
Dependency appleframeworks (modules: Foundation, AudioToolbox) found: YES unknown (cached)
Header "AudioToolbox/AudioToolbox.h" has symbol "kAudioUnitSubType_RemoteIO" : NO (cached)
Run-time dependency appleframeworks found: YES (CoreFoundation, CoreAudio, AudioUnit, AudioToolbox)
Run-time dependency jack found: NO (tried pkgconfig, framework and cmake)
Dependency openal skipped: feature openal disabled
Library OpenSLES found: NO
Header "sys/soundcard.h" has symbol "SNDCTL_DSP_HALT" : NO (cached)
Run-time dependency libpipewire-0.3 found: NO (tried pkgconfig, framework and cmake)
Run-time dependency libpulse found: NO (tried pkgconfig, framework and cmake)
Run-time dependency sndio found: NO (tried pkgconfig, framework and cmake)
Header "audioclient.h" has symbol "IAudioClient" : NO (cached)
Run-time dependency caca found: NO (tried pkgconfig, framework and cmake)
Has header "d3d9.h" skipped: feature direct3d disabled
Run-time dependency libdrm found: NO (tried pkgconfig, framework and cmake)
Run-time dependency gbm found: NO (tried pkgconfig, framework and cmake)
Dependency libjpeg found: YES 3.0.1 (cached)
Dependency shaderc found: YES 2023.8.1 (cached)
Dependency libsixel found: YES 1.10.3 (cached)
Checking for function "shm_open" : YES (cached)
Run-time dependency spirv-cross-c-shared found: NO (tried pkgconfig, framework and cmake)
Run-time dependency wayland-client found: NO (tried pkgconfig, framework and cmake)
Run-time dependency wayland-cursor found: NO (tried pkgconfig, framework and cmake)
Run-time dependency wayland-protocols found: NO (tried pkgconfig, framework and cmake)
Run-time dependency xkbcommon found: NO (tried pkgconfig, framework and cmake)
Run-time dependency wayland-client found: NO (tried pkgconfig, framework and cmake)
Has header "linux/input-event-codes.h" with dependency wayland-client: NO (cached)
Program wayland-scanner found: NO
Dependency x11 found: YES 1.8.7 (cached)
Run-time dependency xscrnsaver found: NO (tried pkgconfig, framework and cmake)
Dependency xext found: YES 1.3.5 (cached)
Run-time dependency xpresent found: NO (tried pkgconfig, framework and cmake)
Run-time dependency xrandr found: NO (tried pkgconfig, framework and cmake)
Dependency xv skipped: feature xv disabled
Dependency appleframeworks (modules: OpenGL) found: YES unknown (cached)
Library EGL found: NO
Run-time dependency egl found: NO (tried pkgconfig, framework and cmake)
Library EGL skipped: feature egl-android disabled
Run-time dependency wayland-egl found: NO (tried pkgconfig, framework and cmake)
Dependency /opt/vc/lib/pkgconfig/brcmegl.pc skipped: feature rpi disabled
Dependency vulkan found: YES 1.3.277 (cached)
Checking for function "vkCreateDisplayPlaneSurfaceKHR" with dependency vulkan: YES (cached)
Run-time dependency ffnvcodec found: NO (tried pkgconfig, framework and cmake)
Header "OpenGLES/ES3/glext.h" has symbol "GL_RGB32F" : NO (cached)
Dependency /opt/vc/lib/pkgconfig/mmal.pc skipped: feature rpi-mmal disabled
Run-time dependency libva found: NO (tried pkgconfig, framework and cmake)
Dependency libva-drm skipped: feature vaapi-drm disabled
Dependency libva-wayland skipped: feature vaapi-wayland disabled
Dependency libva-x11 skipped: feature vaapi-x11 disabled
Dependency vdpau skipped: feature vdpau disabled
Dependency appleframeworks (modules: CoreVideo) found: YES unknown (cached)
Program /Users/alias/Downloads/m/Misc/projects/mpv/TOOLS/macos-sdk-version.py found: YES (/Users/alias/Downloads/m/Misc/projects/mpv/TOOLS/macos-sdk-version.py)
Message: Detected macOS sdk path: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk
Message: Detected macOS SDK: 14.2
meson.build:1485: WARNING: add_languages is missing native:, assuming languages are wanted for both host and build.
Objective-C compiler for the host machine: cc (clang 15.0.0)
Objective-C linker for the host machine: cc ld64 1022.1
Program xcrun found: YES (/usr/bin/xcrun)
Program /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift found: YES (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift)
Message: Detected Swift version: 5.9.2
Program /Users/alias/Downloads/m/Misc/projects/mpv/TOOLS/macos-swift-lib-directory.py found: YES (/Users/alias/Downloads/m/Misc/projects/mpv/TOOLS/macos-swift-lib-directory.py)
Message: Detected Swift library directory: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx
Has header "AppKit/NSTouchBar.h" : YES (cached)
Program rst2man.py found: YES (/opt/Homebrew/Caskroom/miniforge/base/bin/rst2man.py)
Program rst2html rst2html.py skipped: feature html-build disabled
Program rst2pdf skipped: feature pdf-build disabled
Configuring config.h using configuration
Message: List of enabled features: av-channel-layout avif-muxer bsd-fstatfs build-date cocoa coreaudio cplugins darwin debug ffmpeg gl gl-cocoa glob glob-posix gpl iconv javascript jpeg jpegxl lavu-uuid lcms2 libass libavdevice libbluray libdl libm libplacebo luajit macos-cocoa-cb macos-media-player macos-touchbar manpage-build osx-thread-name posix posix-shm rubberband rubberband-3 shaderc sixel swift threads uchardet vapoursynth vector videotoolbox-gl videotoolbox-pl vk-khr-display vulkan vulkan-interop zimg zimg-st428 zlib
Fetching value of define "MPV_CLIENT_API_VERSION" : (((2) << 16) | (2) | 0UL) (cached)
Compiler for C supports link arguments -Wl,-Bsymbolic: NO (cached)
Build targets in project: 24

mpv 0.37.0

    d3d11     : NO
    javascript: YES
    libmpv    : NO
    lua       : YES
    opengl    : YES
    vulkan    : YES
    wayland   : NO
    x11       : NO

Found ninja-1.11.0 at /opt/Homebrew/Caskroom/miniforge/base/bin/ninja
Cleaning... 0 files

4: log file
meson-log.txt
5:
macos version:
OS: macOS 14.3.1 23D60 arm64
xcode version:

mpv on  tags/v0.37.0 [!?] via 🅒 base
λ xcodes installed
15.2 (15C500b) (Selected) /Applications/Xcode.app

6: nothing but the apple music(Perhaps that's the culprit)
image

Last but all,Thank you for your patience

@Akemi
Copy link
Member

Akemi commented Feb 14, 2024

to sum some important things up:

  1. stolendata builds work
  2. homebrew bottle failed so we couldn't test a different native arm build
  3. you are using macOS 14.3.1, xcode 15.2, macOS SDK 14.2, swift 5.9.2
  4. loading a system resource as image shields the same bug
  5. 'properly' resizing the image didn't fix the problem

my preliminary conclusion now. from 4 we can conclude that the bug is unrelated to the mpv icon we load and it has nothing to do with the memory management of the swift <> obj-c interaction. from 5 we can kinda conclude that it has nothing to do with out of bound reading, from our side. though swift doesn't really allow this on swift native types anyway. from 1. it's highly possible we are encountering an SDK/OS/build bug here. if we could check this with 2, a native arm build from a working build, it would be nearly certain.

i am using xcode 15.0.1 with the previous available SDK 14.0 and swift 5.9. i think it might be worthwhile to try this older version of xcode to verify if it's an SDK or build bug.

otherwise i am out of ideas atm. this is very mysterious so far.

@Akemi
Copy link
Member

Akemi commented Feb 14, 2024

also on a side note and if you weren't aware, you can use the mpv bundle from the cli too. within the bundle is a normal mpv binary (mpv.app/Contents/MacOS/mpv). you can add the path to your $PATH env if you want it available in your terminal without specifying the path to the binary within the bundle, or add a symlink to it.

@Akemi
Copy link
Member

Akemi commented Feb 18, 2024

i am using xcode 15.0.1 with the previous available SDK 14.0 and swift 5.9. i think it might be worthwhile to try this older version of xcode to verify if it's an SDK or build bug.

@noahlias sorry i am not sure how to interpret your thumbs up on my comment there. did you try an older xcode version and it worked?

@noahlias
Copy link

i am using xcode 15.0.1 with the previous available SDK 14.0 and swift 5.9. i think it might be worthwhile to try this older version of xcode to verify if it's an SDK or build bug.

@noahlias sorry i am not sure how to interpret your thumbs up on my comment there. did you try an older xcode version and it worked?

Just Appreciate your work, I use the mpv bundle instead.

@Akemi
Copy link
Member

Akemi commented Feb 25, 2024

you can now find nightly builds from our master branch in our Actions section. there might be workflow runs with the same name from master (comment, build, etc), only the build one has the Artifacts at the bottom.
Screenshot 2024-02-25 at 14 16 43

Screenshot 2024-02-25 at 14 17 10

might be worth trying the macos-14-arm build and see if it exhibits the same problem. let me know of your finding if/when you try.

@kasper93
Copy link
Contributor

@noahlias
Copy link

you can now find nightly builds from our master branch in our Actions section. there might be workflow runs with the same name from master (comment, build, etc), only the build one has the Artifacts at the bottom. Screenshot 2024-02-25 at 14 16 43

Screenshot 2024-02-25 at 14 17 10

might be worth trying the macos-14-arm build and see if it exhibits the same problem. let me know of your finding if/when you try.

I just add the path to script and use the macos-14-arm verison.

#NOTE: mpv
export PATH="/Applications/mpv.app/Contents/MacOS:$PATH"

And I use the mpv in the kitty terminal (the same to the terminal app)

λ mpv --no-config   
mpv ecf22c4 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Feb 26 2024 03:32:51
libplacebo version: v6.338.2
FFmpeg version: 6.1.1
FFmpeg library versions:
   libavutil       58.29.100
   libavcodec      60.31.102
   libavformat     60.16.100
   libswscale      7.5.100
   libavfilter     9.12.100
   libswresample   4.12.100

Usage:   mpv [options] [url|path/]filename

Basic options:
 --start=<time>    seek to given (percent, seconds, or hh:mm:ss) position
 --no-audio        do not play sound
 --no-video        do not play video
 --fs              fullscreen playback
 --sub-file=<file> specify subtitle file to use
 --playlist=<file> specify playlist file

 --list-options    list all mpv options
 --h=<string>      print options which contain the given string in their name

[1]    57926 bus error  mpv --no-config

And I check the backtrace

(lldb) target create 'mpv'
Current executable set to '/Applications/mpv.app/Contents/MacOS/mpv' (arm64).
(lldb) run --no-config 
Process 59498 launched: '/Applications/mpv.app/Contents/MacOS/mpv' (arm64)
mpv ecf22c4 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Feb 26 2024 03:32:51
libplacebo version: v6.338.2
FFmpeg version: 6.1.1
FFmpeg library versions:
   libavutil       58.29.100
   libavcodec      60.31.102
   libavformat     60.16.100
   libswscale      7.5.100
   libavfilter     9.12.100
   libswresample   4.12.100

Usage:   mpv [options] [url|path/]filename

Basic options:
 --start=<time>    seek to given (percent, seconds, or hh:mm:ss) position
 --no-audio        do not play sound
 --no-video        do not play video
 --fs              fullscreen playback
 --sub-file=<file> specify subtitle file to use
 --playlist=<file> specify playlist file

 --list-options    list all mpv options
 --h=<string>      print options which contain the given string in their name

Process 59498 stopped
* thread #2, queue = 'com.apple.MediaPlayer.MPNowPlayingInfoCenter/accessQueue', stop reason = EXC_BAD_ACCESS (code=257, address=0xbad4007)
    frame #0: 0x000000000bad4007
error: memory read failed for 0xbad4007
(lldb) thread backtrace all
  thread #1, queue = 'com.apple.main-thread'
    frame #0: 0x0000000189edd874 libsystem_kernel.dylib`mach_msg2_trap + 8
    frame #1: 0x0000000189eefcf0 libsystem_kernel.dylib`mach_msg2_internal + 80
    frame #2: 0x0000000189ee64b0 libsystem_kernel.dylib`mach_msg_overwrite + 476
    frame #3: 0x0000000189eddbf8 libsystem_kernel.dylib`mach_msg + 24
    frame #4: 0x0000000189c60444 libxpc.dylib`_xpc_pipe_mach_msg + 56
    frame #5: 0x0000000189c5fc7c libxpc.dylib`_xpc_pipe_routine + 388
    frame #6: 0x0000000189f52fa0 libsystem_info.dylib`_od_rpc_call + 148
    frame #7: 0x0000000189f52c08 libsystem_info.dylib`mbr_identifier_translate + 628
    frame #8: 0x0000000189f528f4 libsystem_info.dylib`mbr_identifier_to_uuid + 56
    frame #9: 0x0000000189f528b0 libsystem_info.dylib`mbr_uid_to_uuid + 40
    frame #10: 0x00000001963f4be8 libsystem_coreservices.dylib`__user_local_dirname + 84
    frame #11: 0x00000001963f42f4 libsystem_coreservices.dylib`_dirhelper + 616
    frame #12: 0x0000000189db8f90 libsystem_c.dylib`confstr + 524
    frame #13: 0x000000018d2d7c50 CarbonCore`ConstructFilePath + 120
    frame #14: 0x000000018d2d7a14 CarbonCore`OpenCCFFile + 96
    frame #15: 0x000000018d2d77e8 CarbonCore`CCFFetchComponentData + 156
    frame #16: 0x000000018d2d763c CarbonCore`IntlFCOpenComponentData + 204
    frame #17: 0x00000001945c9160 HIToolbox`InitializeInputSourceCache + 332
    frame #18: 0x00000001945c8eb4 HIToolbox`GetInputSourceCacheHeader + 140
    frame #19: 0x00000001945d699c HIToolbox`islcGetInputMethodIndexFromBundleID + 96
    frame #20: 0x00000001945c679c HIToolbox`ValidateEnabledInputSourceIDs + 508
    frame #21: 0x00000001947350d0 HIToolbox`CopyInputSourceEnabledPrefs + 200
    frame #22: 0x0000000194733f40 HIToolbox`GetInputSourceEnabledPrefsIncludingThirdParty + 96
    frame #23: 0x00000001945c52e8 HIToolbox`isPrefsCreateCacheFromEnabledAndDefaultInputSources + 84
    frame #24: 0x00000001945c4bac HIToolbox`islGetInputSourceListWithAdditions + 324
    frame #25: 0x00000001945d674c HIToolbox`_CreateKeyboardInputSourcesArray_Mutable + 448
    frame #26: 0x00000001945dbf54 HIToolbox`_CreateKeyboardInputSourcesArray + 24
    frame #27: 0x00000001945c4690 HIToolbox`UpdateSourceIndicatorMode + 76
    frame #28: 0x00000001945c3f80 HIToolbox`InitTSMFirstEventTime + 852
    frame #29: 0x00000001945c28bc HIToolbox`_FirstEventTime + 1020
    frame #30: 0x00000001945c2364 HIToolbox`RunCurrentEventLoopInMode + 64
    frame #31: 0x00000001945c20d8 HIToolbox`ReceiveNextEventCommon + 220
    frame #32: 0x00000001945c1fdc HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 76
    frame #33: 0x000000018d7d8ed0 AppKit`_DPSNextEvent + 660
    frame #34: 0x000000018dfc3eec AppKit`-[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
    frame #35: 0x000000018d7cc37c AppKit`-[NSApplication run] + 476
    frame #36: 0x0000000100108974 mpv`cocoa_main + 572
    frame #37: 0x0000000189b9d0e0 dyld`start + 2360
* thread #2, queue = 'com.apple.MediaPlayer.MPNowPlayingInfoCenter/accessQueue', stop reason = EXC_BAD_ACCESS (code=257, address=0xbad4007)
  * frame #0: 0x000000000bad4007
    frame #1: 0x0000000194944d60 ImageIO`invocation function for block in SetupTIFFErrorHandler() + 20
    frame #2: 0x0000000189d6c910 libdispatch.dylib`_dispatch_client_callout + 20
    frame #3: 0x0000000189d6e14c libdispatch.dylib`_dispatch_once_callout + 32
    frame #4: 0x00000001948b05dc ImageIO`TIFFWritePlugin::writeAll() + 80
    frame #5: 0x00000001948b0544 ImageIO`IIO_Writer_TIFF::write(void*, void*) + 48
    frame #6: 0x000000019499ec94 ImageIO`IIOImageDestination::finalizeDestination() + 896
    frame #7: 0x00000001948b034c ImageIO`CGImageDestinationFinalize + 180
    frame #8: 0x000000018d9dda40 AppKit`+[NSBitmapImageRep(NSBitmapImageFileTypeExtensions) representationOfImageRepsInArray:usingType:properties:] + 1832
    frame #9: 0x000000018d9dc7a0 AppKit`-[NSImage TIFFRepresentationUsingCompression:factor:] + 216
    frame #10: 0x00000001b03332a4 MediaPlayer`MPArtworkImageJPEGRepresentation + 60
    frame #11: 0x00000001b0258f44 MediaPlayer`-[MPMediaItemArtwork jpegDataWithSize:] + 48
    frame #12: 0x00000001b02e1848 MediaPlayer`___MPToMRNowPlayingInfoDictionary_block_invoke + 288
    frame #13: 0x0000000199b1f560 libswiftCore.dylib`$ss26_SwiftDeferredNSDictionaryC23enumerateKeysAndObjects7options5usingySi_ys9UnmanagedVyyXlG_AHSpys5UInt8VGtXBtFTf4dnn_n + 580
    frame #14: 0x00000001998ad940 libswiftCore.dylib`$ss26_SwiftDeferredNSDictionaryC23enumerateKeysAndObjects7options5usingySi_ys9UnmanagedVyyXlG_AHSpys5UInt8VGtXBtFTo + 48
    frame #15: 0x00000001b02e15b4 MediaPlayer`_MPToMRNowPlayingInfoDictionary + 200
    frame #16: 0x00000001b02e1310 MediaPlayer`-[MPNowPlayingInfoCenter(NowPlayingInfo) _onQueue_pushNowPlayingInfoAndRetry:] + 268
    frame #17: 0x0000000189d6acb8 libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame #18: 0x0000000189d6c910 libdispatch.dylib`_dispatch_client_callout + 20
    frame #19: 0x0000000189d73ea4 libdispatch.dylib`_dispatch_lane_serial_drain + 748
    frame #20: 0x0000000189d749d4 libdispatch.dylib`_dispatch_lane_invoke + 380
    frame #21: 0x0000000189d7f61c libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 288
    frame #22: 0x0000000189d7ee90 libdispatch.dylib`_dispatch_workloop_worker_thread + 404
    frame #23: 0x0000000189f1a114 libsystem_pthread.dylib`_pthread_wqthread + 288
  thread #3
    frame #0: 0x0000000189edf524 libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #4
    frame #0: 0x0000000189edf524 libsystem_kernel.dylib`__workq_kernreturn + 8
  thread #5, queue = 'com.apple.CoreAnalytics::Client XPC Send'
    frame #0: 0x0000000189c7f338 libsystem_trace.dylib`os_trace_blob_addns + 200
    frame #1: 0x0000000189c7ef68 libsystem_trace.dylib`_os_log_fmt_flatten_data_into_blob + 108
    frame #2: 0x0000000189c7eea0 libsystem_trace.dylib`_os_log_fmt_flatten_to_blob + 244
    frame #3: 0x0000000189c7d5d0 libsystem_trace.dylib`_os_log_impl_flatten_and_send + 2076
    frame #4: 0x0000000189c7cd9c libsystem_trace.dylib`_os_log + 152
    frame #5: 0x0000000189c7f718 libsystem_trace.dylib`_os_log_debug_impl + 24
    frame #6: 0x0000000191bf4a50 CoreAnalytics`invocation function for block in CoreAnalytics::Client::sendXpcMessage_sync(applesauce::xpc::dict, XPCMessagePriority, bool) const + 52
    frame #7: 0x0000000191bef0c8 CoreAnalytics`invocation function for block in CoreAnalytics::Client::sendXpcMessage_sync(applesauce::xpc::dict, XPCMessagePriority, bool) const + 440
    frame #8: 0x0000000189d7b860 libdispatch.dylib`_dispatch_block_async_invoke2 + 148
    frame #9: 0x0000000189d6c910 libdispatch.dylib`_dispatch_client_callout + 20
    frame #10: 0x0000000189d73ea4 libdispatch.dylib`_dispatch_lane_serial_drain + 748
    frame #11: 0x0000000189d749d4 libdispatch.dylib`_dispatch_lane_invoke + 380
    frame #12: 0x0000000189d7f61c libdispatch.dylib`_dispatch_root_queue_drain_deferred_wlh + 288
    frame #13: 0x0000000189d7ee90 libdispatch.dylib`_dispatch_workloop_worker_thread + 404
    frame #14: 0x0000000189f1a114 libsystem_pthread.dylib`_pthread_wqthread + 288
  thread #6, name = 'mpv'
    frame #0: 0x0000000189ee106c libsystem_kernel.dylib`__psynch_cvwait + 8
    frame #1: 0x0000000189f1e5fc libsystem_pthread.dylib`_pthread_cond_wait + 1228
    frame #2: 0x0000000100083768 mpv`mp_dispatch_queue_process + 440
    frame #3: 0x00000001000b5cd4 mpv`mp_wait_events + 80
    frame #4: 0x0000000100099fec mpv`mp_shutdown_clients + 108
    frame #5: 0x00000001000b3138 mpv`mp_destroy + 24
    frame #6: 0x00000001000b3b00 mpv`mpv_main + 324
    frame #7: 0x00000001001089f4 mpv`playback_thread + 40
    frame #8: 0x0000000189f1e034 libsystem_pthread.dylib`_pthread_start + 136
  thread #7
    frame #0: 0x0000000000000000
  thread #8, name = 'terminal/input'
    frame #0: 0x0000000189ee89d4 libsystem_kernel.dylib`__select + 8
    frame #1: 0x000000010010d8b8 mpv`polldev + 348
    frame #2: 0x000000010010dbd4 mpv`terminal_thread + 188
    frame #3: 0x0000000189f1e034 libsystem_pthread.dylib`_pthread_start + 136
  thread #9, name = 'lua/osc'
    frame #0: 0x0000000101192080 libluajit-5.1.2.dylib`___lldb_unnamed_symbol510 + 292
    frame #1: 0x0000000101199a9c libluajit-5.1.2.dylib`___lldb_unnamed_symbol589 + 88
    frame #2: 0x00000001011a6e68 libluajit-5.1.2.dylib`___lldb_unnamed_symbol726 + 52
    frame #3: 0x00000001011a688c libluajit-5.1.2.dylib`___lldb_unnamed_symbol724 + 2640
    frame #4: 0x00000001011a4524 libluajit-5.1.2.dylib`___lldb_unnamed_symbol716 + 44
    frame #5: 0x00000001011a7b48 libluajit-5.1.2.dylib`___lldb_unnamed_symbol739 + 1284
    frame #6: 0x00000001011a8ae8 libluajit-5.1.2.dylib`___lldb_unnamed_symbol743 + 96
    frame #7: 0x00000001011a7914 libluajit-5.1.2.dylib`___lldb_unnamed_symbol739 + 720
    frame #8: 0x00000001011a9bd8 libluajit-5.1.2.dylib`___lldb_unnamed_symbol763 + 80
    frame #9: 0x00000001011a9a84 libluajit-5.1.2.dylib`___lldb_unnamed_symbol762 + 176
    frame #10: 0x00000001011a8ccc libluajit-5.1.2.dylib`___lldb_unnamed_symbol743 + 580
    frame #11: 0x00000001011a7914 libluajit-5.1.2.dylib`___lldb_unnamed_symbol739 + 720
    frame #12: 0x00000001011a9ba4 libluajit-5.1.2.dylib`___lldb_unnamed_symbol763 + 28
    frame #13: 0x00000001011aa468 libluajit-5.1.2.dylib`___lldb_unnamed_symbol774 + 280
    frame #14: 0x00000001011a4c3c libluajit-5.1.2.dylib`___lldb_unnamed_symbol717 + 1780
    frame #15: 0x00000001011a71b8 libluajit-5.1.2.dylib`___lldb_unnamed_symbol729 + 60
    frame #16: 0x00000001011a5370 libluajit-5.1.2.dylib`___lldb_unnamed_symbol717 + 3624
    frame #17: 0x00000001011a89a0 libluajit-5.1.2.dylib`___lldb_unnamed_symbol742 + 376
    frame #18: 0x00000001011a4e58 libluajit-5.1.2.dylib`___lldb_unnamed_symbol717 + 2320
    frame #19: 0x000000010119b8c0 libluajit-5.1.2.dylib`___lldb_unnamed_symbol593 + 752
    frame #20: 0x000000010118e474 libluajit-5.1.2.dylib`___lldb_unnamed_symbol362 + 108
    frame #21: 0x000000010119b524 libluajit-5.1.2.dylib`lua_loadx + 72
    frame #22: 0x000000010119bdb0 libluajit-5.1.2.dylib`luaL_loadbuffer + 32
    frame #23: 0x00000001001142a4 mpv`load_builtin + 396
    frame #24: 0x000000010118e06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #25: 0x00000001011dd624 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1425 + 528
    frame #26: 0x000000010118e06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #27: 0x0000000100116f64 mpv`require + 180
    frame #28: 0x00000001001145e4 mpv`load_scripts + 120
    frame #29: 0x000000010118e06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #30: 0x000000010119aaf4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #31: 0x0000000100113ffc mpv`run_lua + 992
    frame #32: 0x000000010118e06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #33: 0x000000010119ab34 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #34: 0x0000000100113ae0 mpv`load_lua + 276
    frame #35: 0x00000001000bb7b0 mpv`run_script + 92
    frame #36: 0x00000001000bb804 mpv`script_thread + 12
    frame #37: 0x0000000189f1e034 libsystem_pthread.dylib`_pthread_start + 136
  thread #11, name = 'lua/stats'
    frame #0: 0x0000000189db50b8 libsystem_c.dylib`__vfprintf + 368
    frame #1: 0x0000000189ddf7c4 libsystem_c.dylib`_vsnprintf + 224
    frame #2: 0x00000001000827c4 mpv`bstr_xappend_vasprintf + 104
    frame #3: 0x0000000100048804 mpv`mp_msg_va + 220
    frame #4: 0x0000000100049bbc mpv`mp_msg + 28
    frame #5: 0x00000001001149f4 mpv`script_log + 260
    frame #6: 0x000000010118e06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #7: 0x00000001001142c4 mpv`load_builtin + 428
    frame #8: 0x000000010118e06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #9: 0x00000001011dd624 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1425 + 528
    frame #10: 0x000000010118e06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #11: 0x0000000100116f64 mpv`require + 180
    frame #12: 0x00000001001145e4 mpv`load_scripts + 120
    frame #13: 0x000000010118e06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #14: 0x000000010119aaf4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #15: 0x0000000100113ffc mpv`run_lua + 992
    frame #16: 0x000000010118e06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #17: 0x000000010119ab34 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #18: 0x0000000100113ae0 mpv`load_lua + 276
    frame #19: 0x00000001000bb7b0 mpv`run_script + 92
    frame #20: 0x00000001000bb804 mpv`script_thread + 12
    frame #21: 0x0000000189f1e034 libsystem_pthread.dylib`_pthread_start + 136
  thread #12, name = 'lua/console'
    frame #0: 0x00000001011a602c libluajit-5.1.2.dylib`___lldb_unnamed_symbol724 + 496
    frame #1: 0x00000001011a4524 libluajit-5.1.2.dylib`___lldb_unnamed_symbol716 + 44
    frame #2: 0x00000001011a9990 libluajit-5.1.2.dylib`___lldb_unnamed_symbol761 + 44
    frame #3: 0x00000001011a8c40 libluajit-5.1.2.dylib`___lldb_unnamed_symbol743 + 440
    frame #4: 0x00000001011a7914 libluajit-5.1.2.dylib`___lldb_unnamed_symbol739 + 720
    frame #5: 0x00000001011a752c libluajit-5.1.2.dylib`___lldb_unnamed_symbol736 + 28
    frame #6: 0x00000001011a73e0 libluajit-5.1.2.dylib`___lldb_unnamed_symbol733 + 24
    frame #7: 0x00000001011a4884 libluajit-5.1.2.dylib`___lldb_unnamed_symbol717 + 828
    frame #8: 0x00000001011a71b8 libluajit-5.1.2.dylib`___lldb_unnamed_symbol729 + 60
    frame #9: 0x00000001011a5370 libluajit-5.1.2.dylib`___lldb_unnamed_symbol717 + 3624
    frame #10: 0x00000001011a71b8 libluajit-5.1.2.dylib`___lldb_unnamed_symbol729 + 60
    frame #11: 0x00000001011a4c24 libluajit-5.1.2.dylib`___lldb_unnamed_symbol717 + 1756
    frame #12: 0x00000001011a89a0 libluajit-5.1.2.dylib`___lldb_unnamed_symbol742 + 376
    frame #13: 0x00000001011a4964 libluajit-5.1.2.dylib`___lldb_unnamed_symbol717 + 1052
    frame #14: 0x000000010119b8c0 libluajit-5.1.2.dylib`___lldb_unnamed_symbol593 + 752
    frame #15: 0x000000010118e474 libluajit-5.1.2.dylib`___lldb_unnamed_symbol362 + 108
    frame #16: 0x000000010119b524 libluajit-5.1.2.dylib`lua_loadx + 72
    frame #17: 0x000000010119bdb0 libluajit-5.1.2.dylib`luaL_loadbuffer + 32
    frame #18: 0x00000001001142a4 mpv`load_builtin + 396
    frame #19: 0x000000010118e06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #20: 0x00000001011dd624 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1425 + 528
    frame #21: 0x000000010118e06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #22: 0x00000001001142c4 mpv`load_builtin + 428
    frame #23: 0x000000010118e06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #24: 0x00000001011dd624 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1425 + 528
    frame #25: 0x000000010118e06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #26: 0x0000000100116f64 mpv`require + 180
    frame #27: 0x00000001001145e4 mpv`load_scripts + 120
    frame #28: 0x000000010118e06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #29: 0x000000010119aaf4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #30: 0x0000000100113ffc mpv`run_lua + 992
    frame #31: 0x000000010118e06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #32: 0x000000010119ab34 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #33: 0x0000000100113ae0 mpv`load_lua + 276
    frame #34: 0x00000001000bb7b0 mpv`run_script + 92
    frame #35: 0x00000001000bb804 mpv`script_thread + 12
    frame #36: 0x0000000189f1e034 libsystem_pthread.dylib`_pthread_start + 136
  thread #13, name = 'lua/auto_profiles'
    frame #0: 0x0000000196794194 libunwind.dylib`libunwind::CFI_Parser<libunwind::LocalAddressSpace>::parseCIE(libunwind::LocalAddressSpace&, unsigned long, libunwind::CFI_Parser<libunwind::LocalAddressSpace>::CIE_Info*) + 376
    frame #1: 0x0000000196794480 libunwind.dylib`libunwind::CFI_Parser<libunwind::LocalAddressSpace>::findFDE(libunwind::LocalAddressSpace&, unsigned long, unsigned long, unsigned long, unsigned long, libunwind::CFI_Parser<libunwind::LocalAddressSpace>::FDE_Info*, libunwind::CFI_Parser<libunwind::LocalAddressSpace>::CIE_Info*) + 164
    frame #2: 0x0000000196792c58 libunwind.dylib`libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_arm64>::getInfoFromDwarfSection(unsigned long, libunwind::UnwindInfoSections const&, unsigned int) + 72
    frame #3: 0x0000000196792b18 libunwind.dylib`libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_arm64>::setInfoBasedOnIPRegister(bool) + 1312
    frame #4: 0x00000001967963bc libunwind.dylib`unw_set_reg + 620
    frame #5: 0x00000001011906d8 libluajit-5.1.2.dylib`___lldb_unnamed_symbol480 + 308
    frame #6: 0x00000001967971ac libunwind.dylib`unwind_phase2 + 596
    frame #7: 0x0000000196796f40 libunwind.dylib`_Unwind_RaiseException + 840
    frame #8: 0x000000010119095c libluajit-5.1.2.dylib`___lldb_unnamed_symbol483 + 96
    frame #9: 0x00000001011b6e18 libluajit-5.1.2.dylib`___lldb_unnamed_symbol811 + 48
    frame #10: 0x00000001011d00e4 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1211 + 248
    frame #11: 0x00000001011b1a8c libluajit-5.1.2.dylib`___lldb_unnamed_symbol805 + 260
    frame #12: 0x00000001011b05f0 libluajit-5.1.2.dylib`___lldb_unnamed_symbol803 + 7980
    frame #13: 0x000000010118e474 libluajit-5.1.2.dylib`___lldb_unnamed_symbol362 + 108
    frame #14: 0x00000001011964fc libluajit-5.1.2.dylib`___lldb_unnamed_symbol564 + 88
    frame #15: 0x0000000101196328 libluajit-5.1.2.dylib`___lldb_unnamed_symbol562 + 136
    frame #16: 0x000000010118f900 libluajit-5.1.2.dylib`___lldb_unnamed_symbol461 + 52
    frame #17: 0x00000001001142c4 mpv`load_builtin + 428
    frame #18: 0x000000010118e06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #19: 0x00000001011dd624 libluajit-5.1.2.dylib`___lldb_unnamed_symbol1425 + 528
    frame #20: 0x000000010118e06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #21: 0x0000000100116f64 mpv`require + 180
    frame #22: 0x00000001001145e4 mpv`load_scripts + 120
    frame #23: 0x000000010118e06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #24: 0x000000010119aaf4 libluajit-5.1.2.dylib`lua_pcall + 148
    frame #25: 0x0000000100113ffc mpv`run_lua + 992
    frame #26: 0x000000010118e06c libluajit-5.1.2.dylib`___lldb_unnamed_symbol344 + 44
    frame #27: 0x000000010119ab34 libluajit-5.1.2.dylib`lua_cpcall + 28
    frame #28: 0x0000000100113ae0 mpv`load_lua + 276
    frame #29: 0x00000001000bb7b0 mpv`run_script + 92
    frame #30: 0x00000001000bb804 mpv`script_thread + 12
    frame #31: 0x0000000189f1e034 libsystem_pthread.dylib`_pthread_start + 136

But it can use with the application mpv and it works good.

image

how wierd it is

@Akemi
Copy link
Member

Akemi commented Feb 27, 2024

so the mpv.app works from the github download but using the binary inside the app on the terminal leads to the crash?

does it work on the terminal with mpv --player-operation-mode=pseudo-gui?

@noahlias
Copy link

noahlias commented Feb 27, 2024

mpv --player-operation-mode=pseudo-gui

yeah,that is true

λ mpv --player-operation-mode=pseudo-gui
[1]    43160 bus error  mpv --player-operation-mode=pseudo-gui
(base) 
~ via 🅒 base 
λ lldb                                  
(lldb) target create 'mpv'
Current executable set to '/Applications/mpv.app/Contents/MacOS/mpv' (arm64).
(lldb) run --player-operation-mode=pseudo-gui
Process 43666 launched: '/Applications/mpv.app/Contents/MacOS/mpv' (arm64)
Process 43666 stopped
* thread #4, queue = 'com.apple.MediaPlayer.MPNowPlayingInfoCenter/accessQueue', stop reason = EXC_BAD_ACCESS (code=257, address=0xbad4007)
    frame #0: 0x000000000bad4007
error: memory read failed for 0xbad4007
(lldb) 

OK, I founded the bug caused by environmental dependence

I unset DYLD_LIBRARY_PATH ,it works.

@Akemi
Copy link
Member

Akemi commented Feb 29, 2024

OK, I founded the bug caused by environmental dependence

I unset DYLD_LIBRARY_PATH ,it works.

okay so unsetting that env var fixed the problem for good? what was it set to that it caused that crash?

[edit]
that explains a lot about the unexpected behaviour, especially the differences between binary and app bundle.

@noahlias
Copy link

noahlias commented Mar 1, 2024

OK, I founded the bug caused by environmental dependence
I unset DYLD_LIBRARY_PATH ,it works.

okay so unsetting that env var fixed the problem for good? what was it set to that it caused that crash?

[edit] that explains a lot about the unexpected behaviour, especially the differences between binary and app bundle.

export DYLD_LIBRARY_PATH = /opt/Homebrew/lib

I added this variable because of a neovim plugin image.nvim that was trying to recognize imagemagick's magick, which was causing the problem. I found this solution in its own issue but didn't realize it would conflict with my other software.
I changed it to point to a lib in the imagemagick directory and it worked.

@Akemi
Copy link
Member

Akemi commented Mar 1, 2024

okay, i am closing this issue then. if this or something similar should occur again please open a new issue.

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

No branches or pull requests

6 participants