mpv-player / mpv-player/mpv

mpv *might* segfaults when playing DVD

Open
#9,970 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

core core:dvd-bluray core:stream core:video priority:needs-author-feedback
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Description

Important Information

Provide following Information:

  • mpv version: 0.34.1
  • macOS Version: 12.2
  • Source of the mpv binary or bundle: MacPorts

If you're not using git master or the latest release, update.
Releases are listed here: https://github.com/mpv-player/mpv/releases

Reproduction steps

Open a DVD with mpv: mpv /Volumes/SomeDVD
Wait for it to load, it might crash.

Expected behavior

Plays video normally

Actual behavior

There's a chance mpv could crash, either segfault (11) or abort (6). Both backtraces are attached. Could be a libdvd* problem.

Log file

Console log:

[cplayer] Command line options: '-v' '/Volumes/RWBY_4/'
[cplayer] mpv 0.34.1 Copyright © 2000-2021 mpv/MPlayer/mplayer2 projects
[cplayer]  built on Tue Jan  4 21:55:08 EST 2022
[cplayer] FFmpeg library versions:
[cplayer]    libavutil       56.70.100
[cplayer]    libavcodec      58.134.100
[cplayer]    libavformat     58.76.100
[cplayer]    libswscale      5.9.100
[cplayer]    libavfilter     7.110.100
[cplayer]    libswresample   3.9.100
[cplayer] FFmpeg version: 4.4.1
[cplayer] 
[cplayer] Configuration: ./waf configure --prefix=/opt/local --enable-manpage-build --enable-coreaudio --enable-cocoa --enable-cplugins --enable-zlib --enable-swift --disable-html-build --disable-cuda-hwaccel --disable-opensles --disable-egl-drm --disable-egl-angle-lib --disable-egl-angle-win32 --disable-audiounit --disable-ios-gl --disable-direct3d --disable-android --disable-rpi --disable-dvbin --disable-caca --enable-cdda --disable-clang-database --disable-debug-build --enable-dvdnav --disable-egl-x11 --enable-gl --enable-gl-cocoa --disable-gl-x11 --disable-jack --disable-javascript --disable-jpeg --enable-libarchive --disable-openal --disable-pdf-build --disable-pulse --enable-rubberband --disable-test --disable-tv --disable-uchardet --disable-vapoursynth --disable-x11 --disable-xv --enable-videotoolbox-gl --enable-lua --lua=52fbsd
[cplayer] List of enabled features: 52fbsd asm bsd-fstatfs build-date cdda cocoa coreaudio cplayer cplugins dvdnav ffmpeg ffmpeg-aviocontext-bytes-read gl gl-cocoa glob glob-posix gpl iconv lcms2 libarchive libass libavdevice libbluray libdl libm lua macos-10-11-features macos-10-12-2-features macos-10-14-features macos-cocoa-cb macos-media-player macos-touchbar optimize osx-thread-name posix posix-or-mingw pthreads rubberband stdatomic swift vector videotoolbox-gl videotoolbox-hwaccel zimg zlib
[cplayer] Reading config file /opt/local/etc/mpv/encoding-profiles.conf
[cplayer] Applying profile 'default'...
[cplayer] Reading config file /Users/Admin/.config/mpv/mpv.conf
[cplayer] Applying profile 'default'...
[cplayer] Setting option 'sub-auto' = 'fuzzy' (flags = 4)
[cplayer] Setting option 'override-display-fps' = '60' (flags = 4)
[cplayer] Setting option 'screenshot-template' = '~/Desktop/mpv-screenshot-%f-%p' (flags = 4)
[cplayer] Setting option 'screenshot-format' = 'png' (flags = 4)
[cplayer] Setting option 'autofit-larger' = '100%' (flags = 4)
[cplayer] Setting option 'volume' = '80' (flags = 4)
[cplayer] Setting option 'idle' = 'yes' (flags = 4)
[cplayer] Setting option 'hwdec' = 'auto' (flags = 4)
[cplayer] Setting option 'osd-font' = 'PingFang SC' (flags = 4)
[cplayer] Setting option 'v' = '' (flags = 8)
[ifo_dvdnav] Opening /opt/local/etc/mpv/input.conf
[bdmv/bluray] Opening /opt/local/etc/mpv/input.conf
[file] Opening /opt/local/etc/mpv/input.conf
[input] Parsing input config file /opt/local/etc/mpv/input.conf
[input] Input config file /opt/local/etc/mpv/input.conf parsed: 0 binds
[ifo_dvdnav] Opening /Users/Admin/.config/mpv/input.conf
[bdmv/bluray] Opening /Users/Admin/.config/mpv/input.conf
[file] Opening /Users/Admin/.config/mpv/input.conf
[input] Parsing input config file /Users/Admin/.config/mpv/input.conf
[input] Input config file /Users/Admin/.config/mpv/input.conf parsed: 2 binds
[osx/cocoacb] Created CGL pixel format with attributes: kCGLPFAOpenGLProfile, kCGLOGLPVersion_3_2_Core, kCGLPFAAccelerated, kCGLPFADoubleBuffer, kCGLPFAColorSize, 64, kCGLPFAColorFloat, kCGLPFABackingStore, kCGLPFAAllowOfflineRenderers, kCGLPFASupportsAutomaticGraphicsSwitching, 0
[libmpv_render] GL_VERSION='4.1 ATI-4.7.103'
[libmpv_render] Detected desktop OpenGL 4.1.
[libmpv_render] GL_VENDOR='ATI Technologies Inc.'
[libmpv_render] GL_RENDERER='AMD Radeon RX 6800 XT OpenGL Engine'
[libmpv_render] GL_SHADING_LANGUAGE_VERSION='4.10'
[libmpv_render] Loaded extension GL_APPLE_rgb_422.
[libmpv_render] GL_*_swap_control extension missing.
[libmpv_render] Testing FBO format rgba16f
[libmpv_render] Using FBO format rgba16f.
[libmpv_render] Disabling HDR peak computation (one or more of the following is not supported: compute shaders=0, SSBO=0).
[libmpv_render] No advanced processing required. Enabling dumb mode.
[libmpv_render] Loading hwdec driver 'videotoolbox'
[cplayer] Waiting for scripts...
[osd/libass] libass API version: 0x1502000
[osd/libass] libass source: tarball: 0.15.2
[osd/libass] Shaper: FriBidi 1.0.11 (SIMPLE) HarfBuzz-ng 3.4.0 (COMPLEX)
[osd/libass] Setting up fonts...
[osd/libass] Using font provider coretext
[osd/libass] Done.
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Done loading scripts.
[cplayer] Running hook: ytdl_hook/on_load
[ytdl_hook] ytdl:// hook 
[ytdl_hook] not a ytdl:// url 
[ifo_dvdnav] Opening /Volumes/RWBY_4/
[ifo_dvdnav] .IFO detected. Redirecting to dvd://
[cplayer] Set property: shared-script-properties -> 1
[osd/libass] libass API version: 0x1502000
[osd/libass] libass source: tarball: 0.15.2
libdvdread: Attempting to use device /dev/rdisk13 mounted on /Volumes/RWBY_4 for CSS authentication
[osd/libass] Shaper: FriBidi 1.0.11 (SIMPLE) HarfBuzz-ng 3.4.0 (COMPLEX)
[osd/libass] Setting up fonts...
[osd/libass] Using font provider coretext
[osd/libass] Done.
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Set property: shared-script-properties -> 1
libdvdnav: Can't read name block. Probably not a DVD-ROM device.
libdvdnav: vm: dvd_read_name failed
libdvdnav: DVD disk reports itself with Region mask 0x00400000. Regions: 01 02 03 04 05 06 08
libdvdread: Attempting to retrieve all CSS keys
libdvdread: This can take a _long_ time, please be patient
libdvdread: Get key for /VIDEO_TS/VIDEO_TS.VOB at 0x00000132
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_0.VOB at 0x00000180
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_1.VOB at 0x0001b048
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_02_0.VOB at 0x0001ec46
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_02_1.VOB at 0x0001ec7f
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_03_0.VOB at 0x003a5bce
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_03_1.VOB at 0x003a5c07
libdvdread: Elapsed time 0
libdvdread: Found 3 VTS's
libdvdread: Elapsed time 0
[ifo_dvdnav] List of available titles:
[ifo_dvdnav] title:   0 duration: 00:00:50
[ifo_dvdnav] title:   1 duration: 03:16:09
[ifo_dvdnav] title:   2 duration: 03:08:21
[ifo_dvdnav] title:   3 duration: 00:19:40
[ifo_dvdnav] title:   4 duration: 00:14:12
[ifo_dvdnav] title:   5 duration: 00:18:14
[ifo_dvdnav] title:   6 duration: 00:16:17
[ifo_dvdnav] title:   7 duration: 00:12:30
[ifo_dvdnav] title:   8 duration: 00:16:11
[ifo_dvdnav] title:   9 duration: 00:16:36
[ifo_dvdnav] title:  10 duration: 00:20:32
[ifo_dvdnav] title:  11 duration: 00:15:16
[ifo_dvdnav] title:  12 duration: 00:18:44
[ifo_dvdnav] title:  13 duration: 00:15:29
[ifo_dvdnav] title:  14 duration: 00:26:54
[ifo_dvdnav] title:  15 duration: 03:08:21
[ifo_dvdnav] title:  16 duration: 00:30:04
[ifo_dvdnav] title:  17 duration: 00:09:54
[ifo_dvdnav] title:  18 duration: 00:03:17
[ifo_dvdnav] title:  19 duration: 00:04:32
[ifo_dvdnav] title:  20 duration: 00:04:19
[ifo_dvdnav] title:  21 duration: 00:07:11
[ifo_dvdnav] title:  22 duration: 00:30:04
[ifo_dvdnav] title:  23 duration: 00:00:51
[ifo_dvdnav] Selecting title 1.
[demux] Trying demuxers for level=force.
[ifo_dvdnav] DVDNAV, switched to title: 2
[disc] reset to time: 0.000000
[demux] Trying demuxers for level=force.
[lavf] Found 'mpeg' at score=100 size=0 (forced).
[lavf] avformat_find_stream_info() finished after 3094528 bytes.
[demux] Detected file format: mpeg (libavformat)
[demux] Stream is not seekable.
[demux] Detected file format: CD/DVD/BD wrapper
[cplayer] Opening done: /Volumes/RWBY_4/
mpv(25388,0x70000b8d0000) malloc: Heap corruption detected, free list is damaged at 0x600000319540
*** Incorrect guard value: 268131476935936
mpv(25388,0x70000b8d0000) malloc: *** set a breakpoint in malloc_error_break to debug
Abort trap: 6

Backtrace in the comments

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the DVD path with mpv /Volumes/SomeDVD and inspect the attached backtraces and console log around ifo_dvdnav, libdvdnav, and libdvdread. Compare repeated runs to isolate the heap corruption; done means DVD playback completes without a segfault, abort, or malloc corruption.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, macos
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.