-
-
Notifications
You must be signed in to change notification settings - Fork 24
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] regression from 916cabd50bba to v2.3.0-A: crash #114
Comments
Could you test this with 10-bit? I'd be interested to know if it's reproduceable with that, because I can't seem to do so on my end with 10-bit. Will test with 8-bit soon. |
With |
I've been getting a random crash a couple times at different points in the beginning of encode process for the same 10-bit video, but then it worked normally and finished all 4+ hours of encode 🤔 |
Why not just try 8-bit video, where the crash is reproducible for me? |
I think there is something in psy-rd and/or Clang. If I use this command line to test the encoder, it works with the GCC build but adding --psy-rd 1.0 makes it crash at the very beginning with both GCC and Clang. 10-bit source. avs2yuv64.exe -no-mt "startrek_1440p_2.avs" - | C:\svt-av1\svtav1encapp.exe --preset 2 --lp 0 --scm 0 --enable-qm 1 --keyint 10s --film-grain-denoise 0 --sharpness 3 --tile-columns 1 --tile-rows 0 --enable-tf 2 --enable-restoration 1 --enable-cdef 0 --qm-min 2 --qm-max 15 --tune 3 --hierarchical-levels 4 --qp-scale-compress-strength 2 --frame-luma-bias 7 --noise-norm-strength 4 --color-primaries 9 --transfer-characteristics 16 --matrix-coefficients 9 --use-fixed-qindex-offsets 2 --key-frame-qindex-offset 0 --key-frame-chroma-qindex-offset -32 --qindex-offsets [0,0,0,0,0,0] --chroma-qindex-offsets [-32,-32,-32,-32,-32,-32] --chroma-qm-min 10 --chroma-qm-max 15 --film-grain 16 --variance-octile 5 --crf 16 -b NUL -i - |
Here is repro command line I minimized (without the use of real video):
It doesn't reproduce when I use testsrc2 directly, without first going through H.264 for some reason. |
Now it seems completely random, removing psy-rd suddenly doesn't help with GCC either with the exact same clip. |
For some reason, adding |
I compiled a debug build, but it refuses to crash :( |
Maybe the problem is somehow related to FFmpeg. Now it assumes ABI compatibility with svt-av1 or previous version of svt-av1-psy. Maybe I'll try to re-compile it. |
Nope, the crashes happen on the regular Windows command line application as well, also for others. |
I can confirm that 129faba is the one where the crashes start. |
Looks like 8-bit encodes are really messed up, compared to 10-bit, where I've only got crashes on very long encodes. C:\tools\encoding\staxrip\Apps\Support\avs2pipemod\avs2pipemod64.exe -dll=C:\tools\encoding\staxrip\Apps\FrameServer\AviSynth\AviSynth.dll -y4mp Z:\encodes\asdf_temp\asdfd.avs | C:\tools\encoding\staxrip\Apps\Encoders\SvtAv1EncApp\SvtAv1EncApp.exe --input - --output Z:\encodes\asdf_temp\asdfd_out.ivf --width 1920 --height 1080 --frames 184066 --rc 0 --progress 3 --preset 6
Svt[info]: -------------------------------------------
Svt[info]: SVT [version]: SVT-AV1-PSY Encoder Lib v2.3.0-A-dirty
Svt[info]: SVT [build] : Visual Studio 2022 64 bit
Svt[info]: LIB Build date: Dec 26 2024 03:16:22
Svt[info]: -------------------------------------------
avs2pipemod[info]: writing 184066 frames of 25/1 fps, 1920x1080,
sar 0:0, YUV-420-planar-8bit progressive video.
Svt[info]: Level of Parallelism: 5
Svt[info]: Number of PPCS 140
Svt[info]: [asm level on system : up to avx2]
Svt[info]: [asm level selected : up to avx2]
Svt[info]: -------------------------------------------
Svt[info]: SVT [config]: main profile tier (auto) level (auto)
Svt[info]: SVT [config]: width / height / fps numerator / fps denominator : 1920 / 1080 / 25 / 1
Svt[info]: SVT [config]: bit-depth / color format : 8 / YUV420
Svt[info]: SVT [config]: preset / tune / pred struct : 6 / 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 / 35.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
avs2pipemod[info]: total elapsed time is 4.532 sec.
avs2pipemod[error]: only wrote 270 of 184066 frames.
Video encoding returned exit code: -1073741819 (0xC0000005)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It's unclear what this exit code means, in case it's
a Windows system error then it possibly means:
# for decimal -1073741819 / hex 0xc0000005
STATUS_ACCESS_VIOLATION ntstatus.h
# The instruction at 0x%p referenced memory at 0x%p. The
# memory could not be %s.
# as an HRESULT: Severity: FAILURE (1), FACILITY_NULL (0x0), Code 0x5
# for decimal 5 / hex 0x5
ERROR_ACCESS_DENIED winerror.h
# Access is denied. |
I get the crash only for preset 4 and lower, always when processing the second frame, in debug builds as well as release ones. Do you need a valgrind / sanitizer run? |
Yeah, I think that's our best bet. |
Note that a backtrace is already attached in the issue description. Do you need a full core dump? |
Oh no need then. Sorry, it's just that I've been a bit overwhelmed with all of this, considering that the release was done during a holiday. |
Here is
|
Most commits I tried fail the Starting with with bd70bf1 as good commit (that passes the sanitizer), But previous commit 0d32981 still fails with preset 0 with large video size, as well as bd70bf1. Started again (with preset=0 1080p ssim) based on 2aeeb4f as passing commit. Now it pointed to commit 3a7b34c.
Maybe there is a lot of undefined behaviour lurking in the project? |
Injecting mimalloc fixes the crash for me |
|
with statically linked mimalloc it still crashed |
Alas, it doesn't fix it for me - only lowering --lp does. |
Overview
ffmpeg equipped with svt-av1-spy crashes when using low tune, high crf in v2.3.0-A, though it worked before.
Branch
In which branch does the issue appear to be occurring?
master
testing
Reproduction
-g 1800 -c:v libsvtav1 -svtav1-params preset=2:crf=70
parameters.Expected behavior
It produced the video
Terminal Output
If applicable, add terminal output to help explain your problem.
Part of FFmpeg output
Platform (please complete the following information):
Linux hostname 6.1.0-23-amd64 x86_64 unknown GNU/Linux
gcc (Debian 12.2.0-14) 12.2.0
,Debian clang version 14.0.6
(haven't check which is used for the build)./build.sh [args]
that you used to build the problematic binary) - not sure - I am reusing CMake/Ninja build directory after git pull.Version String (please complete the following information):
SvtAv1EncApp --version
and copy the result:SVT-AV1-PSY v2.3.0-A (release) PSY Release: A
Additional context / Relevant Files
git bisect
points to this commit: 129fabaBuilt debug version (with the following patch to make it linkeable):
patch to make it build in debug mode
and obtained this backtrace:
Backtrace
The text was updated successfully, but these errors were encountered: