japaric / cargo-call-stack

Whole program static stack analysis
Apache License 2.0
560 stars 50 forks source link

more of: error: failed to parse application's LLVM IR from... #84

Closed cameronelliott closed 1 year ago

cameronelliott commented 1 year ago

Thank you for creating cargo-call-stack

$ cargo call-stack -V
cargo-call-stack 0.1.13

This is the error I see. Looks like you have fixed some of them already.

error: failed to parse application's LLVM IR from `../target/x86_64-unknown-linux-gnu/release/deps/tlsserver_mio-75bdd8b69c4c59db.ll`: BUG: failed to parse LLVM IR; please submit a cargo-call-stack bug report and attach the `.ll` file: Failure("Eof in line 309009")

I believe the 2nd or third line is the cause. Full file also attached.

; Function Attrs: nonlazybind uwtable
define internal fastcc void @_ZN4ring2io10der_writer22write_positive_integer17h2cbd2a5c98e3e635E(ptr noundef nonnull align 1 %0, ptr noalias nocapture noundef readonly align 8 dereferenceable(24) %1, ptr %.0.val, i64 %.8.val) unnamed_addr #1 personality ptr @rust_eh_personality {
  %3 = icmp eq i64 %.8.val, 0
  br i1 %3, label %4, label %_ZN4ring2io8positive8Positive10first_byte17h8adc827486783c8bE.exit, !prof !4429

4:                                                ; preds = %2
; call core::panicking::panic_bounds_check
  tail call fastcc void @_ZN4core9panicking18panic_bounds_check17h4183f129c0f2d665E(i64 0, i64 0, ptr noalias noundef nonnull readonly align 8 dereferenceable(24) @anon.d6133c3b30208f5fca04db122d621065.14) #79, !noalias !51502
  unreachable

bad.txt.gz

cameronelliott commented 1 year ago

I tried a bunch of nightly version to work around this, but, none of them fixed it. Shouldn't my reverting to older 'rustc' versions produce the older llm (.ll) and cause the issue to go away?? Although I did take remove the +nightly from the cargo-call line. (actually tried it both ways more than a couple times)

ie

rustup default nightly-2022-01-01-x86_64-unknown-linux-gnu
rustup component add rust-src --toolchain nightly-2022-01-01-x86_64-unknown-l
inux-gnu
japaric commented 1 year ago

release v0.1.14 can handle the llvm-ir of _ZN4ring2io10der_writer22write_positive_integer17h2cbd2a5c98e3e635E