Closed vi closed 1 day ago
Hey! Thanks for the detailed issue report. We'll be looking into this ASAP.
Hello. We'd like to know what CPU you're running svt-av1-psy on because I am not able to reproduce this with Clang 18 and GCC 14 from Presets -1 to 12.
I have a 5900X (Zen 3) chip on the latest CachyOS kernel for reference.
If we can find what it is exactly, we'll revert the patches and try to fix them if it is down to a specific CPU architecture.
Additionally, build arguments (which are requested by the issue template) and an example video to reproduce the crash would be great to have - thanks
There are no funny build arguments. It reproduces both in release and debug - as expected, as SIMD is involved.
Here is a random compile command from ninja -v
:
[10/256] /usr/bin/cc -DARCH_X86_64=1 -DEN_AVX512_SUPPORT=0 -DEXCLUDE_HASH=0 -DHAVE_BUILTIN_EXPECT=1 -DHAVE_VALGRIND_H=1 -DREPRODUCIBLE_BUILDS=0 -DSAFECLIB_STR_NULL_SLACK=1 -I/home/vi/src/svt-av1-psy/. -I/home/vi/src/svt-av1-psy/Source/API -I/home/vi/src/svt-av1-psy/Source/Lib/Codec -I/home/vi/src/svt-av1-psy/Source/Lib/C_DEFAULT -I/home/vi/src/svt-av1-psy/third_party/fastfeat -I/home/vi/src/svt-av1-psy/Source/Lib/Globals -I/home/vi/src/svt-av1-psy/Source/Lib/ASM_SSE2 -I/home/vi/src/svt-av1-psy/Source/Lib/ASM_SSSE3 -I/home/vi/src/svt-av1-psy/Source/Lib/ASM_SSE4_1 -I/home/vi/src/svt-av1-psy/Source/Lib/ASM_AVX2 -I/home/vi/src/svt-av1-psy/Source/Lib/ASM_AVX512 -I/home/vi/src/svt-av1-psy/third_party/cpuinfo/include -fno-stack-clash-protection -Wall -Wextra -Wformat -Wformat-security -ggdb -fstack-protector-strong -mno-avx -O3 -DNDEBUG -fPIC -fvisibility=hidden -std=gnu99 -MD -MT Source/Lib/Codec/CMakeFiles/CODEC.dir/block_structures.c.o -MF Source/Lib/Codec/CMakeFiles/CODEC.dir/block_structures.c.o.d -o Source/Lib/Codec/CMakeFiles/CODEC.dir/block_structures.c.o -c /home/vi/src/svt-av1-psy/Source/Lib/Codec/block_structures.c
requested by the issue template
Maybe the template should show the method how to obtain them. After multiple cmake-gui .
reconfigs it may be tricky to remember the actual set of build options. Should reports post the entire CMakeCache.txt
?
Thanks for providing the build arguments. Do you have a sample video?
Attached a minified sample input that crashes (when the commit is included). Actual content is removed in hex editor, everything is replaced by plain colours. If all the frames are the same colour though it does not crash, so one of the frames uses another byte value to make it different.
If needed, I can include a full core dump with debug symbols.
Just adding to this, I have the same issue with both Zen 2 and 4 CPUs, reverting https://github.com/gianni-rosato/svt-av1-psy/commit/f14607b838218174a00c414d6d8b4e35de7ed2f3 fixes the issue for both. It crashes with Segmentation Fault.
Edit: It crashes with the stefan_sif.y4m test video: SvtAv1EncApp -i stefan_sif.y4m -b stefan_sif.ivf --preset 2 --tune 0
Edit 2: Crashes on Zen 3 also, see last cpuinfo. Reverting f14607b fixes the crash on this CPU.
Thanks for your patience. This has been reverted with ee7c9d2a7b67853d982e3f06cf0253def4b6b754 in testing
for now - we're going to continue to investigate the issue, and if an appropriate resolution cannot be determined, we'll revert on master
as well.
I can reproduce the bug if I compile with default settings, which are just O3 and DNDEBUG in a release build. I was using aggressive optimizations in my testing before, which means the aligned stores were likely getting converted to unaligned stores, bypassing the bug.
Reverted with bb886b2936a4020c9ff2e05fd5ceb6f0ba8c8f39 - let us know if you find anything else. Thanks for the detailed issue report, we appreciate it!
I was using aggressive optimizations in my testing before, which means the aligned stores were likely getting converted to unaligned stores, bypassing the bug.
What was/is the optimization you used to circumevent the bug? Thanks.
Shall v2.2.1-C
or v2.2.1-B.1
be tagged to avoid the bug affecting the last named release?
Note: the bug also affects the pre-built https://github.com/gianni-rosato/svt-av1-psy/releases/download/v2.2.1-B/SvtAv1EncApp-Linux-x86_64.tzst .
Overview
I encode video that begins with
YUV4MPEG2 W1920 H1080 F30:1 Ip A1:1 C420mpeg2 XYSCSS=420MPEG2 XCOLORRANGE=LIMITED
using command line likeSvtAv1EncApp --passes 1 --rc 1 --crf 55 -b y.ivf -i - --keyint 2000 --preset 2 --tune 3
and it crashes. Some output is produced, but is unplayable (maybe a trimmed file).Actually most of the options are irrelevant, it crashes even with just
-b y.ivf -i - --preset 2
.Branch In which branch does the issue appear to be occurring?
master
954f7266bf07d526d701de314534395af3c4b90btesting
When built from
v2.2.1-A
is does not crash.git bisect
is pointing at commit f14607b838218174a00c414d6d8b4e35de7ed2f3 where it starts crashing. Reverting this commit resolves the crash.Terminal Output If applicable, add terminal output to help explain your problem.
Platform (please complete the following information):
uname -mnoprs
)clang --version
or GCC equivalent)./build.sh [args]
that you used to build the problematic binary)Linux hostname 6.1.0-23-amd64 x86_64 unknown GNU/Linux
gcc (Debian 12.2.0-14) 12.2.0
Version String (please complete the following information):
SvtAv1EncApp --version
and copy the result:here
Additional context / Relevant Files
Backtrace from core dump
``` Program terminated with signal SIGSEGV, Segmentation fault. #0 0x00007f24df872758 in _mm256_store_si256 (__A=..., __P=0x55fef64251d0) at /usr/lib/gcc/x86_64-linux-gnu/12/include/avxintrin.h:923 923 *__P = __A; [Current thread is 1 (Thread 0x7f24831b76c0 (LWP 23369))] #0 0x00007f24df872758 in _mm256_store_si256 (__A=..., __P=0x55fef64251d0) at /usr/lib/gcc/x86_64-linux-gnu/12/include/avxintrin.h:923 No locals. #1 subtract32_avx2 (diff_ptr=0x55fef64251d0, src_ptr=0x7f249a1e5708 "\352\352\352\352\352\351", '\352'