Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic linking suppresses stackeroverflow detection #110810

Open
Eliah-Lakhin opened this issue Apr 25, 2023 · 7 comments
Open

Dynamic linking suppresses stackeroverflow detection #110810

Eliah-Lakhin opened this issue Apr 25, 2023 · 7 comments
Labels
A-linkage Area: linking into static, shared libraries and binaries A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows A-security Area: Security (example: address space layout randomization). C-bug Category: This is a bug. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@Eliah-Lakhin
Copy link

Code

The crate type is [lib] proc_macro = true. There are no explicit dependencies.

lib.rs code is:

use proc_macro::TokenStream;

#[proc_macro_attribute]
pub fn my_macro(_attr: TokenStream, _item: TokenStream) -> TokenStream {
    fn foo() {
        foo();
    }
    
    foo();

    todo!()
}

Invoking the macro in another crate leads to the following signal: 11, SIGSEGV: invalid memory reference error when compiling that other crate.

Meta

Reproduced on Stable:

rustc 1.69.0 (84c898d65 2023-04-16)
binary: rustc
commit-hash: 84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc
commit-date: 2023-04-16
host: x86_64-unknown-linux-gnu
release: 1.69.0
LLVM version: 15.0.7

And nightly:

rustc --version --verbose
rustc 1.71.0-nightly (f5559e338 2023-04-24)
binary: rustc
commit-hash: f5559e338256f17ada6d82b429acc2dbd8facc9c
commit-date: 2023-04-24
host: x86_64-unknown-linux-gnu
release: 1.71.0-nightly
LLVM version: 16.0.2

Error output

error: could not compile `crate_a` (lib)

Caused by:
  process didn't exit successfully: `rustc --crate-name crate_a --edition=2021 crates/crate_a/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=232 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=64fce3108dd917ff -C extra-filename=-64fce3108dd917ff --out-dir /home/eliah/Documents/projects/playground/rust/target/debug/deps -C incremental=/home/eliah/Documents/projects/playground/rust/target/debug/incremental -L dependency=/home/eliah/Documents/projects/playground/rust/target/debug/deps --extern crate_b=/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so` (signal: 11, SIGSEGV: invalid memory reference)
Backtrace

   Compiling crate_a v0.0.1 (/home/eliah/Documents/projects/playground/rust/crates/crate_a)
/home/eliah/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-8a3cc49b1def2c26.so(+0x31d6e63)[0x7f63769ede63]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x14420)[0x7f6373655420]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b1)[0x7f636900d1b1]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]
/home/eliah/Documents/projects/playground/rust/target/debug/deps/libcrate_b-5a8413c09751729e.so(+0xc1b6)[0x7f636900d1b6]

@Eliah-Lakhin Eliah-Lakhin added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 25, 2023
@Eliah-Lakhin
Copy link
Author

Possible duplicate of #77849 and #77869.

@GoldsteinE
Copy link
Contributor

An easier way to reproduce: compile

#[allow(unconditional_recursion)]
fn bar() {
    bar()
}

#[no_mangle]
pub extern "C" fn foo() {
    bar()
}

with

crate-type = ["cdylib"]

and try to actually call this function:

void foo(void);

int main(void) {
	foo();
}

It seems like dynamic linking suppresses stack overflow detection. I’m not sure that’s a bug.

@Noratrieb Noratrieb added T-libs Relevant to the library team, which will review and decide on the PR/issue. and removed I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 25, 2023
@Noratrieb Noratrieb changed the title "SIGSEGV Invalid memory reference" when applying a macro that overflows stack. Dynamic linking suppresses stackeroverflow detection Apr 25, 2023
@Noratrieb
Copy link
Member

Changing the labels and title according to the investigation from @GoldsteinE

@jyn514
Copy link
Member

jyn514 commented Apr 26, 2023

@Nilstrieb hmm, did you mean to label this as T-libs? Anything to do with guard pages seems like it should be T-compiler to me.

@jyn514 jyn514 added A-linkage Area: linking into static, shared libraries and binaries A-security Area: Security (example: address space layout randomization). labels Apr 26, 2023
@Noratrieb
Copy link
Member

Ah, is this actually missing guard pages? Fair then, I though it was hitting them and just missing the stackerflow detection, which is implemented in the library.

@jyn514
Copy link
Member

jyn514 commented Apr 26, 2023

I'll slap A-runtime on it to be safe 😄
@rustbot label A-runtime

@rustbot rustbot added the A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows label Apr 26, 2023
@bjorn3
Copy link
Member

bjorn3 commented May 16, 2023

For dylibs we skip the runtime initialization of libstd, which is responsible for setting up the stack overflow handler (and adding a guard page on platforms that don't have this already. Linux and OpenBSD add one by default). Doing this in a global constructor would be bad as it could overwrite an existing SIGSEGV handler in case of dlopen.

In this case however rustc actually overwrite the SIGSEGV handler of rustc's copy of libstd to show backtraces if LLVM crashes. It is this SIGSEGV handler that is shown here. If rustc didn't override the SIGSEGV handler, rustc's copy of libstd would have printed the stack overflow message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linkage Area: linking into static, shared libraries and binaries A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows A-security Area: Security (example: address space layout randomization). C-bug Category: This is a bug. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants