mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.71k stars 2.93k forks source link

[intel-media-driver] SIGSEGV when seeking in certain videos on Arrow Lake S (ARL-S) iGPU #15353

Open database64128 opened 3 days ago

database64128 commented 3 days ago

mpv Information

mpv v0.39.0 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Nov  6 2024 17:31:17
libplacebo version: v7.349.0
FFmpeg version: n7.1
FFmpeg library versions:
   libavcodec      61.19.100
   libavdevice     61.3.100
   libavfilter     10.4.100
   libavformat     61.7.100
   libavutil       59.39.100
   libswresample   5.3.100
   libswscale      8.3.100

Other Information

- Linux version: Arch Linux
- Kernel Version: 6.11.6.arch1-1
- GPU Model: 00:02.0 VGA compatible controller: Intel Corporation Arrow Lake-U [Intel Graphics] (rev 06)
- Mesa/GPU Driver Version: Mesa 24.2.6-arch1.1, intel-media-driver 24.4.2-1, vpl-gpu-rt 24.4.2-1
- Window Manager and Version: mutter 47.1-1
- Source of mpv: Distro package
- Latest known working version: N/A
- Issue started after the following happened: Upgrading my CPU from 13900K to 285K

Reproduction Steps

I'm re-posting upstream bug intel/media-driver#1879 here for tracking, and just in case it can be worked around in mpv.

After upgrading my CPU from i9-13900K (Raptor Lake S, RPL-S) to Ultra 9 285K (Arrow Lake S, ARL-S), mpv would randomly crash when I click the progress bar to seek in certain (not all) videos. From the backtrace you can see the crash is caused by the Intel media driver.

mpv config:

hwdec=vaapi
hwdec-codecs=all
vo=gpu-next
gpu-api=vulkan
tone-mapping=bt.2446a

Expected Behavior

mpv does not crash.

Actual Behavior

Crash in intel-media-driver.

Log File

#0  MediaStatusReport::GetCompletedCount (this=0x0) at /usr/src/debug/intel-media-driver/media-driver-intel-media-24.4.2/media_softlet/agnostic/common/shared/statusreport/media_status_report.h:123                                                                                      
123         if (m_completedCount == nullptr)
[Current thread is 1 (Thread 0x74b729c006c0 (LWP 220735))]
(gdb) bt
#0  MediaStatusReport::GetCompletedCount (this=0x0) at /usr/src/debug/intel-media-driver/media-driver-intel-media-24.4.2/media_softlet/agnostic/common/shared/statusreport/media_status_report.h:123
#1  decode::Av1PipelineG12::GetCompletedReport (this=0x6535d8e785e0) at /usr/src/debug/intel-media-driver/media-driver-intel-media-24.4.2/media_driver/media_softlet/agnostic/gen12/codec/hal/dec/av1/pipeline/decode_av1_pipeline_g12.cpp:254
#2  DecodeAvcPipelineAdapterXe_Lpm_Plus_Base::GetCompletedReport (this=0x6535d8e5e170)
    at /usr/src/debug/intel-media-driver/media-driver-intel-media-24.4.2/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus_base/codec/hal/dec/avc/pipeline/decode_avc_pipeline_adapter_xe_lpm_plus_base.cpp:124
#3  0x000074b719c9007f in DdiDecodeFunctions::StatusReport (this=this@entry=0x74b6e81f33f0, mediaCtx=mediaCtx@entry=0x74b6e8012d30, decoder=0x6535d8e5e170, surface=surface@entry=0x6535d8e3fda0)
    at /usr/src/debug/intel-media-driver/media-driver-intel-media-24.4.2/media_softlet/linux/common/codec/ddi/dec/ddi_decode_functions.cpp:1049
#4  0x000074b719c91bf4 in DdiDecodeFunctions::StatusCheck (this=0x74b6e81f33f0, mediaCtx=0x74b6e8012d30, surface=0x6535d8e3fda0, surfaceId=<optimized out>)
    at /usr/src/debug/intel-media-driver/media-driver-intel-media-24.4.2/media_softlet/linux/common/codec/ddi/dec/ddi_decode_functions.cpp:1031
#5  0x000074b74ccdcced in vaSyncSurface (dpy=dpy@entry=0x74b6e80dad90, render_target=<optimized out>) at ../libva/va/va.c:1668
#6  0x00006535b5688cd9 in mapper_map (mapper=0x74b6e8483020) at ../mpv/video/out/hwdec/hwdec_vaapi.c:295
#7  0x00006535b560979a in ra_hwdec_mapper_map (mapper=0x74b6e8483020, img=0x74b6e9790110) at ../mpv/video/out/gpu/hwdec.c:172
#8  0x00006535b562b7af in hwdec_acquire (gpu=<optimized out>, frame=0x74b729bfb0f8) at ../mpv/video/out/vo_gpu_next.c:567
#9  0x000074b750958f00 in acquire_frame (pass=0x74b729bfaf90, frame=0x74b729bfb0f8, acquired=0x74b729bfbca2) at src/renderer.c:2881
#10 pass_init (pass=pass@entry=0x74b729bfaf90, acquire_image=acquire_image@entry=true) at src/renderer.c:3014
#11 0x000074b750960af1 in pl_render_image (rr=rr@entry=0x74b6e8033a40, pimage=pimage@entry=0x74b6e80c8700, ptarget=ptarget@entry=0x74b729bfef30, params=params@entry=0x74b729bfeb30) at src/renderer.c:3138
#12 0x000074b750962250 in pl_render_image_mix (rr=<optimized out>, images=images@entry=0x74b729bfe9a0, ptarget=ptarget@entry=0x74b729bfef30, params=params@entry=0x74b729bfeb30) at src/renderer.c:3688
#13 0x00006535b562d200 in draw_frame (vo=<optimized out>, frame=<optimized out>) at ../mpv/video/out/vo_gpu_next.c:1124
#14 0x00006535b56238e5 in render_frame (vo=0x6535d8b7b1e0) at ../mpv/video/out/vo.c:973
#15 vo_thread (ptr=<optimized out>) at ../mpv/video/out/vo.c:1105
#16 0x000074b74cb2d39d in start_thread (arg=<optimized out>) at pthread_create.c:447
#17 0x000074b74cbb249c in __GI___clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Sample Files

No response

I carefully read all instruction and confirm that I did the following:

database64128 commented 3 days ago

This likely affects the Meteor Lake (MTL) platform as well, since Arrow Lake S CPUs use the same generation of iGPU as Meteor Lake (MTL) CPUs.

CounterPillow commented 3 days ago

Crash in intel-media-driver

I think reporting it to them would be more appropriate, mpv can't really fix a null pointer deref on this in C++ code deep within intel-media-driver.

database64128 commented 3 days ago

Crash in intel-media-driver

I think reporting it to them would be more appropriate, mpv can't really fix a null pointer deref on this in C++ code deep within intel-media-driver.

This is already mentioned in the description. 😅

I only opened this a week after opening intel/media-driver#1879 and getting no response.

llyyr commented 3 days ago

Can you reproduce the issue with ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i [input] -f null -? Should help Intel guys isolate the issue. Set the appropriate render device.

There's nothing mpv can do to workaround this, just don't use hwdec.

database64128 commented 3 days ago

Can you reproduce the issue with ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i [input] -f null -? Should help Intel guys isolate the issue. Set the appropriate render device.

The crash can only be triggered by seeking back and forth multiple times during playback. Not sure how to do that with this.

There's nothing mpv can do to workaround this, just don't use hwdec.

Well, this crash is actually rare enough that I can get away with hwdec almost all the time. 😆