Skip to content

StackSafetyLocalAnalysis Assertion failed with ASAN #134367

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

Open
van-ema opened this issue Apr 4, 2025 · 0 comments
Open

StackSafetyLocalAnalysis Assertion failed with ASAN #134367

van-ema opened this issue Apr 4, 2025 · 0 comments
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] llvm:analysis

Comments

@van-ema
Copy link

van-ema commented Apr 4, 2025

While compiling rust standard library with optimizatons and asan I found a similar issue to #87923

rustc: /home/ubuntu/rust-misc/llvm-project/llvm/lib/Analysis/StackSafetyAnalysis.cpp:540: void {anonymous}::StackSafetyLocalAnalysis::analyzeAllUses(llvm::Value*, {anonymous}::UseInfo<llvm::GlobalValue>&, const llvm::StackLifetime&): Assertion `isa<Function>(Callee) || isa<GlobalAlias>(Callee)' failed.
error: could not compile `std` (lib)

to reproduce run any rust program with

RUSTFLAGS="-C opt-level=3  -Zsanitizer=address" cargo build --target x86_64-unknown-linux-gnu -Zbuild-std

issue can be reproduced at any opt level > 0

Rust version: 1.82
llvm: llvmorg-19.1.4

Debugging this I found that assertion assert(isa<Function>(Callee) || isa<GlobalAlias>(Callee)); fails because of
@getrandom = extern_weak global i8 at %13 = tail call noundef i64 @getrandom(ptr noundef nonnull %ptr46, i64 noundef %new_len45, i32 noundef 4) #25, !dbg !1007 in module std.33b5cc56158b1412-cgu.15

@EugeneZelenko EugeneZelenko added crash Prefer [crash-on-valid] or [crash-on-invalid] llvm:analysis and removed new issue labels Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crash Prefer [crash-on-valid] or [crash-on-invalid] llvm:analysis
Projects
None yet
Development

No branches or pull requests

3 participants