rui314 / mold

Mold: A Modern Linker 🦠
MIT License
13.69k stars 448 forks source link

x86_64-exception-multiple-ehframe test failure #1274

Closed thesamesam closed 1 week ago

thesamesam commented 3 weeks ago

The x86_64-exception-multiple-ehframe test in mold-2.4.1 fails with -D_GLIBCXX_ASSERTIONS for me on amd64 with GCC 14/15 :

[...]
+ cat
+ g++-14 -o out/test/elf/x86_64/exception-multiple-ehframe/a.o -c -xc++ -
+ cat
+ g++-14 -o out/test/elf/x86_64/exception-multiple-ehframe/b.o -c -xc++ -
+ objcopy --rename-section .eh_frame=.eh_frame2 out/test/elf/x86_64/exception-multiple-ehframe/a.o
+ ./mold -r -o out/test/elf/x86_64/exception-multiple-ehframe/c.o out/test/elf/x86_64/exception-multiple-ehframe/a.o out/test/elf/x86_64/exception-multiple-ehframe/b.o
+ objcopy --rename-section .eh_frame2=.eh_frame out/test/elf/x86_64/exception-multiple-ehframe/c.o
+ cat
+ g++-14 -o out/test/elf/x86_64/exception-multiple-ehframe/d.o -c -xc++ -
+ g++-14 -B. -o out/test/elf/x86_64/exception-multiple-ehframe/exe1 out/test/elf/x86_64/exception-multiple-ehframe/d.o out/test/elf/x86_64/exception-multiple-ehframe/c.o
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/span:286: constexpr std::span<_Type, _Extent>::element_type& std::span<_Type, _Extent>::operator[](size_type) const [with _Type = mold::elf::ElfShdr<mold::elf::X86_64>; long unsigned int _Extent = 18446744073709551615; reference = mold::elf::ElfShdr<mold::elf::X86_64>&; size_type = long unsigned int]: Assertion '__idx < size()' failed.
collect2: fatal error: ld terminated with signal 6 [Aborted], core dumped
compilation terminated.
++ on_error 46
++ code=1
[...]
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/span:286: constexpr std::span<_Type, _Extent>::element_type& std::span<_Type[New Thread 0x7ffff1dfd6c0 (LWP 890356)]
, _Extent>::operator[](size_type) const [with _Type = mold::elf::ElfShdr<mold::elf::X86_64>; long unsigned int _Extent = 18446744073709551615; reference = mold::elf::ElfShdr<mold::elf::X86_64>&; size_type = long unsigned int]: Assertion '__idx < size()' failed.

Thread 6.2 "ld" received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff71396c0 (LWP 890345)]
0x00007ffff78a220b in pthread_kill () from /usr/lib64/libc.so.6
(gdb) bt
#0  0x00007ffff78a220b in pthread_kill () from /usr/lib64/libc.so.6
#1  0x00007ffff7844b42 in raise () from /usr/lib64/libc.so.6
#2  0x00007ffff78274f2 in abort () from /usr/lib64/libc.so.6
#3  0x00007ffff7ae5cf1 in std::__glibcxx_assert_fail (file=file@entry=0x55555648ee40 "/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/span", line=line@entry=286,
function=function@entry=0x5555564a05f0 "constexpr std::span<_Type, _Extent>::element_type& std::span<_Type, _Extent>::operator[](size_type) const [with _Type = mold::elf::ElfShdr<mold::elf::X86_64>; long unsigned int _Extent = 1844674407370"..., condition=condition@entry=0x5555564870a9 "__idx < size()")
at /usr/src/debug/sys-devel/gcc-15.0.9999/gcc-15.0.9999/libstdc++-v3/src/c++11/assert_fail.cc:41
#4  0x000055555590f5af in std::span<mold::elf::ElfShdr<mold::elf::X86_64>, 18446744073709551615ul>::operator[] (this=<optimized out>, __idx=<optimized out>, this=<optimized out>,
__idx=<optimized out>) at /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/span:286
#5  mold::elf::ObjectFile<mold::elf::X86_64>::initialize_symbols (this=this@entry=0x200001d0e00, ctx=...) at /var/tmp/portage/sys-devel/mold-2.4.1/work/mold-2.4.1/elf/input-files.cc:573
#6  0x000055555590fe6f in mold::elf::ObjectFile<mold::elf::X86_64>::parse (this=0x200001d0e00, ctx=...) at /var/tmp/portage/sys-devel/mold-2.4.1/work/mold-2.4.1/elf/input-files.cc:928
#7  0x0000555555af11d7 in operator() (__closure=0x7ffff7727840) at /var/tmp/portage/sys-devel/mold-2.4.1/work/mold-2.4.1/elf/main.cc:122
#8  tbb::detail::d2::(anonymous namespace)::task_ptr_or_nullptr<const mold::elf::new_object_file<X86_64>(Context<X86_64>&, mold::MappedFile<Context<X86_64> >*, std::string)::<lambda()>&>(f=...) at /usr/include/oneapi/tbb/task_group.h:132
#9  tbb::detail::d1::function_task<mold::elf::new_object_file<X86_64>(Context<X86_64>&, mold::MappedFile<Context<X86_64> >*, std::string)::<lambda()> >::execute(tbb::detail::d1::execution_data &) (this=0x7ffff7727800, ed=...) at /usr/include/oneapi/tbb/task_group.h:452
#10 0x00007ffff7dd3344 in tbb::detail::r1::task_dispatcher::local_wait_for_all<false, tbb::detail::r1::outermost_worker_waiter> (t=0x7ffff7727800, this=0x7ffff744a480, waiter=...)
at /usr/src/debug/dev-cpp/tbb-2021.12.0/oneTBB-2021.12.0/src/tbb/task_dispatcher.h:323
#11 tbb::detail::r1::task_dispatcher::local_wait_for_all<tbb::detail::r1::outermost_worker_waiter> (t=0x0, this=0x7ffff744a480, waiter=...)
at /usr/src/debug/dev-cpp/tbb-2021.12.0/oneTBB-2021.12.0/src/tbb/task_dispatcher.h:459
#12 tbb::detail::r1::arena::process (this=<optimized out>, tls=...) at /usr/src/debug/dev-cpp/tbb-2021.12.0/oneTBB-2021.12.0/src/tbb/arena.cpp:218
#13 tbb::detail::r1::thread_dispatcher_client::process (this=<optimized out>, td=...) at /usr/src/debug/dev-cpp/tbb-2021.12.0/oneTBB-2021.12.0/src/tbb/thread_dispatcher_client.h:36
#14 tbb::detail::r1::thread_dispatcher::process (this=0x7ffff7727f00, j=...) at /usr/src/debug/dev-cpp/tbb-2021.12.0/oneTBB-2021.12.0/src/tbb/thread_dispatcher.cpp:183
#15 0x00007ffff7dc60ae in tbb::detail::r1::rml::private_worker::run (this=0x7ffff7445080) at /usr/src/debug/dev-cpp/tbb-2021.12.0/oneTBB-2021.12.0/src/tbb/private_server.cpp:271
#16 tbb::detail::r1::rml::private_worker::thread_routine (arg=0x7ffff7445080) at /usr/src/debug/dev-cpp/tbb-2021.12.0/oneTBB-2021.12.0/src/tbb/private_server.cpp:221
#17 0x00007ffff78a037a in ?? () from /usr/lib64/libc.so.6
#18 0x00007ffff7922848 in ?? () from /usr/lib64/libc.so.6
rui314 commented 3 weeks ago

Can you try again with the latest version, 2.32.0?

thesamesam commented 1 week ago

Yes, it's fine! Sorry, I have no idea why I tried that version. I must have looked at the wrong number in the list.