zstd
zstd copied to clipboard
Unclean termination with assertion 'nbFiles >= 1' failed at dibio.c:196
Describe the bug Zstandard crashes with SIGABRT if called with --train but without any files specified.
To Reproduce Steps to reproduce the behavior: tar c * | zstdmt --train -o test.tar.zstd
Expected behavior Given that no files have been provided, ZSTD should cleanly terminate, probably with an error message stating that files are required for training.
Desktop (please complete the following information): Zstandard v1.5.2 x86_64-linux-gnu, Gentoo Linux gcc 11.2.1_p20220115 p4 (Gentoo Hardened) Compiler Flags: -march=native, -fPIC, -O2 Intel Xeon E-2146G (6 cores, 12 threads) Ninja build used by Portage
Additional context This is not a serious bug, but should probably be addressed in any case as the process fails with a stacktrace and SIGABRT. The stack is clean and there is no risk of undefined behaviour, but this error message should probably not be user-facing as it is now.
I believe this issue has been fixed within dev branch:
./zstd --train
! Warning : nb of samples too low for proper processing !
! Please provide _one file per sample_.
! Alternatively, split files into fixed-size blocks representative of samples, with -B#
Error 14 : nb of samples too low
tar c *.md | ./zstd --train
! Warning : nb of samples too low for proper processing !
! Please provide _one file per sample_.
! Alternatively, split files into fixed-size blocks representative of samples, with -B#
Error 14 : nb of samples too low
Once again I forget to check the dev repo before filing an issue lol, sorry about that. You can definitely close the issue, or keep it open until a release comes out with the new behaviour if that works better.