During PCProcess::bootstrapProcess(), many syscalls are instrumented, which may involve DyninstAPI_RT breakpoints. If the mutator later detaches, then there's no one to catch the instrumentation signal, so the detached mutatee will crash.
With this patch, PCProcess will remove its syscall instrumentation points when the mutator detaches. It's still up to mutators to remove their own instrumentation when desired. Reported-by: Zifei Tong <[email protected]> Signed-off-by: Josh Stone <[email protected]> --- dyninstAPI/src/dynProcess.C | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dyninstAPI/src/dynProcess.C b/dyninstAPI/src/dynProcess.C index c3c28c6..de9945e 100644 --- a/dyninstAPI/src/dynProcess.C +++ b/dyninstAPI/src/dynProcess.C @@ -1163,6 +1163,15 @@ bool PCProcess::detachProcess(bool /*cont*/) { if( !isAttached() ) return false; + if (tracedSyscalls_) { + tracedSyscalls_->removePreFork(); + tracedSyscalls_->removePostFork(); + tracedSyscalls_->removePreExec(); + tracedSyscalls_->removePostExec(); + tracedSyscalls_->removePreExit(); + tracedSyscalls_->removePreLwpExit(); + } + // TODO figure out if ProcControl should care about continuing a process // after detach -- 1.8.3.1 _______________________________________________ Dyninst-api mailing list [email protected] https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api
