<div dir="ltr"><div><div><div>It's possible others aren't seeing this but on Ubuntu 12.04 64 bits, when I exit lldb I get a few randomish garbage characters spewed to the terminal.  It appears the problem is the shutdown of master_out_comm in tools/driver/Driver.cpp around line 1591.  But I'm not sure I know enough about how this works to say what I'm doing to fix it is the best solution.  Other code for handling a Communication clear appears to shut them down by doing the following:<br>
<br>    SetReadThreadBytesReceivedCallback (NULL, NULL);<br>    Disconnect (NULL);<br>    StopReadThread (NULL);<br><br></div>Using this sequence on the master_out_comm seems to stop it from spewing random characters while quiting.  Just stoping the read thread wasn't a good solution, since it caused a huge pause.  Had to set the callback to NULL and disconnect first.<br>
<br>It also seemed kind of odd to me that you are closing the editline_output_pty before shutting down master_out_comm and out_comm_2 (which both were passed the editline file descriptor).  So I moved that CloseMasterFileDescriptor down after shutting down master_out_comm and out_comm_2.  Not sure this really needed to be done(didn't make any visible difference), but it felt right.<br>
<br></div>Here's the patch -- it seems to work for me (but I have no Mac to test it on), it's very possible I'm completely misunderstanding how this should work.  I'm still trying to get my feet wet on this code base.  Thanks,<br>
<br></div><div><br><br>Index: tools/driver/Driver.cpp<br>===================================================================<br>--- tools/driver/Driver.cpp    (revision 182137)<br>+++ tools/driver/Driver.cpp    (working copy)<br>
@@ -1587,9 +1587,16 @@<br>                 }<br>             }<br> <br>-            editline_output_pty.CloseMasterFileDescriptor();<br>+<br>+            master_out_comm.SetReadThreadBytesReceivedCallback(NULL, NULL);<br>
             master_out_comm.Disconnect();<br>+            master_out_comm.ReadThreadStop();<br>+<br>+            out_comm_2.SetReadThreadBytesReceivedCallback(NULL, NULL);<br>             out_comm_2.Disconnect();<br>+            out_comm_2.ReadThreadStop();            <br>
+<br>+            editline_output_pty.CloseMasterFileDescriptor();<br>             reset_stdin_termios();<br>             fclose (stdin);<br> <br><br></div></div>