Skip to content

Assertion failing in constructAbstractSubprogramScopeDIE if compiled with -g #14930

Closed

Description

@farcaller
Assertion failed: (ScopeDIE), function constructAbstractSubprogramScopeDIE
file /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp, line 534.

What interesting is that it fails with rust nightly but works ok with my local rust configuration:

% /Users/farcaller/Downloads/rust-nightly-x86_64-apple-darwin/bin/rustc --version
rustc 0.11.0-pre-nightly (6d8342f 2014-06-14 17:51:49 +0000)
host: x86_64-apple-darwin
% ~/.local/bin/rustc --version
rustc 0.11.0-pre (6d8342f 2014-06-14 17:51:49 +0000)
host: x86_64-apple-darwin

Update: those timestamps look to same, that's probably not a coincidence :-) anyways, my local rustc is surely built from 6d8342f.

My rust was configured as

./configure --prefix=/Users/farcaller/.local --enable-clang --disable-docs --disable-optimize --disable-optimize-cxx --disable-optimize-llvm --disable-verify-install

Activity

  1. farcaller commented on Jun 16, 2014

    @farcaller
    ContributorAuthor

    Stack trace:

    * thread #2: tid = 0x48de0a, 0x00007fff83546866 libsystem_kernel.dylib`__pthread_kill + 10, stop reason = signal SIGABRT
      * frame #0: 0x00007fff83546866 libsystem_kernel.dylib`__pthread_kill + 10
        frame #1: 0x00007fff865e135c libsystem_pthread.dylib`pthread_kill + 92
        frame #2: 0x00000001016b3b16 librustc-d252d482-0.11.0-pre.dylib`abort + 22
        frame #3: 0x00000001016b3af1 librustc-d252d482-0.11.0-pre.dylib`__assert_rtn + 81
        frame #4: 0x000000010103c2fd librustc-d252d482-0.11.0-pre.dylib`llvm::DwarfDebug::constructAbstractSubprogramScopeDIE(llvm::DwarfCompileUnit&, llvm::LexicalScope*) + 349
        frame #5: 0x0000000101042ab9 librustc-d252d482-0.11.0-pre.dylib`llvm::DwarfDebug::endFunction(llvm::MachineFunction const*) + 1449
        frame #6: 0x00000001010234ad librustc-d252d482-0.11.0-pre.dylib`llvm::AsmPrinter::EmitFunctionBody() + 4637
        frame #7: 0x0000000100c3270a librustc-d252d482-0.11.0-pre.dylib`llvm::ARMAsmPrinter::runOnMachineFunction(llvm::MachineFunction&) + 362
        frame #8: 0x000000010112c41d librustc-d252d482-0.11.0-pre.dylib`llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 125
        frame #9: 0x0000000101649bab librustc-d252d482-0.11.0-pre.dylib`llvm::FPPassManager::runOnFunction(llvm::Function&) + 347
        frame #10: 0x0000000101649e4b librustc-d252d482-0.11.0-pre.dylib`llvm::FPPassManager::runOnModule(llvm::Module&) + 59
        frame #11: 0x000000010164a429 librustc-d252d482-0.11.0-pre.dylib`llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1081
        frame #12: 0x000000010164a83d librustc-d252d482-0.11.0-pre.dylib`llvm::legacy::PassManager::run(llvm::Module&) + 13
        frame #13: 0x0000000100a71e23 librustc-d252d482-0.11.0-pre.dylib`LLVMRustWriteOutputFile + 307
        frame #14: 0x00000001008d71dd librustc-d252d482-0.11.0-pre.dylib`back::link::write_output_file::he9e93a5b7a268ff2wKf::v0.11.0.pre + 141
        frame #15: 0x00000001008dea30 librustc-d252d482-0.11.0-pre.dylib`back::link::write::run_passes::closure.91419 + 240
        frame #16: 0x00000001008d976c librustc-d252d482-0.11.0-pre.dylib`back::link::write::run_passes::hbb695e52f514c879MMf::v0.11.0.pre + 9356
        frame #17: 0x0000000100a20e01 librustc-d252d482-0.11.0-pre.dylib`driver::driver::phase_5_run_llvm_passes::closure.97852 + 97
        frame #18: 0x0000000100989c7a librustc-d252d482-0.11.0-pre.dylib`driver::driver::phase_5_run_llvm_passes::h7e7bf09cf59529cafxv::v0.11.0.pre + 490
        frame #19: 0x000000010097f380 librustc-d252d482-0.11.0-pre.dylib`driver::driver::compile_input::hf1998b432ab27ab2gbv::v0.11.0.pre + 7456
        frame #20: 0x0000000100a406ee librustc-d252d482-0.11.0-pre.dylib`driver::run_compiler::hb2048e6d930cfe5fOSx::v0.11.0.pre + 9662
        frame #21: 0x0000000100a3e076 librustc-d252d482-0.11.0-pre.dylib`driver::main_args::closure.98543 + 70
        frame #22: 0x0000000100a58397 librustc-d252d482-0.11.0-pre.dylib`driver::monitor::closure.99633 + 199
        frame #23: 0x0000000100a535bb librustc-d252d482-0.11.0-pre.dylib`task::TaskBuilder::try::closure.99396 + 75
        frame #24: 0x00000001000459ac libnative-1fb5e2c0-0.11.0-pre.dylib`task::spawn_opts::closure.7247 + 76
        frame #25: 0x000000010327b928 librustrt-d8560cb2-0.11.0-pre.dylib`task::Task::run::closure.5244 + 56
        frame #26: 0x00000001032f1c2c librustrt-d8560cb2-0.11.0-pre.dylib`rust_try + 12
        frame #27: 0x000000010327e23a librustrt-d8560cb2-0.11.0-pre.dylib`unwind::try::habea3eb6fbe31bfdLCd::v0.11.0.pre + 74
        frame #28: 0x000000010327b7f5 librustrt-d8560cb2-0.11.0-pre.dylib`task::Task::run::h31070b5f512029c7XSc::v0.11.0.pre + 101
        frame #29: 0x000000010004581b libnative-1fb5e2c0-0.11.0-pre.dylib`task::spawn_opts::closure.7219 + 267
        frame #30: 0x000000010327d879 librustrt-d8560cb2-0.11.0-pre.dylib`thread::thread_start::hfa0dfbb777e33e5dmad::v0.11.0.pre + 41
        frame #31: 0x00007fff865e0899 libsystem_pthread.dylib`_pthread_body + 138
        frame #32: 0x00007fff865e072a libsystem_pthread.dylib`_pthread_start + 137
    
  2. michaelwoerister commented on Jun 16, 2014

    @michaelwoerister
    Member

    Thanks for the report! I'll see if I can reproduce it.

  3. farcaller commented on Jun 16, 2014

    @farcaller
    ContributorAuthor

    I've rebuilt my local rustc with following:

    ./configure --prefix=/Users/farcaller/.local --enable-clang --disable-docs --disable-verify-install
    

    and strangely enough the problem seems to be fixed for both local & nightly installs (well, I suppose nightly actually uses libs from local 😄 )

  4. michaelwoerister commented on Jun 16, 2014

    @michaelwoerister
    Member

    That's possible, I don't know the intricacies of the build system too well :) I'll close the issue. If you come across the assertion again, we can always reopen.

  5. farcaller commented on Jun 16, 2014

    @farcaller
    ContributorAuthor

    For now it's known broken on a clean host install of rust-nightly. Can you please reopen? I'll confirm if that will happen with next nightly build.

  6. reopened this on Jun 16, 2014
  7. michaelwoerister commented on Jun 16, 2014

    @michaelwoerister
    Member

    Woops, thanks @huonw.

  8. farcaller commented on Jun 16, 2014

    @farcaller
    ContributorAuthor

    All tests are done on a clean linux/x86_64 images:

    • nightly package 0.11.0-pre-nightly (6d8342f 2014-06-14 17:51:49 +0000) – fails
    • compiled from 6d8342f with ./configure --disable-docs --disable-verify-install – fails
    • compiled from 5abf794 (latest HEAD) – fails
  9. farcaller commented on Jun 16, 2014

    @farcaller
    ContributorAuthor

    A bit more details, now that I have rustc failing in debug configuration.

    In constructAbstractSubprogramScopeDIE call, Scope dumps as:

    (gdb) call Scope->dump(0)
    DFSIn: 0 DFSOut: 0
    !{i32 786478, metadata <badref>, metadata <badref>, metadata !"get_task_stack_pointer", metadata !"get_task_stack_pointer", metadata !"_ZN4zinc3hal9cortex_m35sched22get_task_stack_pointerE", i32 43, metadata <badref>, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 true, null, metadata <badref>, null, metadata <badref>, i32 43} ; [ DW_TAG_subprogram ] [line 43] [def] [get_task_stack_pointer]
    
    Abstract Scope
      Children ...
      DFSIn: 0 DFSOut: 0
      !{i32 786443, metadata <badref>, metadata <badref>, i32 43, i32 39, i32 0, i32 473} ; [ DW_TAG_lexical_block ] [/tmp/zinc/src/hal/cortex_m3/sched.rs]
    
      Abstract Scope
        Children ...
        DFSIn: 0 DFSOut: 0
        !{i32 786443, metadata <badref>, metadata <badref>, i32 45, i32 2, i32 0, i32 474} ; [ DW_TAG_lexical_block ] [/tmp/zinc/src/hal/cortex_m3/sched.rs]
    
        Abstract Scope
    

    FWIW, this is the definition of get_task_stack_pointer:

    /// Returns task stack pointer (PSP).
    #[cfg(not(test))]
    #[inline(always)]
    pub fn get_task_stack_pointer() -> u32 {
      let mut val: u32;
      unsafe { asm!("mrs $0, psp" : "=r"(val)) };
      val
    }
  10. farcaller commented on Jun 16, 2014

    @farcaller
    ContributorAuthor

    This might also be of interest (it points to here).

    (gdb) call Sub.dump()
    [ DW_TAG_subprogram ] [line 43] [def] [get_task_stack_pointer]
    
  11. michaelwoerister commented on Jun 18, 2014

    @michaelwoerister
    Member

    @farcaller Thanks a lot for the detailed information.

  12. farcaller commented on Jun 18, 2014

    @farcaller
    ContributorAuthor

    Just a quick followup: I tried to reproduce this in a single file, so far with no success. If you wonder, the code is being compiled with the following flags:

    rustc \
      --opt-level 2 \
      -Z no-landing-pads \
      -g \
      --cfg cfg_mcu_has_spi --cfg cfg_tft_lcd --cfg cfg_multitasking --cfg mcu_lpc17xx --cfg arch_cortex_m3 \
      --target thumbv7m-linux-eabi \
      -Ctarget-cpu=cortex-m3 \
      -Crelocation_model=static
    
  13. steveklabnik commented on Sep 3, 2015

    @steveklabnik
    Contributor

    @farcaller it's been a while, is this still failing for you?

  14. farcaller commented on Sep 3, 2015

    @farcaller
    ContributorAuthor

    Haven't seen it in a while.

  15. steveklabnik commented on Sep 3, 2015

    @steveklabnik
    Contributor

    Okay, then I'm going to give it a close. If we see it pop up again, let me know!

  16. ticki commented on Jan 5, 2016

    @ticki
    Contributor

    It's broken again.

  17. added a commit that references this issue on Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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

      Issue actions