Attaching to a stopped (cored) process hangs lldb-server

So im trying to write a core handler program and use lldb to attach and dump important information about it. This works if a use my tool to attach to an existing one but I found that lldb-server will hang in a waitpid call if the kernel has invoked the tool after another process has cored.

Example:

· /proc/sys/kernel/core_pattern is set to |/opt/core_tool

· Run a.out and it segfaults

· Kernel invokes core_tool that uses lldb AttachToProcess and a.out is in state “S+”

· lldb-server hangs in source\Plugins\Process\Linux\NativeProcessLinux.cpp:867

· if I remove the waitpid it doesn’t hang but fails to attach

Looks like gdb had a similar problem as well: Daniel Jacobowitz - Re: [patch] Fix Linux attach to signalled/stopped processes

Any ideas on how to fix this?

Mark Chandler

Battle.Net Engineering Systems | Blizzard Entertainment

(P) 949-955-1380 x15353