Re: [DynInst_API:] Reattaching to a process crashes


Date: Thu, 22 May 2014 14:41:38 -0400
From: Francis Deslauriers <fdeslaur@xxxxxxxxx>
Subject: Re: [DynInst_API:] Reattaching to a process crashes
Yes, it fixes my issue.

Thanks!

Francis

On Thu, May 22, 2014 at 1:42 PM, Josh Stone <jistone@xxxxxxxxxx> wrote:
> 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
[← Prev in Thread] Current Thread [Next in Thread→]