<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19190"></HEAD>
<BODY>
<DIV><FONT size=2 face=Arial><SPAN class=463402519-30032012>Hi
everyone,</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN
class=463402519-30032012></SPAN></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN class=463402519-30032012>here is a patch,
which fixes a segmentation fault crash in lldb in the ProcessPOSIX class when
the object gets destroyed. I can reproduce this problem on the FreeBSD
platform and it should be reproducable for the other platforms
also.</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN
class=463402519-30032012></SPAN></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN class=463402519-30032012>The steps to
reproduce (log):</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN
class=463402519-30032012></SPAN></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN class=463402519-30032012> freebsd1#
./lldb /bin/ls<BR> Current executable set to '/bin/ls' (x86_64).<BR>
(lldb) platform select remote-freebsd<BR> Host: FreeBSD 9.0-RELEASE
FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:46:30 UTC
2012 <A
href="mailto:root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC">root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC</A><BR></SPAN></FONT><FONT
size=2 face=Arial><SPAN class=463402519-30032012> (lldb) process connect
localhost<BR> error: remote connections are not supported<BR> (lldb)
exit<BR> Segmentation fault (core dumped)<BR></SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN class=463402519-30032012>Stack
trace:</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN
class=463402519-30032012></SPAN></FONT> </DIV>
<DIV><FONT size=2 face=Arial><SPAN class=463402519-30032012>Program received
signal SIGSEGV, Segmentation fault.<BR>ProcessMonitor::GetPID (this=0x0) at
ProcessMonitor.h:67<BR>67 GetPID() const { return m_pid;
}<BR>(gdb) bt<BR>#0 ProcessMonitor::GetPID (this=0x0) at
ProcessMonitor.h:67<BR>#1 0x00000008023b6890 in ProcessPOSIX::DoDestroy
(this=0x805f4b800) at
/usr/home/projects/llvm-lldb/tools/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp:295<BR>#2
0x0000000801703ff6 in lldb_private::Process::Destroy (this=0x805f4b800) at
/usr/home/projects/llvm-lldb/tools/lldb/source/Target/Process.cpp:2887<BR>#3
0x0000000801729be4 in lldb_private::Target::DeleteCurrentProcess
(this=0x808b8d600) at
/usr/home/projects/llvm-lldb/tools/lldb/source/Target/Target.cpp:132<BR>#4
0x00000008012fdf03 in CommandObjectProcessConnect::Execute (this=0x805c2fc00, <A
href="mailto:command=@0x7fffffffbf00">command=@0x7fffffffbf00</A>, <A
href="mailto:result=@0x805d48140">result=@0x805d48140</A>)<BR>
at
/usr/home/projects/llvm-lldb/tools/lldb/source/Commands/CommandObjectProcess.cpp:883<BR>#5
0x00000008014bdf40 in lldb_private::CommandObject::ExecuteWithOptions
(this=0x805c2fc00, <A
href="mailto:args=@0x7fffffffbf00">args=@0x7fffffffbf00</A>, <A
href="mailto:result=@0x805d48140">result=@0x805d48140</A>)<BR>
at
/usr/home/projects/llvm-lldb/tools/lldb/source/Interpreter/CommandObject.cpp:281<BR>#6
0x00000008014b2283 in lldb_private::CommandInterpreter::HandleCommand
(this=0x805ca4200, command_line=0x80a41f198 "process connect
connect://localhost", add_to_history=true, <BR> <A
href="mailto:result=@0x805d48140">result=@0x805d48140</A>, override_context=0x0,
repeat_on_empty_command=true, no_context_switching=false) at
/usr/home/projects/llvm-lldb/tools/lldb/source/Interpreter/CommandInterpreter.cpp:1540<BR>#7
0x000000080124a7b5 in lldb::SBCommandInterpreter::HandleCommand
(this=0x7fffffffc2e0, command_line=0x80a41f198 "process connect
connect://localhost", <A
href="mailto:result=@0x7fffffffc2e8">result=@0x7fffffffc2e8</A>,
<BR> add_to_history=true) at
/usr/home/projects/llvm-lldb/tools/lldb/source/API/SBCommandInterpreter.cpp:97<BR>#8
0x000000000040b666 in Driver::HandleIOEvent (this=0x7fffffffd708, <A
href="mailto:event=@0x7fffffffc550">event=@0x7fffffffc550</A>) at
/usr/home/projects/llvm-lldb/tools/lldb/tools/driver/Driver.cpp:980<BR>#9
0x000000000040cc3e in Driver::MainLoop (this=0x7fffffffd708) at
/usr/home/projects/llvm-lldb/tools/lldb/tools/driver/Driver.cpp:1406<BR>#10
0x000000000040d28b in main (argc=2, argv=0x7fffffffd878, envp=0x7fffffffd890) at
/usr/home/projects/llvm-lldb/tools/lldb/tools/driver/Driver.cpp:1540<BR></SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN
class=463402519-30032012> </DIV></SPAN></FONT>
<DIV><FONT size=2 face=Arial><SPAN class=463402519-30032012>Would somebody
review and apply this patch if it looks ok?</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN
class=463402519-30032012>Thanks.</SPAN></FONT></DIV>
<DIV><FONT size=2 face=Arial><SPAN
class=463402519-30032012>Viktor.</SPAN></FONT></DIV></BODY></HTML>