Skip to content

Using both --enable-debug, --enable-optimization causes an assertion failure on build #26484

@robertg

Description

@robertg

If you do ./configure --enable-debug --enable-optimization, make will fail with:

rustc: x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/librustc
Assertion failed: (T == dwarf::DW_TAG_typedef || T == dwarf::DW_TAG_const_type || T == dwarf::DW_TAG_volatile_type || T == dwarf::DW_TAG_restrict_type || T == dwarf::DW_TAG_enumeration_type), function isUnsignedDIType, file /Users/rgawdzik/dev/rust/src/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp, line 525.
make: *** [x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/stamp.rustc] Abort trap: 6

Fails on both mac, linux on master. This error does not occur if you only use --enable-debug or --enable-optimization exclusively.

Activity

changed the title [-]Using both --enable-debug, --enable-optimization causes an assertion failure[/-] [+]Using both --enable-debug, --enable-optimization causes an assertion failure on build[/+] on Jun 21, 2015
added
A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)
on Jun 21, 2015
emberian

emberian commented on Jun 22, 2015

@emberian
Member

Repros for me as well, on:

CFG_LLVM_LINKAGE_FILE=/home/cmr/rust/build/x86_64-unknown-linux-gnu/rt/llvmdeps.rs LD_LIBRARY_PATH=/home/cmr/rust/build/x86_64-unknown-linux-gnu/stage1/lib:$LD_LIBRARY_PATH   x86_64-unknown-linux-gnu/stage1/bin/rustc --cfg stage1  -O --cfg rtopt -C debug-assertions=on -g -C prefer-dynamic --target=x86_64-unknown-linux-gnu  -D warnings -L "x86_64-unknown-linux-gnu/rt" -L "/home/cmr/rust/build/x86_64-unknown-linux-gnu/llvm/Release+Asserts/lib"    --out-dir x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib -C extra-filename=-d8ace771 ../src/librustc/lib.rs
pnkfelix

pnkfelix commented on Jul 3, 2015

@pnkfelix
Member

yes I can reproduce this locally as well (thought it was somehow related to my own branch, glad I checked against master as well...)

pnkfelix

pnkfelix commented on Jul 9, 2015

@pnkfelix
Member

This was injected by f9d4149 (PR #26025), an LLVM upgrade. (I identified this via bisection, though it is a pretty obvious candidate for the cause in hindsight.)

cc @alexcrichton @michaelwoerister

pnkfelix

pnkfelix commented on Jul 9, 2015

@pnkfelix
Member

backtrace from the assert under lldb on OS X : https://gist.github.com/pnkfelix/13851983520628197add

pnkfelix

pnkfelix commented on Jul 9, 2015

@pnkfelix
Member
(lldb) 
frame #5: 0x00000001030bdeed librustc_llvm-7e44814b.dylib`isUnsignedDIType(DD=0x00000001c0d18400, Ty=0x0000000189547d00) + 349 at DwarfUnit.cpp:522
   519          T == dwarf::DW_TAG_structure_type ||
   520          T == dwarf::DW_TAG_union_type)
   521        return true;
-> 522      assert(T == dwarf::DW_TAG_typedef || T == dwarf::DW_TAG_const_type ||
   523             T == dwarf::DW_TAG_volatile_type ||
   524             T == dwarf::DW_TAG_restrict_type ||
   525             T == dwarf::DW_TAG_enumeration_type);
(lldb) p T
(llvm::dwarf::Tag) $0 = DW_TAG_subroutine_type
self-assigned this
on Jul 13, 2015

11 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @jdm@pnkfelix@dotdash@emberian@michaelwoerister

      Issue actions

        Using both --enable-debug, --enable-optimization causes an assertion failure on build · Issue #26484 · rust-lang/rust