Skip to content

ExecutionEngine/JITLink/RISCV/ELF_ehframe.s fails on AArch64 Linux with libstdc++'s expensive checks #73935

Closed
@DavidSpickett

Description

@DavidSpickett
/usr/lib/gcc/aarch64-linux-gnu/10/../../../../include/c++/10/bits/stl_algo.h:2243:
In function:
    pair<_ForwardIterator, _ForwardIterator>
    std::equal_range(_ForwardIterator, _ForwardIterator, const _Tp &,
    _Compare) [_ForwardIterator =
    __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<const
    llvm::jitlink::Edge *, std::__cxx1998::vector<llvm::jitlink::Edge>>,
    std::vector<llvm::jitlink::Edge>, std::random_access_iterator_tag>, _Tp
    = unsigned long, _Compare = Comp]

Error: elements in iterator range [__first, __last) are not partitioned by
the predicate __comp and value __val.

Objects involved in the operation:
    iterator "__first" @ 0x0xffffe6cb7850 {
      state = dereferenceable (start-of-sequence);
      references sequence @ 0x0xaaaac3da8f88
    }
    iterator "__last" @ 0x0xffffe6cb77d8 {
      state = past-the-end;
      references sequence @ 0x0xaaaac3da8f88
    }
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /home/david.spickett/build-llvm-aarch64/bin/llvm-jitlink -noexec -phony-externals -debug-only=jitlink /home/david.spickett/build-llvm-aarch64/test/ExecutionEngine/JITLink/RISCV/Output/ELF_ehframe.s.tmp.32.o
 #0 0x0000aaaac05b2860 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/david.spickett/build-llvm-aarch64/bin/llvm-jitlink+0xd1c860)
 #1 0x0000aaaac05b0554 llvm::sys::RunSignalHandlers() (/home/david.spickett/build-llvm-aarch64/bin/llvm-jitlink+0xd1a554)
 #2 0x0000aaaac05b2f98 SignalHandler(int) Signals.cpp:0:0
 #3 0x0000ffffacfad5c0 (linux-vdso.so.1+0x5c0)
 #4 0x0000ffffacac2d78 raise /build/glibc-RIFKjK/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #5 0x0000ffffacaafaac abort /build/glibc-RIFKjK/glibc-2.31/stdlib/abort.c:81:7
 #6 0x0000ffffaccf07f8 (/lib/aarch64-linux-gnu/libstdc++.so.6+0xca7f8)
 #7 0x0000aaaac01adda4 llvm::jitlink::getRISCVPCRelHi20(llvm::jitlink::Edge const&) ELF_riscv.cpp:0:0

Printing out the relocations, I see that the list is not in fact sorted:

Edge, offset = 0xc
Edge, offset = 0x1c
Edge, offset = 0x20
Edge, offset = 0x28
Edge, offset = 0x3c
Edge, offset = 0x4c
Edge, offset = 0x50
Edge, offset = 0x58
Edge, offset = 0x0
Edge, offset = 0x0

Perhaps someone has done a push back instead of insert front?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions