Skip to content

Segfault in _Unwind_Backtrace when using compiler-rt #93360

Closed as not planned
Closed as not planned
@SchrodingerZhu

Description

@SchrodingerZhu

The error was similar as #47551, but it was not exactly the same.

To make sure full LLVM env on Linux, I tried something like:

#!/usr/bin/env bash
/usr/local/bin/clang++ -rtlib=compiler-rt -unwindlib=libunwind -stdlib=libc++ -Wl,-Bdynamic -l:libunwind.so -l:libc++abi.so -l:libc++.so /usr/local/lib/clang/13.0.0/lib/x86_64-unknown-linux-gnu/libclang_rt.builtins.a ${@//*gcc_s*}

and used it as the linker.
Everything is working except that the program crashes in unwinding progress.
image

I have already posted a related thread at LLVM's discourse (please refer this link for more inspections on eh_frame sections): https://llvm.discourse.group/t/segfault-in-libunwind-during-cpu-profiling/5806. But given #47551, I think rustc can also be a cause of the problem.

I have already switched back to shared linkage as it is shown in the script above, but the problem persists, just in different frames.

Versions

LLVM 13.0.0
Rust nightly-2021-04-15

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-discussionCategory: Discussion or questions that doesn't represent real issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions