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

[SVT-HEVC] SvtHevcEncApp v1.4.1 core-dump occurred when encode #413

Closed
xiajin-2007 opened this issue Nov 5, 2019 · 2 comments · Fixed by #415
Closed

[SVT-HEVC] SvtHevcEncApp v1.4.1 core-dump occurred when encode #413

xiajin-2007 opened this issue Nov 5, 2019 · 2 comments · Fixed by #415
Assignees
Labels
bug Something isn't working

Comments

@xiajin-2007
Copy link

OS: Ubuntu 18.04 LTS (GNU/Linux 4.15.0-20-generic x86_64)

GCC: gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)
SVT CommitID: 228d8ef

Verify SVT-HEVC sample binary SvtHevcEncApp with Commit ID 228d8ef, with an 1 frame input yuv stream, then segmentation fault (core dumped) occurred.

  • Input stream:
    Please ref the attachment file 'input_stream.zip' below, target input "car_output.yuv" is generated from the other one 'car-detection_3840_2160_16s_1frame.mp4' by pure decode.
    Tips: only one frame in the video.
    input_stream.zip

  • Command line:
    ./SvtHevcEncApp -i ./car_output.yuv -w 3840 -h 2160 -fps-num 25 -fps-denom 1 -tbr 5000000 -rc 1 -intra-period 29 -tune 1 -encMode 1 -profile -hierarchical-levels 0 -irefresh-type 2 -n 1 -b output.bin
    Tips: using deprecated param "tune" and with a blank value for param "profile".

  • Captures with different version:

Problem occurred (228d8ef):
CoreDump_v1 4 1_228d8ef

Problem occurred (tag v1.4.1 02fd126):
CoreDump_v1 4 1_release

No problem (tag v1.4.0 ca499c9):
Safe_v1 4 0_release

No problem (tag v1.3.0 60076f7):
Safe_v1 3 0_release

  • Bug basic analysis:

GDB information as below:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./SvtHevcEncApp -i ./car_output.yuv -w 3840 -h 2160 -fps-num 25 -fps-denom 1 -t'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f2fef58ab24 in ApplySaoOffsetsPicture (contextPtr=contextPtr@entry=0x5621fd1ddd20, sequenceControlSetPtr=sequenceControlSetPtr@entry=0x5621404cf7b0,
pictureControlSetPtr=pictureControlSetPtr@entry=0x5621b1400bd0) at /home/berta/sgc/SVT-HEVC/Source/Lib/Codec/EbEncDecProcess.c:569
569 tbOriginX = lcuParams->originX;
[Current thread is 1 (Thread 0x7f2d94872700 (LWP 74179))]
(gdb)

L569~L573, originX / originY / width / height may use invalid pointer.

@tianjunwork tianjunwork added the bug Something isn't working label Nov 5, 2019
@tianjunwork
Copy link
Contributor

Hi @xiajin-2007 , Thank you for reporting the issue and attached detailed information which helped us root cause the regression.

@Austin-Hu
Copy link
Contributor

Hi @xiajin-2007 ,

It's a race condition issue which was exposed when PR #348 was merged, and it's not a regression issue actually. Because PR #348 makes some encoding kernel threads keep processing the input data meanwhile EbDeinitEncoder() is called to free some memory objects being accessed by some of those threads.

So fixed (worked around) this issue by PR #415 , and please also verify it in your side. Thanks!

BTW, PR #270 couldn't address such race condition, either, unfortunatelly.

@Austin-Hu Austin-Hu self-assigned this Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants