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

[macOS] Lldb crashes while debugging rustc #47183

Closed
bjorn3 opened this issue Jan 4, 2018 · 4 comments
Closed

[macOS] Lldb crashes while debugging rustc #47183

bjorn3 opened this issue Jan 4, 2018 · 4 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) C-bug Category: This is a bug. O-macos Operating system: macOS T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue.

Comments

@bjorn3
Copy link
Member

bjorn3 commented Jan 4, 2018

$ lldb -n rustc -w
(lldb) process attach --name "rustc" --waitfor
Process 61982 stopped
* thread #1, stop reason = signal SIGSTOP
    frame #0: 0x000000011367419c dyld`_dyld_start
dyld`_dyld_start:
->  0x11367419c <+0>: popq   %rdi
    0x11367419d <+1>: pushq  $0x0
    0x11367419f <+3>: movq   %rsp, %rbp
    0x1136741a2 <+6>: andq   $-0x10, %rsp
Target 0: (rustc) stopped.

Executable module set to "/Users/bjorn/Documents/rust-fork/build/x86_64-apple-darwin/stage2/bin/rustc".
Architecture set to: x86_64h-apple-macosx.
(lldb) continue 
Process 61982 resuming
librustc_driver-dcdd823ad86bd03e.dylib was compiled with optimization - stepping may behave oddly; variables may not be available.
Process 61982 stopped
* thread #2, name = 'rustc', stop reason = EXC_BAD_ACCESS (code=1, address=0x105ee3078)
    frame #0: 0x0000000105b55a87 librustc_driver-dcdd823ad86bd03e.dylib`core::ptr::drop_in_place::hdc80d0e2f0000db2 [inlined] core::ptr::drop_in_place::h070b89da4f520733 at ptr.rs:59 [opt]
   56  	#[stable(feature = "drop_in_place", since = "1.8.0")]
   57  	#[lang = "drop_in_place"]
   58  	#[allow(unconditional_recursion)]
-> 59  	pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
   60  	    // Code here does not matter - this is replaced by the
   61  	    // real drop glue by the compiler.
   62  	    drop_in_place(to_drop);
Target 0: (rustc) stopped.
(lldb) bt
error: librustc_driver-dcdd823ad86bd03e.dylib DWARF DIE at 0x002af064 (class closure) has a member variable 0x002af06b (__0) whose type is a forward declaration, not a complete definition.
Try compiling the source file with -fno-limit-debug-info
Illegal instruction: 4
$
[rust]
debuginfo = true
debuginfo-lines = true
@pietroalbini pietroalbini added O-macos Operating system: macOS C-bug Category: This is a bug. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. labels Feb 6, 2018
@king6cong
Copy link
Contributor

king6cong commented Apr 12, 2018

similar here:

(lldb) t 16
* thread #16, name = 't:tokio'
    frame #0: 0x00007fff7d5d3bf2 libsystem_kernel.dylib`kevent + 10
libsystem_kernel.dylib`kevent:
->  0x7fff7d5d3bf2 <+10>: jae    0x7fff7d5d3bfc            ; <+20>
    0x7fff7d5d3bf4 <+12>: movq   %rax, %rdi
    0x7fff7d5d3bf7 <+15>: jmp    0x7fff7d5c9b00            ; cerror_nocancel
    0x7fff7d5d3bfc <+20>: retq
(lldb) list
(lldb) bt
warning: (x86_64) /xxx/target/debug/deps/libmio-8461a2db86d1af74.rlib(mio-8461a2db86d1af74.mio8.rcgu.o) 0xfdc00000d4d: DW_TAG_member bitfield named "(null)" has invalid bit offset (0x100000000) member will be ignored. Please file a bug against the compiler and include the preprocessed output for /Users/cong/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.6.9/src/lib.rs/@/mio8

error: liblib_net-22a2ad34bc598d14.rlib(lib_net-22a2ad34bc598d14.35a0x8f7rhy3adti.rcgu.o) DWARF DIE at 0x0000195f (class Option<core::result::Result<(), ()>>) has a member variable 0x00001966 (RUST$ENCODED$ENUM$0$None) whose type is a forward declaration, not a complete definition.
Try compiling the source file with -fstandalone-debug
Segmentation fault: 11

seems to be related to: #41193

@sfackler sfackler added the A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) label May 10, 2018
@fanzeyi
Copy link

fanzeyi commented Aug 7, 2018

Same issue here. It works fine before when I was using standard lldb. (Then I discovered rust-lldb and decided to give it a try and run into this bug.)

What I did:

> attach <PID>
> thread list
> thread select 2
> bt
..Segmentation Fault...

error: xxx DWARF DIE at 0x000283c3 (class closure) has a member variable 0x000283ca (__0) whose type is a forward declaration, not a complete definition.
Try compiling the source file with -fno-limit-debug-info
$HOME/.rustup/toolchains/nightly-x86_64-apple-darwin/bin/rust-lldb: line 41: 98247 Segmentation fault: 11  lldb --source-before-file="$TMPFILE" "$@"

$ rustc --version
rustc 1.30.0-nightly (73c78734b 2018-08-05)
$ rust-lldb --version
lldb-902.0.79.7
  Swift-4.1

@jasonwilliams
Copy link
Member

jasonwilliams commented Aug 20, 2018

I think (the DWARF DIE error) is a duplicate of #29154
This issue was also raised in vadimcn/codelldb#127

@tromey
Copy link
Contributor

tromey commented Sep 19, 2018

I think this is the same as #41193, and since there is more analysis there, I am closing this one.

@tromey tromey closed this as completed Sep 19, 2018
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. O-macos Operating system: macOS T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants