Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

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

Open
sjpotter opened this issue Mar 7, 2023 · 0 comments
Open

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

sjpotter opened this issue Mar 7, 2023 · 0 comments
Labels

Comments

@sjpotter
Copy link

sjpotter commented Mar 7, 2023

System information

  • CPU information(cat /proc/cpuinfo | grep "model name" | uniq):
    model name : Intel(R) Pentium(R) Silver J5005 CPU @ 1.50GHz

  • GPU information(lspci -nn | grep -E 'VGA|isplay):
    00:02.0 VGA compatible controller [0300]: Intel Corporation GeminiLake [UHD Graphics 605] [8086:3184] (rev 03)

  • Display server if rendering to display(X or wayland):

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

  • What's libva/libva-utils/gmmlib/media-driver/Media SDK version?

deb version: Version: 22.3.0-1

  • Could you confirm whether GPU hardware exist or not by ls /dev/dri?
  • Could you attach dmesg log if it's GPU hang by dmesg >dmesg.log 2>&1?
  • Could you provide vainfo log if possible by vainfo -a >vainfo.log 2>&1?
  • Could you provide strace log if possible by strace YOUR_CMD >strace.log 2>&1?
  • Could you provide libva trace log if possible? Run cmd export LIBVA_TRACE=/tmp/libva_trace.log first then execute the case.
  • Media SDK tracer output (https://github.com/Intel-Media-SDK/MediaSDK/blob/master/tools/tracer/README.md)?
  • Do you want to contribute a PR? (yes/no):
@sjpotter sjpotter added the bug label Mar 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant