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

[BUG] segfault when trying to use a super resolution denominator that's not 8 #123

Open
1 task
TheLegendOfKitty opened this issue Jan 10, 2025 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@TheLegendOfKitty
Copy link

TheLegendOfKitty commented Jan 10, 2025

Overview
svt-av1-psy segfaults when trying to use a super resolution denominator that's not 8.

Branch
In which branch does the issue appear to be occurring?

  • [*] master
  • testing (I have not tried testing)

Reproduction
Attempt to use super resolution with a denominator that's not 8, such as 16. The command I tried is below.

ffmpeg -i in.mkv -strict -1 -f yuv4mpegpipe - | ./SvtAv1EncApp -i - -b out.mkv --crf 16 --preset 4 --superres-mode 1 --superres-denom 16 (piped through ffmpeg)

Expected behavior
The video would be encoded with the super resolution mode and denominator that was selected.

Terminal Output
terminated by signal SIGSEGV (Address boundary error)

[ 2402.331807] SvtAv1EncApp[68308]: segfault at 0 ip 0000561049f1c8dc sp 00007339c4810db0 error 6 in SvtAv1EncApp[2198dc,561049d24000+690000] likely on CPU 18 (core 30, socket 0) [ 2402.331823] Code: 28 c8 f2 0f 10 05 94 bb 4a 00 48 8b 85 88 5d 00 00 f2 0f 5c c1 f2 0f 59 05 c1 c0 4a 00 f2 0f 58 84 24 88 00 00 00 48 8b 40 50 <f2> 0f 11 04 18 48 83 c3 08 e8 66 79 e0 ff f2 0f 58 44 24 58 83 44

Platform
uname: Linux p14s 6.12.7-zen1-1-zen x86_64 unknown GNU/Linux
compiled with: cc (GCC) 14.2.1 20240910
build command: cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_DEC=OFF -DSVT_AV1_LTO=ON -DNATIVE=ON -DCMAKE_CXX_FLAGS="-O3" -DCMAKE_C_FLAGS="-O3" -DCMAKE_LD_FLAGS="-O3" && make -j$(nproc)

Version String (please complete the following information):

  • Run SvtAv1EncApp --version and copy the result: SVT-AV1-PSY v2.3.0-A-5-gf560b40c (release) PSY Release: A

Additional context / Relevant Files
Any file you encode should work. Some that failed:
eva OP: https://github.com/user-attachments/assets/5d9eb9a7-789e-4c5b-bd95-d4597959a15d
a hard day's night (i tried both 4k and 1080p, but github restricts to 10mb limit, so this is 1080p): https://github.com/user-attachments/assets/f82cfc53-5214-4727-90f9-880dcacb5726

@TheLegendOfKitty TheLegendOfKitty added the bug Something isn't working label Jan 10, 2025
@juliobbv-p
Copy link
Collaborator

juliobbv-p commented Jan 29, 2025

Hi @TheLegendOfKitty, can you try this with mainline SVT-AV1 and see if it reproduces there too? If that's the case, you'll need to follow up with them instead: https://gitlab.com/AOMediaCodec/SVT-AV1

@TheLegendOfKitty
Copy link
Author

TheLegendOfKitty commented Feb 5, 2025

It doesn't happen on latest mainline, I'll try to post addresssantizer results

@TheLegendOfKitty
Copy link
Author

