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

LLVM5: Failed to strip malformed debug info #53204

Closed
cuviper opened this issue Aug 8, 2018 · 0 comments
Closed

LLVM5: Failed to strip malformed debug info #53204

cuviper opened this issue Aug 8, 2018 · 0 comments
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@cuviper
Copy link
Member

cuviper commented Aug 8, 2018

In Rust 1.28, building the full compiler with full debuginfo (as we do in Fedora) sees debuginfo errors with external LLVM5 (Fedora 27 and EPEL7). Fedora 28+ with LLVM6 looks fine.

For example, from the logs in this failed build:

Building stage1 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
...
fragment covers entire variable
  tail call void @llvm.dbg.value(metadata i64* %2, i64 0, metadata !5287, metadata !401), !dbg !5300
!5287 = !DILocalVariable(name: "global_s", scope: !5288, file: !99, line: 1, type: !5196, align: 8)
!401 = !DIExpression(DW_OP_LLVM_fragment, 0, 64)
fragment is larger than or outside of variable
  tail call void @llvm.dbg.value(metadata i64* %3, i64 0, metadata !5287, metadata !404), !dbg !5300
!5287 = !DILocalVariable(name: "global_s", scope: !5288, file: !99, line: 1, type: !5196, align: 8)
!404 = !DIExpression(DW_OP_LLVM_fragment, 64, 64)
fragment covers entire variable
  tail call void @llvm.dbg.value(metadata i64* %2, i64 0, metadata !5868, metadata !401), !dbg !5879
!5868 = !DILocalVariable(name: "global_s", scope: !5869, file: !99, line: 1, type: !5778, align: 8)
!401 = !DIExpression(DW_OP_LLVM_fragment, 0, 64)
fragment is larger than or outside of variable
  tail call void @llvm.dbg.value(metadata i64* %3, i64 0, metadata !5868, metadata !404), !dbg !5879
!5868 = !DILocalVariable(name: "global_s", scope: !5869, file: !99, line: 1, type: !5778, align: 8)
!404 = !DIExpression(DW_OP_LLVM_fragment, 64, 64)
fragment is larger than or outside of variable
  call void @llvm.dbg.value(metadata { {}*, {}* }* %35, i64 0, metadata !8646, metadata !1442), !dbg !8637
!8646 = !DILocalVariable(name: "format", scope: !8638, file: !307, line: 1, type: !411, align: 1)
!1442 = !DIExpression(DW_OP_LLVM_fragment, 0, 64)
fragment is larger than or outside of variable
  call void @llvm.dbg.value(metadata i64* %37, i64 0, metadata !8646, metadata !1445), !dbg !8637
!8646 = !DILocalVariable(name: "format", scope: !8638, file: !307, line: 1, type: !411, align: 1)
!1445 = !DIExpression(DW_OP_LLVM_fragment, 64, 64)
fragment is larger than or outside of variable
  call void @llvm.dbg.value(metadata i8** %40, i64 0, metadata !8646, metadata !8667), !dbg !8637
!8646 = !DILocalVariable(name: "format", scope: !8638, file: !307, line: 1, type: !411, align: 1)
!8667 = !DIExpression(DW_OP_LLVM_fragment, 128, 64)
fragment is larger than or outside of variable
  call void @llvm.dbg.value(metadata i8* %42, i64 0, metadata !8646, metadata !8668), !dbg !8637
!8646 = !DILocalVariable(name: "format", scope: !8638, file: !307, line: 1, type: !411, align: 1)
!8668 = !DIExpression(DW_OP_LLVM_fragment, 192, 64)
fragment covers entire variable
  tail call void @llvm.dbg.value(metadata i64* %2, i64 0, metadata !5527, metadata !389), !dbg !5540
!5527 = !DILocalVariable(name: "global_s", scope: !5528, file: !87, line: 1, type: !5426, align: 8)
!389 = !DIExpression(DW_OP_LLVM_fragment, 0, 64)
fragment is larger than or outside of variable
  tail call void @llvm.dbg.value(metadata i64* %3, i64 0, metadata !5527, metadata !392), !dbg !5540
