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

Segmenatation fault seen when running sample_decode with Intel Media Driver Q4'19 Release #818

Closed
ajitkumarkp opened this issue Jan 10, 2020 · 12 comments
Assignees
Labels
Decode video decode related P2 Medium priority

Comments

@ajitkumarkp
Copy link

Config:

  • CML-S Ubuntu 18.04, Kerenl5.4
  • Intel Media Driver Q4'19 Release which includes:
    iHD Media driver: intel-media-19.4.0r
    gmmlib: intel-gmmlib-19.4.1
    Libva: libva 2.6.0 (commit 5f693d9e60, v2.6-branch)

Command Line:
./sample_decode h264 -i ~/Downloads/AUD_MW_E.264 -r -vaapi -f 20 -d
pretending that stream is 30fps one
pretending that aspect ratio is 1:1
libva info: VA-API version 1.6.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_6
libva info: va_openDriver() returns 0
Decoding Sample Version 8.4.27.

Input video AVC
Output format NV12
Input:
Resolution 176x144
Crop X,Y,W,H 0,0,176,144
Output:
Resolution 176x144
Frame rate 30.00
Memory type vaapi
MediaSDK impl hw
MediaSDK version 1.31

Decoding started
Segmentation fault (core dumped)fread_fps: 0.000, fwrite_fps: 0.000

Issue is not seen when I upgrade to Libva master branch. The difference seems to be commit 7eec6f8f.

This may just require updating Libva version (libva 2.6.0) mentioned in https://github.com/intel/media-driver/releases.

Please let me know if my observation is right or am I missing something. Thx.

@brmarkus
Copy link

What does the core-dump file say, where does the crash happen?
If running in performance mode (i.e. not using "-r") (or writing into a file) then there is no crash anymore? Then it seems to be related to rendering.

@brmarkus
Copy link

Does the crash happen with other files, too (also h.264, or h.265, MJPG, VC1, VP8, VP9, AV1 etc)?

@ajitkumarkp
Copy link
Author

Does the crash happen with other files, too (also h.264, or h.265, MJPG, VC1, VP8, VP9, AV1 etc)?

Issue seen even with MPEG2.

@ajitkumarkp
Copy link
Author

What does the core-dump file say, where does the crash happen?
If running in performance mode (i.e. not using "-r") (or writing into a file) then there is no crash anymore? Then it seems to be related to rendering.

Issue is not seen when writing into a file (i.e -o out.yuv).

@ajitkumarkp
Copy link
Author

gdb (bt full) dump at the point to SIGSEGV attached.
bt_full.txt

@AntonGrishin
Copy link
Contributor

AntonGrishin commented Jan 20, 2020

