在 Gentoo 中测试 zstd 的未定义行为
** Describe the bug ** A clear and concise description of what the bug is. I was enabling UBSan in Gentoo, and it of course failed with UBSan errors. ** To Reproduce ** Steps to reproduce the behavior: 1. Turn on UBSan flags 2. emerge -av1 app-arch/zstd 3. Tests failed ** Expected behavior ** A clear and concise description of what you expected to happen. Tests pass ** Screenshots and charts ** If applicable, add screenshots and charts to help explain your problem. meson test --print-errorlogs --num-processes 16 --timeout-multiplier=2 ninja: Entering directory `/var/tmp/portage/app-arch/zstd-1.5.7-r1/work/zstd-1.5.7/build/meson-abi_x86_64.amd64' ninja: no work to do. 1/10 zstd:test-invalidDictionaries OK 0.02s 2/10 zstd:test-poolTests OK 0.43s 3/10 zstd:test-longmatch OK 1.83s 4/10 zstd:test-fullbench-2 FAIL 27.53s exit status 1 >>> MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MALLOC_PERTURB_=224 MESON_TEST_ITERATION=1 /var/tmp/portage/app-arch/zstd-1.5.7-r1/work/zstd-1.5.7/build/meson-abi_x86_64.amd64/tests/fullbench -i1 -P0 ―――――――――――――――――――――――――――――――――――― ✀ ――――――――――――――――――――――――――――――――――――― stderr: *** Zstandard speed analyzer 1.5.7 64-bits, by Yann Collet (Sep 10 2026) *** Sample 10000000 bytes : 0#compress : 2741.4 MB/s (10000241) 1#decompress : 5532.4 MB/s (10000000) 2#compress_freshCCtx : 2398.5 MB/s (10000241) 3#decompressDCtx : 3717.3 MB/s (10000000) 4#compressContinue : 2201.5 MB/s (10000241) 5#compressContinue_extDict : 1992.8 MB/s (10000223) 6#decompressContinue : 3029.8 MB/s (10000000) 7#compressStream : 2109.1 MB/s (10000237) 8#compressStream_freshCCtx : 1778.6 MB/s (10000237) 9#decompressStream : 3988.0 MB/s (10000000) 10#compress2 : 2042.0 MB/s (10000241) 11#compressStream2, end : 1892.9 MB/s (10000241) 12#compressStream2, end & short : 1772.1 MB/s (10000241) 13#compressStream2, continue : 2227.2 MB/s (10000237) 14#compressStream2, -T2, continue : 1653.3 MB/s (10000237) 15#compressStream2, -T2, end : 1417.4 MB/s (10000241) 16#compressSequences : 2650.6 MB/s (10000241) ERROR: Scenario 17: This mode cannot generate an uncompressed block ../../programs/benchfn.c:116:13: runtime error: null pointer passed as argument 1, which is declared to never be null #0 0x6350b8cd51be in BMK_benchFunction ../../programs/benchfn.c:116 #1 0x6350b8cfc9b7 in BMK_benchTimedFn ../../programs/benchfn.c:220 #2 0x6350b8cf3157 in benchMem ../../tests/fullbench.c:888 #3 0x6350b8cef061 in benchSample ../../tests/fullbench.c:957 #4 0x6350b8cef061 in main ../../tests/fullbench.c:1202 #5 0x714bafe8d3bd in __libc_start_call_main …
内容来源: facebook/zstd