Hi, 

This is an attempt to solve the first problem that I talked in the previous 
patchset. 
1. register_uprobe/unregister_uprobe may cause deadlock

Currently if uprobes engine were in the midst of singlestepping a
breakpoint, it wouldnt allow register/unregister of probes to continue
until the singlestep operation completes.  However tracing thread that
could be registering/unregistering a probe could have already requested
the thread that was in the midst of singlestepping to STOP. 

This leads to a deadlock, 
 - register/unregistering thread waits for reg/unreg to complete before
   resuming the thread
 - singlestepping thread waiting for it to be resumed and complete
   singlestepping before it could quiesce and allow register/unregister
   to complete.

This patch tries to fix this problem by using the existing
defer_registration. 
Once we defer the request, the registering thread would then resume the
singlestepping thread which would pick up the deferred registration.

Subject: [PATCH 0/2] Fixes to gdbstub.
File: /tmp/gdbstub-patches/2/intro
Subject: [PATCH 1/2] Defer register/unregister if thread is stopped.
File: /tmp/gdbstub-patches/2/uc_make_defer_un_register_uprobe.patch
Subject: [PATCH 2/2] Allow deferred register/unregister of uprobes.
File: /tmp/gdbstub-patches/2/gs_use_deferred_register_uprobe.patch 

--
Thanks and Regards
Srikar Dronamraju

Reply via email to