https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/ Issue: media-libs/roc-toolkit-0.4.0 fails tests. Discovered on: amd64 (internal ref: gcc15_tinderbox) System: GCC-15-SYSTEM (https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#GCC-15) Info about the issue: https://wiki.gentoo.org/wiki/Project:Tinderbox/Common_Issues_Helper#CF0015
Created attachment 906236 [details] build.log build log and emerge --info
Reproduced. Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7f60f60 in of_ldpc_staircase_build_repair_symbol () from /usr/lib64/libopenfec.so.1 (gdb) bt #0 0x00007ffff7f60f60 in of_ldpc_staircase_build_repair_symbol () from /usr/lib64/libopenfec.so.1 #1 0x00005555555f4a5a in roc::fec::OpenfecEncoder::fill (this=0x5555556c84e8) at src/internal_modules/roc_fec/target_openfec/roc_fec/openfec_encoder.cpp:131 #2 0x00005555555b0bb9 in roc::fec::Codec::encode (n_source=10, n_repair=20, this=0x7fffffffd7f0, p_size=<optimized out>) at src/tests/roc_fec/test_encoder_decoder.cpp:49 #3 roc::fec::TEST_encoder_decoder_full_repair_payload_sizes_Test::testBody (this=<optimized out>) at src/tests/roc_fec/test_encoder_decoder.cpp:207 #4 0x0000555555696a8f in PlatformSpecificSetJmpImplementation (function=0x5555556f2130, data=0x5555556c8ff8) at ../../../../dev-util/cpputest-4.0/work/cpputest-4.0/src/Platforms/Gcc/UtestPlatform.cpp:167 #5 0x0000555555697446 in Utest::run (this=0x5555556f2130) at ../../../../dev-util/cpputest-4.0/work/cpputest-4.0/src/CppUTest/Utest.cpp:606 #6 0x00005555556976bf in UtestShell::runOneTestInCurrentProcess (this=0x5555556f2130, plugin=0x5555556c8ff8, result=...) at ../../../../dev-util/cpputest-4.0/work/cpputest-4.0/src/CppUTest/Utest.cpp:216 #7 0x0000555555696a8f in PlatformSpecificSetJmpImplementation (function=0x5555556f2130, data=0x5555556c8ff8) at ../../../../dev-util/cpputest-4.0/work/cpputest-4.0/src/Platforms/Gcc/UtestPlatform.cpp:167 #8 0x00005555555fb64c in main (argc=<optimized out>, argv=<optimized out>) at ../../../../dev-util/cpputest-4.0/work/cpputest-4.0/src/CppUTest/Utest.cpp:185
Program received signal SIGSEGV, Segmentation fault. of_add_to_symbol (to=<optimized out>, from=0x5555556c8ff8, symbol_size=16) at /usr/src/debug/media-libs/openfec-1.4.2.11/openfec-1.4.2.11/src/lib_common/linear_binary_codes_utils/of_symbol.c:655 655 a = _mm_xor_ps (a, b); (gdb) bt #0 of_add_to_symbol (to=<optimized out>, from=0x5555556c8ff8, symbol_size=16) at /usr/src/debug/media-libs/openfec-1.4.2.11/openfec-1.4.2.11/src/lib_common/linear_binary_codes_utils/of_symbol.c:655 #1 of_ldpc_staircase_build_repair_symbol (ofcb=0x5555556daf60, encoding_symbols_tab=0x5555556e7898, esi_of_symbol_to_build=<optimized out>) at /usr/src/debug/media-libs/openfec-1.4.2.11/openfec-1.4.2.11/src/lib_stable/ldpc_staircase/of_ldpc_staircase_api.c:411 #2 0x00005555555f4a5a in roc::fec::OpenfecEncoder::fill (this=0x5555556c84e8) at src/internal_modules/roc_fec/target_openfec/roc_fec/openfec_encoder.cpp:131 #3 0x00005555555b0bb9 in roc::fec::Codec::encode (n_source=10, n_repair=20, this=0x7fffffffd7f0, p_size=<optimized out>) at src/tests/roc_fec/test_encoder_decoder.cpp:49 #4 roc::fec::TEST_encoder_decoder_full_repair_payload_sizes_Test::testBody (this=<optimized out>) at src/tests/roc_fec/test_encoder_decoder.cpp:207 #5 0x0000555555696a8f in PlatformSpecificSetJmpImplementation (function=0x5555556f2130, data=0x5555556c8ff8) at ../../../../dev-util/cpputest-4.0/work/cpputest-4.0/src/Platforms/Gcc/UtestPlatform.cpp:167 #6 0x0000555555697446 in Utest::run (this=0x5555556f2130) at ../../../../dev-util/cpputest-4.0/work/cpputest-4.0/src/CppUTest/Utest.cpp:606 #7 0x00005555556976bf in UtestShell::runOneTestInCurrentProcess (this=0x5555556f2130, plugin=0x5555556c8ff8, result=...) at ../../../../dev-util/cpputest-4.0/work/cpputest-4.0/src/CppUTest/Utest.cpp:216 #8 0x0000555555696a8f in PlatformSpecificSetJmpImplementation (function=0x5555556f2130, data=0x5555556c8ff8) at ../../../../dev-util/cpputest-4.0/work/cpputest-4.0/src/Platforms/Gcc/UtestPlatform.cpp:167 #9 0x00005555555fb64c in main (argc=<optimized out>, argv=<optimized out>) at ../../../../dev-util/cpputest-4.0/work/cpputest-4.0/src/CppUTest/Utest.cpp:185 (gdb)
Before that test, we also have: -- before runAllPreTestAction: -- after runAllPreTestAction: ---- before createTest: ---- after createTest: ------ before runTest: -------- before setup: -------- after setup: ---------- before body: ---------- after body: -------- before teardown: -------- after teardown: ------ after runTest: ---- before destroyTest: ==2766073== Mismatched free() / delete / delete [] ==2766073== at 0x484C99F: operator delete(void*) (vg_replace_malloc.c:1131) ==2766073== by 0x24B70D: destroyTest (Utest.cpp:195) ==2766073== by 0x24B70D: UtestShell::runOneTestInCurrentProcess(TestPlugin*, TestResult&) (Utest.cpp:223) ==2766073== by 0x24AA8E: PlatformSpecificSetJmpImplementation.lto_priv.0 (UtestPlatform.cpp:167) ==2766073== by 0x1AF64B: UnknownInlinedFun (Utest.cpp:185) ==2766073== by 0x1AF64B: UnknownInlinedFun (TestRegistry.cpp:63) ==2766073== by 0x1AF64B: UnknownInlinedFun (CommandLineTestRunner.cpp:138) ==2766073== by 0x1AF64B: UnknownInlinedFun (CommandLineTestRunner.cpp:82) ==2766073== by 0x1AF64B: UnknownInlinedFun (CommandLineTestRunner.cpp:52) ==2766073== by 0x1AF64B: main (test_main.cpp:56) ==2766073== Address 0x4eba940 is 0 bytes inside a block of size 8 alloc'd ==2766073== at 0x4848B93: malloc (vg_replace_malloc.c:446) ==2766073== by 0x23CB38: normal_operator_new(unsigned long) [clone .lto_priv.0] (MemoryLeakWarningPlugin.cpp:248) ==2766073== by 0x15C9DE: UnknownInlinedFun (MemoryLeakWarningPlugin.cpp:317) ==2766073== by 0x15C9DE: roc::fec::TEST_composer_packet_size_TestShell::createTest() (test_composer.cpp:109) ==2766073== by 0x24B691: UtestShell::runOneTestInCurrentProcess(TestPlugin*, TestResult&) (Utest.cpp:212) ==2766073== by 0x24AA8E: PlatformSpecificSetJmpImplementation.lto_priv.0 (UtestPlatform.cpp:167) ==2766073== by 0x1AF64B: UnknownInlinedFun (Utest.cpp:185) ==2766073== by 0x1AF64B: UnknownInlinedFun (TestRegistry.cpp:63) ==2766073== by 0x1AF64B: UnknownInlinedFun (CommandLineTestRunner.cpp:138) ==2766073== by 0x1AF64B: UnknownInlinedFun (CommandLineTestRunner.cpp:82) ==2766073== by 0x1AF64B: UnknownInlinedFun (CommandLineTestRunner.cpp:52) ==2766073== by 0x1AF64B: main (test_main.cpp:56) ==2766073== but there's a crash handler which shows up for the other test.
Killing the crash handler: -------- after setup: ---------- before body: ==2793039== ==2793039== Process terminating with default action of signal 11 (SIGSEGV): dumping core ==2793039== General Protection Fault ==2793039== at 0x48CAF60: UnknownInlinedFun (xmmintrin.h:285) ==2793039== by 0x48CAF60: UnknownInlinedFun (of_symbol.c:655) ==2793039== by 0x48CAF60: of_ldpc_staircase_build_repair_symbol (of_ldpc_staircase_api.c:411) ==2793039== by 0x1A8779: roc::fec::OpenfecEncoder::fill() (openfec_encoder.cpp:131) ==2793039== by 0x164868: UnknownInlinedFun (test_encoder_decoder.cpp:49) ==2793039== by 0x164868: roc::fec::TEST_encoder_decoder_full_repair_payload_sizes_Test::testBody() (test_encoder_decoder.cpp:207) ==2793039== by 0x24AA0E: PlatformSpecificSetJmpImplementation.lto_priv.0 (UtestPlatform.cpp:167) ==2793039== by 0x24B1C5: Utest::run() (Utest.cpp:606) ==2793039== by 0x24B43E: UtestShell::runOneTestInCurrentProcess(TestPlugin*, TestResult&) (Utest.cpp:216) ==2793039== by 0x24AA0E: PlatformSpecificSetJmpImplementation.lto_priv.0 (UtestPlatform.cpp:167) ==2793039== by 0x1AF2BB: UnknownInlinedFun (Utest.cpp:185) ==2793039== by 0x1AF2BB: UnknownInlinedFun (TestRegistry.cpp:63) ==2793039== by 0x1AF2BB: UnknownInlinedFun (CommandLineTestRunner.cpp:138) ==2793039== by 0x1AF2BB: UnknownInlinedFun (CommandLineTestRunner.cpp:82) ==2793039== by 0x1AF2BB: UnknownInlinedFun (CommandLineTestRunner.cpp:52) ==2793039== by 0x1AF2BB: main (test_main.cpp:56)
---------- before body: ==2972359== ==2972359== Process terminating with default action of signal 11 (SIGSEGV): dumping core ==2972359== General Protection Fault ==2972359== at 0x4905520: _mm_load_ps (xmmintrin.h:974) ==2972359== by 0x4905520: of_add_to_symbol (of_symbol.c:654) ==2972359== by 0x490774D: of_ldpc_staircase_build_repair_symbol (of_ldpc_staircase_api.c:411) ==2972359== by 0x4905BC4: of_build_repair_symbol (of_openfec_api.c:384) ==2972359== by 0x137CB5: roc::fec::OpenfecEncoder::fill() (openfec_encoder.cpp:131) ==2972359== by 0x135CA8: roc::fec::Writer::encode_repair_packets_() (writer.cpp:260) ==2972359== by 0x135F1A: roc::fec::Writer::end_block_() (writer.cpp:158) ==2972359== by 0x136037: roc::fec::Writer::write(roc::core::SharedPtr<roc::packet::Packet, roc::core::RefCountedOwnership> const&) (writer.cpp:128) ==2972359== by 0x12E675: roc::fec::TEST_writer_reader_failed_to_read_repair_packet_Test::testBody() (test_writer_reader.cpp:3171) ==2972359== by 0x1A758F: PlatformSpecificSetJmpImplementation (in /var/tmp/portage/media-libs/roc-toolkit-0.4.0/work/roc-toolkit-0.4.0/bin/x86_64-pc-linux-gnu/roc-test-fec) ==2972359== by 0x1A687B: Utest::run() (in /var/tmp/portage/media-libs/roc-toolkit-0.4.0/work/roc-toolkit-0.4.0/bin/x86_64-pc-linux-gnu/roc-test-fec) ==2972359== by 0x1A605E: UtestShell::runOneTestInCurrentProcess(TestPlugin*, TestResult&) (in /var/tmp/portage/media-libs/roc-toolkit-0.4.0/work/roc-toolkit-0.4.0/bin/x86_64-pc-linux-gnu/roc-test-fec) ==2972359== by 0x1A758F: PlatformSpecificSetJmpImplementation (in /var/tmp/portage/media-libs/roc-toolkit-0.4.0/work/roc-toolkit-0.4.0/bin/x86_64-pc-linux-gnu/roc-test-fec) ==2972359==
I don't get why this has started yet. If I build openfec+roc-toolkit with clang or gcc 14, it still fails, but I am convinced this passed before.
"Loads four SP FP values. The address must be 16-byte-aligned." but it is aligned? Program received signal SIGSEGV, Segmentation fault. of_add_to_symbol (to=to@entry=0x5555556af190, from=<optimized out>, symbol_size=<optimized out>) at /usr/src/debug/media-libs/openfec-1.4.2.11/openfec-1.4.2.11/src/lib_common/linear_binary_codes_utils/of_symbol.c:653 653 a = _mm_load_ps (dst128); (gdb) p dst128 $1 = (float *) 0x5555556af190
I get loads of ubsan issues in openfec's tests, like encoding_end=1729245940.458667 encoding_time=0.345245 decoding_start=1729245940.458683 /var/tmp/portage/media-libs/openfec-1.4.2.11/work/openfec-1.4.2.11/src/lib_stable/reed-solomon_gf_2_8/of_reed-solomon_gf_2_8.c:394:3: runtime error: load of misaligned address 0x5761b223920c for type 'long long unsigned int', which requires 8 byte alignment 0x5761b223920c: note: pointer points here 99 76 12 e1 c8 4e 24 d6 14 5b 28 cb bf d7 3f 0b c7 ce 09 0d 22 8f 06 18 7d 48 a7 da 0d c3 cb ad ^ #0 0x7e54dd5d4e1f in of_addmul1 /var/tmp/portage/media-libs/openfec-1.4.2.11/work/openfec-1.4.2.11/src/lib_stable/reed-solomon_gf_2_8/of_reed-solomon_gf_2_8.c:394 #1 0x7e54dd5d7b61 in of_invert_mat /var/tmp/portage/media-libs/openfec-1.4.2.11/work/openfec-1.4.2.11/src/lib_stable/reed-solomon_gf_2_8/of_reed-solomon_gf_2_8.c:631 #2 0x7e54dd5d8880 in of_build_decode_matrix /var/tmp/portage/media-libs/openfec-1.4.2.11/work/openfec-1.4.2.11/src/lib_stable/reed-solomon_gf_2_8/of_reed-solomon_gf_2_8.c:1004 #3 0x7e54dd5da010 in of_rs_decode /var/tmp/portage/media-libs/openfec-1.4.2.11/work/openfec-1.4.2.11/src/lib_stable/reed-solomon_gf_2_8/of_reed-solomon_gf_2_8.c:1056 #4 0x7e54dd5dc191 in of_rs_finish_decoding /var/tmp/portage/media-libs/openfec-1.4.2.11/work/openfec-1.4.2.11/src/lib_stable/reed-solomon_gf_2_8/of_reed-solomon_gf_2_8_api.c:383 #5 0x7e54dd5dc8f1 in of_rs_decode_with_new_symbol /var/tmp/portage/media-libs/openfec-1.4.2.11/work/openfec-1.4.2.11/src/lib_stable/reed-solomon_gf_2_8/of_reed-solomon_gf_2_8_api.c:234 #6 0x7e54dd5cc879 in of_decode_with_new_symbol /var/tmp/portage/media-libs/openfec-1.4.2.11/work/openfec-1.4.2.11/src/lib_common/of_openfec_api.c:442 #7 0x57619c8054e3 in receive_and_decode /var/tmp/portage/media-libs/openfec-1.4.2.11/work/openfec-1.4.2.11/applis/eperftool/receiver.c:156 #8 0x57619c8049bc in start_enc_dec_test /var/tmp/portage/media-libs/openfec-1.4.2.11/work/openfec-1.4.2.11/applis/eperftool/eperftool.c:268 #9 0x57619c804d6f in main /var/tmp/portage/media-libs/openfec-1.4.2.11/work/openfec-1.4.2.11/applis/eperftool/eperftool.c:71 #10 0x7e54dcc03746 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 #11 0x7e54dcc037f6 in __libc_start_main_impl ../csu/libc-start.c:360 #12 0x57619c800dc0 in _start (/var/tmp/portage/media-libs/openfec-1.4.2.11/work/openfec-1.4.2.11/bin/RelWithDebInfo/eperftool+0x5dc0)
(In reply to Sam James from comment #7) > I don't get why this has started yet. If I build openfec+roc-toolkit with > clang or gcc 14, it still fails, but I am convinced this passed before. It's way simpler than that: I only recently wired up the SSE opts when bumping to 1.4.2.11 in 227692ec4ba10518af189271ef44b26ea083bf95 and I didn't test roc-toolkit after doing so (note that openfec's own tests pass).
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=575c619db86d40fa8ccc5889464b82c0e0fae647 commit 575c619db86d40fa8ccc5889464b82c0e0fae647 Author: Sam James <sam@gentoo.org> AuthorDate: 2024-10-18 10:14:39 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-10-18 10:17:27 +0000 media-libs/openfec: disable SSE asm There's a bunch of UBSAN issues in openfec and it shows up as roc-toolkit's tests segfaulting. Bug: https://github.com/roc-streaming/openfec/issues/22 Closes: https://bugs.gentoo.org/941750 Signed-off-by: Sam James <sam@gentoo.org> .../openfec/{openfec-1.4.2.11.ebuild => openfec-1.4.2.11-r1.ebuild} | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)