!5527 = !DILocalVariable(name: "global_s", scope: !5528, file: !87, line: 1, type: !5426, align: 8)
!392 = !DIExpression(DW_OP_LLVM_fragment, 64, 64)
fragment covers entire variable
  tail call void @llvm.dbg.value(metadata i64* %2, i64 0, metadata !6274, metadata !389), !dbg !6285
!6274 = !DILocalVariable(name: "global_s", scope: !6275, file: !87, line: 1, type: !6182, align: 8)
!389 = !DIExpression(DW_OP_LLVM_fragment, 0, 64)
fragment is larger than or outside of variable
  tail call void @llvm.dbg.value(metadata i64* %3, i64 0, metadata !6274, metadata !392), !dbg !6285
!6274 = !DILocalVariable(name: "global_s", scope: !6275, file: !87, line: 1, type: !6182, align: 8)
!392 = !DIExpression(DW_OP_LLVM_fragment, 64, 64)
warning: ignoring invalid debug info in std5-25124471f09f727a26c64c3844c8702a.rs
DICompileUnit not listed in llvm.dbg.cu
!98 = distinct !DICompileUnit(language: DW_LANG_Rust, file: !99, producer: "clang LLVM (rustc version 1.28.0)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !100, globals: !201)
warning: ignoring invalid debug info in std5-25124471f09f727a26c64c3844c8702a.rs
LLVM ERROR: Failed to strip malformed debug info
error: Could not compile `std`.

I believe this is the effect of #50949, per @eddyb:

(The second commit passes tests locally but might not on older LLVM versions)

I reverted that commit da579ef locally, and it looks like this has fixed it. Maybe we can keep that hack in place just for LLVM5? (skipping it on LLVM6+)

@sanxiyn sanxiyn added the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Aug 9, 2018
cuviper added a commit to cuviper/rust that referenced this issue Aug 9, 2018
This hack was removed in rust-lang#50949, but without it I found that building
`std` with full debuginfo would print many LLVM `DW_OP_LLVM_fragment`
errors, then die `LLVM ERROR: Failed to strip malformed debug info`.

It doesn't seem to be a problem for LLVM 6, so we can re-enable the hack
just for older LLVM.

This reverts commit da579ef.
Fixes rust-lang#53204.
r? @eddyb
@cuviper cuviper added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. C-bug Category: This is a bug. labels Aug 10, 2018
kennytm added a commit to kennytm/rust that referenced this issue Aug 13, 2018
rustc_codegen_llvm: Restore the closure env alloca hack for LLVM 5.

This hack was removed in rust-lang#50949, but without it I found that building
`std` with full debuginfo would print many LLVM `DW_OP_LLVM_fragment`
errors, then die `LLVM ERROR: Failed to strip malformed debug info`.

It doesn't seem to be a problem for LLVM 6, so we can re-enable the hack
just for older LLVM.

This reverts commit da579ef.
Fixes rust-lang#53204.
r? @eddyb
kennytm added a commit to kennytm/rust that referenced this issue Aug 14, 2018
rustc_codegen_llvm: Restore the closure env alloca hack for LLVM 5.

This hack was removed in rust-lang#50949, but without it I found that building
`std` with full debuginfo would print many LLVM `DW_OP_LLVM_fragment`
errors, then die `LLVM ERROR: Failed to strip malformed debug info`.

It doesn't seem to be a problem for LLVM 6, so we can re-enable the hack
just for older LLVM.

This reverts commit da579ef.
Fixes rust-lang#53204.
r? @eddyb
bors pushed a commit that referenced this issue Aug 25, 2018
This hack was removed in #50949, but without it I found that building
`std` with full debuginfo would print many LLVM `DW_OP_LLVM_fragment`
errors, then die `LLVM ERROR: Failed to strip malformed debug info`.

It doesn't seem to be a problem for LLVM 6, so we can re-enable the hack
just for older LLVM.

This reverts commit da579ef.
Fixes #53204.
r? @eddyb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. 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

2 participants