Skip to content

SIGSEGV (Address boundary error) in openh264 tests with wild #576

@mati865

Description

@mati865

In openh264 checkout (I'm on a bit old 042473ea commit) run:

❯ PATH=~/Projects/wild/:$PATH meson setup builddir

❯ PATH=~/Projects/wild/:$PATH meson test -C builddir
...
1/5 api               FAIL             0.06s   killed by signal 11 SIGSEGV

With ld.bfd it works fine:

❯ meson test
ninja: Entering directory `/home/mateusz/Projects/openh264/builddir'
[173/173] Linking target test/api/test_api
1/5 processing        OK               0.13s
2/5 decoder           OK               1.75s
3/5 encoder           OK               3.88s
4/5 common            OK               4.14s
5/5 api               OK              51.77s

Ok:                 5
Expected Fail:      0
Fail:               0
Unexpected Pass:    0
Skipped:            0
Timeout:            0

Attached the reproducer created with wild:
crash.tgz

Running linker-diff doesn't seem to find the cause:

❯ WILD_REFERENCE_LINKER=ld ./run-with ~/Projects/wild/target/release/wild
WARNING: wild: --plugin /usr/lib/gcc/x86_64-pc-linux-gnu/14.2.1/liblto_plugin.so is not yet supported
wild: ./bin
ref: ./bin.ref-linker
.dynamic.DT_FLAGS_1.NOW
  wild 1
  ref

rel.extra-copy-relocation.R_X86_64_REX_GOTPCRELX
  `./libcommon.a.p/src_welsCodecTrace.cpp.o` .text _ZL15welsStderrTracePviPKc
  ORIG 0x000000: [ 48 8b 05 00 00 00 00 ] mov 7,%rax
                            ^^^^^^^^^^^ R_X86_64_REX_GOTPCRELX
       stderr -4
  wild 0x144920: [ 48 8b 05 49 d9 02 00 ] mov 0x172270,%rax
                            ^^^^^^^^^^^ R_X86_64_REX_GOTPCRELX NoOp
       GOT->COPY(stderr)
  wild TRACE: relocation applied value_flags=DYNAMIC,
  wild TRACE: resolution_flags=DIRECT | GOT | COPY_RELOCATION, rel_kind=GotRelative,
  wild TRACE: value=0x2d949, symbol_name=stderr
  ref  0x119a10: [ 48 8b 05 31 33 05 00 ] mov 0x16CD48,%rax
                            ^^^^^^^^^^^ R_X86_64_REX_GOTPCRELX NoOp
       GOT->R_X86_64_GLOB_DAT->stderr@GLIBC_2.2.5


Error: linker-diff reported errors. To rerun, execute:
/home/mateusz/Projects/wild/target/release/linker-diff --wild-defaults --display-names wild,ref --ref ./bin.ref-linker ./bin

Stack backtrace:
   0: anyhow::error::<impl anyhow::Error>::msg
   1: libwild::diff::maybe_diff
   2: libwild::Linker::run
   3: libwild::subprocess::run_in_subprocess
   4: wild::main
   5: std::sys::backtrace::__rust_begin_short_backtrace
   6: std::rt::lang_start::{{closure}}
   7: std::rt::lang_start_internal
   8: main
   9: <unknown>
  10: __libc_start_main
  11: _start

Backtrace:

Program received signal SIGSEGV, Segmentation fault.
std::basic_ostream<char, std::char_traits<char> >::sentry::sentry (this=0x7fffffffdf20, __os=warning: can't find linker symbol for virtual table for `std::basic_ostream<char, std::char_traits<char> >' value
warning:   found `VTT for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >' instead
...) at /usr/src/debug/gcc/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/ostream.tcc:51
warning: 51	/usr/src/debug/gcc/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/ostream.tcc: Nie ma takiego pliku ani katalogu
(gdb) bt
#0  std::basic_ostream<char, std::char_traits<char> >::sentry::sentry (this=0x7fffffffdf20, __os=warning: can't find linker symbol for virtual table for `std::basic_ostream<char, std::char_traits<char> >' value
warning:   found `VTT for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >' instead
...) at /usr/src/debug/gcc/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/ostream.tcc:51
#1  0x00007ffff7d72df2 in std::basic_ostream<char, std::char_traits<char> >::_M_insert<unsigned long> (this=0x7fffffffe1e0, __v=32) at /usr/src/debug/gcc/gcc-build/x86_64-pc-linux-gnu/libstdc++-v3/include/bits/ostream.tcc:66
#2  0x00007ffff7f371f0 in testing::internal::PrintBytesInObjectTo(unsigned char const*, unsigned long, std::basic_ostream<char, std::char_traits<char> >*) () from /usr/lib/libgtest.so.1.16.0
#3  0x000055555564d3ae in testing::internal::RawBytesPrinter::PrintValue<EncodeDecodeFileParamBase, 32ul> (value=..., os=0x7fffffffe1e0) at /usr/include/gtest/gtest-printers.h:315
#4  testing::internal::PrintWithFallback<EncodeDecodeFileParamBase> (value=..., os=0x7fffffffe1e0) at /usr/include/gtest/gtest-printers.h:362
#5  testing::internal::PrintTo<EncodeDecodeFileParamBase> (value=..., os=0x7fffffffe1e0) at /usr/include/gtest/gtest-printers.h:491
#6  testing::internal::UniversalPrinter<EncodeDecodeFileParamBase>::Print (value=..., os=0x7fffffffe1e0) at /usr/include/gtest/gtest-printers.h:883
#7  testing::internal::UniversalPrint<EncodeDecodeFileParamBase> (value=..., os=0x7fffffffe1e0) at /usr/include/gtest/gtest-printers.h:1187
#8  testing::internal::UniversalTersePrinter<EncodeDecodeFileParamBase>::Print (value=..., os=0x7fffffffe1e0) at /usr/include/gtest/gtest-printers.h:1065
#9  testing::PrintToString<EncodeDecodeFileParamBase> (value=...) at /usr/include/gtest/gtest-printers.h:1225
#10 testing::internal::ParameterizedTestSuiteInfo<EncodeDecodeTestAPI>::RegisterTests (this=<optimized out>) at /usr/include/gtest/internal/gtest-param-util.h:603
#11 0x00007ffff7f54d2d in testing::internal::UnitTestImpl::RegisterParameterizedTests() () from /usr/lib/libgtest.so.1.16.0
#12 0x00007ffff7f656be in testing::internal::UnitTestImpl::PostFlagParsingInit() () from /usr/lib/libgtest.so.1.16.0
#13 0x0000555555697c47 in main (argc=<optimized out>, argv=0x7fffffffe518) at ../test/api/simple_test.cpp:19

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions