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

Rust generates bad debug info for panics #44465

Closed
jrmuizel opened this issue Sep 9, 2017 · 8 comments
Closed

Rust generates bad debug info for panics #44465

jrmuizel opened this issue Sep 9, 2017 · 8 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jrmuizel
Copy link
Contributor

jrmuizel commented Sep 9, 2017

We're getting crashes in webrender that look like this:

8 XUL webrender::frame_builder::{{impl}}::build src/libcore/option.rs:0
However webrender::frame_builder::{{impl}}::build is not found at option.rs:0

In https://bugzilla.mozilla.org/show_bug.cgi?id=1398171 @luser elaborates the problem with debug info that rust is generating.

@Mark-Simulacrum Mark-Simulacrum added the A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) label Sep 9, 2017
@Mark-Simulacrum
Copy link
Member

cc @michaelwoerister

@TimNN TimNN added C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 17, 2017
@arielb1
Copy link
Contributor

arielb1 commented Nov 20, 2017

So #46101 made me get into this, and it appears that at least that problem is caused by libbacktrace giving us the line-number of the unreachable instruction after the call, rather than the call itself that's actually me looking at a slightly-modified non-broken version of the code

        .loc    12 302 0
        leaq    str.k.llvm.133BC46B(%rip), %rdi
.Ltmp34:
        movl    $22, %esi
        callq   _ZN4core6option13expect_failed17hfad3c6cc869d0a50E@PLT
.Ltmp35:
        .loc    12 0 0 is_stmt 0
        ud2

@arielb1
Copy link
Contributor

arielb1 commented Nov 20, 2017

So this is actually an LLVM bug that was apparently fixed in llvm-mirror/llvm@5c08882 - BranchFolding had used to nuke debug info, now it doesn't - which is a commit contained in LLVM 5.0. So this should be fixed when we upgrade to that.

That commit is somewhat big, so I'm not sure how safe it is to apply to 4.0.

@michaelwoerister
Copy link
Member

Thank you so much for investigating, @arielb1!

@steven-michaud
Copy link

Did the upgrade to LLVM 5.0 happen? Did this bug get fixed?

@alecmocatta
Copy link
Contributor

@steven-michaud Rust's currently on LLVM 9.0

@steven-michaud
Copy link

Thanks for the info. So this bug should have been fixed. Does anyone know if it was?

@pnkfelix
Copy link
Member

visiting for wg-debugging triage

closing; presumed fixed.

please reopen if you have evidence that this is still a problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

8 participants