labath added inline comments.

================
Comment at: source/Target/Process.cpp:3934
@@ +3933,3 @@
+
+            ListenerSP listener_sp (new 
Listener("lldb.Process.HaltForDestroyOrDetach.hijack"));
+            HijackProcessEvents(listener_sp.get());
----------------
ki.stfu wrote:
> btw: please update this line when Process::HaltForDestroyOrDetach will be 
> renamed to StopForDestroyOrDetach
The renaming patch has landed in r248371.

I am not sure about this, as I don't understand the full context of this 
change, so take this comment with a grain of salt. However, this seems to be 
introducing a race here... If I understand correctly, you are trying to make 
sure that someone else (sitting in another thread, waiting for public process 
events) does not snatch the process stop event from under you. If that is the 
case then this can still happen if the process stops very quickly (i.e., the 
event is broadcast after SendAsyncInterrupt(), but before 
HijackProcessEvents()). To avoid this, I think you should hijack the events 
before you interrupt the process, possibly even before StopForDestroyOrDetach 
is called (to handle the case when the process stops naturally just as you are 
about to kill it). Have you figured out what is the other thread doing that is 
causing the crash (i.e., where is the memory WaitForProcessToStop is 
referencing freed?)

I'd be interested to hear what Greg and Jim have to say about this..


Repository:
  rL LLVM

http://reviews.llvm.org/D12968



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to