Bug 19732

Summary: lldb doesn't quit after printing native stack trace after crash
Product: [Mono] Runtime Reporter: Rolf Bjarne Kvinge [MSFT] <rolf>
Component: GeneralAssignee: Bugzilla <bugzilla>
Status: RESOLVED FIXED    
Severity: normal CC: mono-bugs+mono, mono-bugs+runtime, vargaz
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:
Bug Depends on:    
Bug Blocks: 18654    

Description Rolf Bjarne Kvinge [MSFT] 2014-05-13 12:57:15 UTC
Repro:
using System;
using System.Runtime.InteropServices;

class C {
	[DllImport ("libc")]
	extern static IntPtr strlen (IntPtr ptr);
	static void Main ()	{
		strlen (IntPtr.Zero);
	}
}

mcs test.cs && mono test.exe
> mono test.exe
Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) C.strlen (intptr) <0xffffffff>
  at C.Main () <0x0000f>
  at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:


Debug info from gdb:

Process 62446 stopped
* thread #1: tid = 0x3f2d83, 0x9b606fed libsystem_kernel.dylib`__wait4 + 5, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
  thread #2: tid = 0x3f2d84, 0x9b601fb6 libsystem_kernel.dylib`semaphore_wait_trap + 10
  thread #3: tid = 0x3f2d85, 0x9b607992 libsystem_kernel.dylib`kevent64 + 10, queue = 'com.apple.libdispatch-manager'
  thread #4: tid = 0x3f2d86, 0x9b607046 libsystem_kernel.dylib`__workq_kernreturn + 10
  thread #5: tid = 0x3f2d87, 0x9b607046 libsystem_kernel.dylib`__workq_kernreturn + 10
<stack trace>
Executing commands in '/tmp/mono-gdb-commands.MLWVzS'.
(lldb)  process attach --pid 62446
Process 62446 stopped
Executable module set to "/usr/bin/mono".
Architecture set to: i486-apple-macosx.
(lldb)  script lldb.debugger.HandleCommand ("thread list")
(lldb)  script lldb.debugger.HandleCommand ("thread backtrace all")
(lldb)  detach
Detaching from process 62446
(lldb)  quit
error: Aborting reading of commands after command #4: 'quit' failed with <unknown error>.
Aborting after_file command execution, command file: '/tmp/mono-gdb-commands.MLWVzS' failed.
Process 62446 detached
(lldb) 


<and here I have to manually quit lldb using Ctrl-C>
Comment 1 Zoltan Varga 2014-05-14 15:24:11 UTC
Fixed in master 4d388f07d45698b2ef8a88c3c43cf0938cc5476e.