On 05/21/2014 11:38 AM, Francis Deslauriers wrote:
> Hi,
>
> I am trying to understand how to use Dyninst with running processes. I
> wish to attach to a running process, instrument it, detach from it,
> let it run a bit and reattach to the same process.
>
> I can attach, instrument and detach without any problem but trying to
> reattach to the mutatee process seems to trigger a SIGKILL to the
> mutatee program and print that error by the mutator:
>
> --SERIOUS-- #0: Dyninst was unable to load the dyninst runtime library
> into the application. This may be caused by statically linked
> executables, or by having dyninst linked against a different version
> of libelf than it was built with.
> --FATAL-- #68: Dyninst was unable to attach to the specified process
> --FATAL-- #68: BPatch.C[1038]: no process 18974 defined in procsByPid
>
> Am i missing something? Is there anything to do while detaching to
> specify that i may try to reattach.
>
> Here is an example of mutatee, mutator and instrumentation triggering
> this behavior on my system:
Thanks for the included samples -- I was able to reproduce the issue.
Is your DYNINSTAPI_RT_LIB pointing to a symlink? That's how I had mine
at first, and I think it's getting confused by this, not realizing that
the RT is already loaded in the target. I changed to:
DYNINSTAPI_RT_LIB=$(realpath $DYNINSTAPI_RT_LIB)
and then the reattach started working fine.
Please confirm if that helps you. I'll see about having dyninst
automatically normalize the given path itself.
Josh
|