Issue same as Intel-Media-SDK/MediaSDK#1916
it`s regression in LibVA since intel/libva#351, which fixed in intel/libva#356

As I see on #351 - createDrawable is null, so when we tried to call it, we got segfault.

@ajitkumarkp
Copy link
Author

@AntonGrishin Thanks for confirming. My initial observation as mentioned in the issue description was that the issue is not seen on libva master. However the main problem (although trivial) is that the libva version for "Intel Media Driver Q4'19 Release" on https://github.com/intel/media-driver/releases still shows libva 2.6.0, and this needs to be fixed because many customers who do not follow CI need a stable BKC prescribed by Intel. If they use "Intel Media Driver Q4'19 Release" they will run into this issue.

@XinfengZhang XinfengZhang self-assigned this Mar 3, 2020
@XinfengZhang
Copy link
Contributor

@ajitkumarkp thanks, I change it to 2.6.1

@fredvb
Copy link

fredvb commented Jul 12, 2020

Issues seems to exist with intel-media-driver 20.1.1-1 , intel-gmmlib 20.2.2-1 , libva 2.8 , libva-utils 2.8

I'm encountering the same issue when running MPV with --vo=vaapi when using iHD driver.
If I use i965 all goes well.

My problem is that i965 doesn't work on a Comet Lake

This doesn't seem to be 'always' an issue though. For example, I'm able to make iHD work in lightdm+openbox with mpv using their vaapi video output.

But if I install, say, the latest Ubuntu, it fails.

Here is the "bt full" of it crashing in my case.

(gdb) bt full
#0  0x0000000000000000 in ?? ()
No symbol table info available.
#1  0x00007ffff1aedd0c in do_drawable_hash (drawable=23068674, ctx=0x7fffc002efa0) at va_dricommon.c:74
        dri_state = <optimized out>
        index = 2
        dri_drawable = 0x0
        dri_state = <optimized out>
        index = <optimized out>
        dri_drawable = <optimized out>
#2  va_dri_get_drawable (ctx=0x7fffc002efa0, drawable=23068674) at va_dricommon.c:122
No locals.
#3  0x00007fffc4917b83 in DdiCodec_PutSurfaceLinuxHW(VADriverContext*, unsigned int, void*, short, short, unsigned short, unsigned short, short, short, unsigned short, unsigned short, _VARectangle*, unsigned int, unsigned int) () from /usr/lib64/dri/iHD_drv_video.so
No symbol table info available.
#4  0x00007fffc4901c6d in DdiMedia_PutSurface(VADriverContext*, unsigned int, void*, short, short, unsigned short, unsigned short, short, short, unsigned short, unsigned short, _VARectangle*, unsigned int, unsigned int) () from /usr/lib64/dri/iHD_drv_video.so
No symbol table info available.
#5  0x0000555555678bf5 in render_to_screen (mpi=<optimized out>, p=0x5555559f6cc0) at ../video/out/vo_vaapi.c:530
        status = <optimized out>
        surface = 21
        flags = <optimized out>
        status = <optimized out>
        surface = <optimized out>
        flags = <optimized out>
        w = <optimized out>
        h = <optimized out>
        fmt = <optimized out>
        img = <optimized out>
        n = <optimized out>
        part = <optimized out>
        sp = <optimized out>
        flags = <optimized out>
        n = <optimized out>
        part = <optimized out>
        sp = <optimized out>
#6  flip_page (vo=<optimized out>) at ../video/out/vo_vaapi.c:563
        p = 0x5555559f6cc0
#7  0x000055555566fd4f in render_frame (vo=0x5555559baf40) at ../video/out/vo.c:917
        prev_drop_count = 0
        vsync = {last_queue_display_time = 1594527762, vsync_duration = 794163527, skipped_vsyncs = 0}
        use_vsync = <optimized out>
        frame = 0x7fffc001e680
        in = 0x5555559f4750
        got_frame = false
        now = <optimized out>
        pts = <optimized out>
        duration = <optimized out>
        end_time = <optimized out>
        target = 10095537
        in = <optimized out>
        frame = <optimized out>
        got_frame = <optimized out>
        __PRETTY_FUNCTION__ = "render_frame"
        now = <optimized out>
        pts = <optimized out>
        duration = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--
        end_time = <optimized out>
        target = <optimized out>
        use_vsync = <optimized out>
        prev_drop_count = <optimized out>
        vsync = <optimized out>
#8  vo_thread (ptr=0x5555559baf40) at ../video/out/vo.c:1034
        working = <optimized out>
        wait_until = <optimized out>
        send_reset = <optimized out>
        now = <optimized out>
        redraw = <optimized out>
        send_pause = <optimized out>
        vo = <optimized out>
        in = 0x5555559f4750
        vo_paused = false
        r = 0
#9  0x00007fffefc022de in start_thread () from /lib64/libpthread.so.0
No symbol table info available.
#10 0x00007fffef933e83 in clone () from /lib64/libc.so.6
No symbol table info available.

@XinfengZhang
Copy link
Contributor

@fredvb ,does the issue still exist with latest driver, from your log , seems , it is because the failure of VA_DRI2CreateDrawable, which maybe because of DRI2 missing on your system. could you help to run
xdpyinfo|grep DRI?

@Jexu
Copy link
Contributor

Jexu commented Dec 2, 2022

Could you try latest libva and media driver, this should be fixed by intel/libva#537

@Jexu Jexu added the Decode video decode related label Dec 2, 2022
@Jexu Jexu self-assigned this Dec 2, 2022
@Jexu
Copy link
Contributor

Jexu commented Mar 3, 2023

This issue should be fixed in latest libva and media driver, so I will close it now. Please re-open it again if you still meet this or having any other questions.

@Jexu Jexu closed this as completed Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Decode video decode related P2 Medium priority
Projects
None yet
Development

No branches or pull requests

6 participants