Intel-Media-SDK / MediaSDK

The Intel® Media SDK
MIT License
931 stars 457 forks source link

intermitent segfault with ffmpeg encoding h.264 on Ubuntu #3014

Open sjpotter opened 1 year ago

sjpotter commented 1 year ago

System information

no rendering.

Issue behavior

Describe the current behavior

I experience intermitent segfaults when encoding MPEG2 content to H264 with ffmpeg. Generally, if I restart the process, it finishes OK (maybe happens 10-25% of the time, so not insignificant).

Sadly, it seems ubuntu doesn't have "debug" versions of the module, so this might not be the best place for the bug, but reporting it just in case.

cmd line: ffmpeg -init_hw_device qsv=hw -filter_hw_device hw -i test.ts -map 0 -c:v h264_qsv -global_quality 28 -profile:v high -preset veryslow -c:a copy -c:s copy test.mkv

kernel logs show that its segfaulting at the same address each time

examples:

[2772308.960757] ffmpeg[542714]: segfault at 1e ip 00007f576fe74299 sp 00007f576e4ecad0 error 4 in libmfxhw64.so.1.35[7f576fd24000+2f9000]
[2772308.960783] Code: 00 48 85 d2 74 d3 48 8b 44 24 08 66 83 78 24 20 0f 84 3a 03 00 00 8b 42 18 c1 e8 03 74 bb 45 31 e4 48 8b 42 10 bb 08 00 00 00 <46> 0f b6 3c 20 66 90 83 eb 01 44 89 fe 48 89 ef 89 d9 d3 ee 83 e6
[2848524.665243] ffmpeg[556022]: segfault at 28 ip 00007f6b47015299 sp 00007f6b4568dad0 error 4 in libmfxhw64.so.1.35[7f6b46ec5000+2f9000]
[2848524.665275] Code: 00 48 85 d2 74 d3 48 8b 44 24 08 66 83 78 24 20 0f 84 3a 03 00 00 8b 42 18 c1 e8 03 74 bb 45 31 e4 48 8b 42 10 bb 08 00 00 00 <46> 0f b6 3c 20 66 90 83 eb 01 44 89 fe 48 89 ef 89 d9 d3 ee 83 e6

I'd note that 2f9000 doesn't seem to be an instruction in it, per obj

 2f8fe3:       e8 68 5d 01 00          call   30ed50 <MFXVideoCORE_QueryPlatform@@LIBMFXHW_1.19+0x2809f0>
  2f8fe8:       48 8b b5 a0 fe ff ff    mov    -0x160(%rbp),%rsi
  2f8fef:       48 8b bd 70 fc ff ff    mov    -0x390(%rbp),%rdi
  2f8ff6:       4d 89 e0                mov    %r12,%r8
  2f8ff9:       4c 89 ea                mov    %r13,%rdx
  2f8ffc:       41 b9 01 00 00 00       mov    $0x1,%r9d
  2f9002:       b9 0c 00 00 00          mov    $0xc,%ecx
  2f9007:       e8 94 a1 f9 ff          call   2931a0 <MFXVideoCORE_QueryPlatform@@LIBMFXHW_1.19+0x204e40>
  2f900c:       48 8b bd 48 ff ff ff    mov    -0xb8(%rbp),%rdi
  2f9013:       48 85 ff                test   %rdi,%rdi
  2f9016:       74 05                   je     2f901d <MFXVideoCORE_QueryPlatform@@LIBMFXHW_1.19+0x26acbd>
  2f9018:       e8 63 1d d7 ff          call   6ad80 <MFXVideoENC_GetVideoParam@@LIBMFXHW_1.19+0x200>
  2f901d:       48 8b 7d 80             mov    -0x80(%rbp),%rdi
  2f9021:       4c 39 f7                cmp    %r14,%rdi
  2f9024:       74 0d                   je     2f9033 <MFXVideoCORE_QueryPlatform@@LIBMFXHW_1.19+0x26acd3>
  2f9026:       48 8b 45 90             mov    -0x70(%rbp),%rax
  2f902a:       48 8d 70 01             lea    0x1(%rax),%rsi
  2f902e:       e8 bd 94 d3 ff          call   324f0 <operator delete(void*, unsigned long)@plt>
  2f9033:       48 8b 7d a0             mov    -0x60(%rbp),%rdi
  2f9037:       48 39 df                cmp    %rbx,%rdi
  2f903a:       74 0d                   je     2f9049 <MFXVideoCORE_QueryPlatform@@LIBMFXHW_1.19+0x26ace9>
  2f903c:       48 8b 45 b0             mov    -0x50(%rbp),%rax
  2f9040:       48 8d 70 01             lea    0x1(%rax),%rsi
  2f9044:       e8 a7 94 d3 ff          call   324f0 <operator delete(void*, unsigned long)@plt>
  2f9049:       48 8d 35 c6 2f a3 00    lea    0xa32fc6(%rip),%rsi        # d2c016 <MFXVideoCORE_QueryPlatform@@LIBMFXHW_1.19+0xc9dcb6>

Describe the expected behavior

not segfault

Debug information

deb version: Version: 22.3.0-1