Svt[info]: [asm level on system : up to avx512]
Svt[info]: [asm level selected : up to avx512]
Svt[info]: -------------------------------------------
Svt[info]: SVT [config]: main profile   tier (auto)     level (auto)
Svt[info]: SVT [config]: width / height / fps numerator / fps denominator               : 1920 / 1080 / 24000 / 1001
Svt[info]: SVT [config]: bit-depth / color format                                       : 8 / YUV420
Svt[info]: SVT [config]: preset / tune / pred struct                                    : 4 / SSIM / random access
Svt[info]: SVT [config]: gop size / mini-gop size / key-frame type                      : 321 / 32 / key frame
Svt[info]: SVT [config]: BRC mode / rate factor                                         : CRF / 16.00 
Svt[info]: SVT [config]: AQ mode / variance boost strength / octile / curve             : 2 / 2 / 6 / regular
Svt[info]: SVT [config]: Sharpness / QP scale compress strength / Frame low-luma bias   : 1 / 1 / 0
Svt[info]: SVT [config]: Temporal Filtering Strength                                    : 1
Svt[info]: SVT [config]: Keyframe TF Strength                                           : 1
Svt[info]: -------------------------------------------
Encoding          AddressSanitizer:DEADLYSIGNAL
=================================================================
==45842==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x73ee01e4e18c bp 0x73ed5384add0 sp 0x73ed5384a220 T33)
==45842==The signal is caused by a WRITE memory access.
==45842==Hint: address points to the zero page.
    #0 0x73ee01e4e18c in svt_aom_source_based_operations_kernel (/home/parsa/vvc/svt-av1-psy/Bin/Release/libSvtAv1Enc.so.2+0x64e18c) (BuildId: 68bd6575c8a5abb12088d8c2c8688e477a8b5e41)
    #1 0x5f9824d4f2c2 in asan_thread_start(void*) asan_interceptors.cpp.o
    #2 0x73ee015b439c  (/usr/lib/libc.so.6+0x9439c) (BuildId: 98b3d8e0b8c534c769cb871c438b4f8f3a8e4bf3)
    #3 0x73ee0163949b  (/usr/lib/libc.so.6+0x11949b) (BuildId: 98b3d8e0b8c534c769cb871c438b4f8f3a8e4bf3)

==45842==Register values:
rax = 0x0000000000000000  rbx = 0x000073ed5384a220  rcx = 0x0000000000000000  rdx = 0x0000000000000000  
rdi = 0x0000000000000000  rsi = 0x0000000000000004  rbp = 0x000073ed5384add0  rsp = 0x000073ed5384a220  
 r8 = 0x8080808080808080   r9 = 0x1010101010101010  r10 = 0x0000000000000000  r11 = 0x000073ee0175cc00  
r12 = 0x0000000000000004  r13 = 0x000073ed979f8d50  r14 = 0x0000000000000000  r15 = 0x0000517000000080  
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/home/parsa/vvc/svt-av1-psy/Bin/Release/libSvtAv1Enc.so.2+0x64e18c) (BuildId: 68bd6575c8a5abb12088d8c2c8688e477a8b5e41) in svt_aom_source_based_operations_kernel
Thread T33 created by T0 here:
    #0 0x5f9824e10663 in pthread_create (/home/parsa/SSD/vvc/svt-av1-psy/Bin/Release/SvtAv1EncApp+0x127663) (BuildId: 2352669617441f7e564167e795889197c2c64363)
    #1 0x73ee01e660c1 in svt_create_thread (/home/parsa/vvc/svt-av1-psy/Bin/Release/libSvtAv1Enc.so.2+0x6660c1) (BuildId: 68bd6575c8a5abb12088d8c2c8688e477a8b5e41)
    #2 0x73ee0189c695 in svt_av1_enc_init (/home/parsa/vvc/svt-av1-psy/Bin/Release/libSvtAv1Enc.so.2+0x9c695) (BuildId: 68bd6575c8a5abb12088d8c2c8688e477a8b5e41)
    #3 0x5f9824e6efd2 in init_encoder (/home/parsa/SSD/vvc/svt-av1-psy/Bin/Release/SvtAv1EncApp+0x185fd2) (BuildId: 2352669617441f7e564167e795889197c2c64363)
    #4 0x5f9824e71da3 in main (/home/parsa/SSD/vvc/svt-av1-psy/Bin/Release/SvtAv1EncApp+0x188da3) (BuildId: 2352669617441f7e564167e795889197c2c64363)
    #5 0x73ee01545e07  (/usr/lib/libc.so.6+0x25e07) (BuildId: 98b3d8e0b8c534c769cb871c438b4f8f3a8e4bf3)
    #6 0x73ee01545ecb in __libc_start_main (/usr/lib/libc.so.6+0x25ecb) (BuildId: 98b3d8e0b8c534c769cb871c438b4f8f3a8e4bf3)
    #7 0x5f9824d262c4 in _start (/home/parsa/SSD/vvc/svt-av1-psy/Bin/Release/SvtAv1EncApp+0x3d2c4) (BuildId: 2352669617441f7e564167e795889197c2c64363)

==45842==ABORTING

Here is the result after compiling with AddressSanitizer.

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

No branches or pull requests

3 participants