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

BUG: failed to parse LLVM IR #58

Closed
forty opened this issue Jun 21, 2022 · 5 comments · Fixed by #59
Closed

BUG: failed to parse LLVM IR #58

forty opened this issue Jun 21, 2022 · 5 comments · Fixed by #59

Comments

@forty
Copy link

forty commented Jun 21, 2022

Hello,

Error

I get the following message on my project

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

Info

$ cargo +nightly call-stack  --version
cargo-call-stack 0.1.7
$ cargo --version
cargo 1.61.0 (a028ae4 2022-04-29)
$ rustc --version
rustc 1.61.0 (fe5b13d68 2022-05-18)

bin-0d269819aa1d3063.ll.txt

Let me know if I can help figuring it out.

thanks!

bors bot added a commit that referenced this issue Jun 22, 2022
59: extend llvm-ir parser to handle libstd's IR r=japaric a=japaric

fixes #58 

Co-authored-by: Jorge Aparicio <[email protected]>
@japaric
Copy link
Owner

japaric commented Jun 22, 2022

with PR #59 the llvm-ir parser can handle the .ll file you shared in the issue description

@japaric
Copy link
Owner

japaric commented Jun 22, 2022

release v0.1.8 includes the fix for this issue

@forty
Copy link
Author

forty commented Jun 22, 2022

Wow thanks for the super fast reply! I don't have this error anymore, but now it fails on a different problem

thread 'main' panicked at 'BUG: unhandled llvm intrinsic: llvm.experimental.noalias.scope.decl', /home/forty/.cargo/registry/src/garden.eu.org-1ecc6299db9ec823/cargo-call-stack-0.1.8/src/main.rs:701:21

This llvm.experimental.noalias.scope.decl seem to indeed be present in the file I shared (but if it's supposed to work, maybe I'm doing something wrong?)

Thanks!

@japaric
Copy link
Owner

japaric commented Jun 22, 2022

I only ran your file through the llvm-ir parser; I couldn't test the whole cargo-call-stack itself because I didn't have the source code of your Cargo project. I can repro the issue with a "hello, world" project; will have a look.

@japaric
Copy link
Owner

japaric commented Jun 22, 2022

PR #60 should handle enough llvm instrinsics to produce a call graph for the "hello, world" program. if you are producing dynamically linked binaries check out #61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants