Re: [DynInst_API:] Deleting snippets


Date: Wed, 18 Nov 2015 15:45:56 +0000
From: Bill Williams <bill@xxxxxxxxxxx>
Subject: Re: [DynInst_API:] Deleting snippets
This should actually be safe. Deleting a snippet will create another copy of the function without the deleted snippet and redirect all springboards there, and the same safety guarantees that hold for insertion in general should hold here.

If you want to be a) paranoid, and b) more efficient with memory, you can wrap your snippets in conditionals that enable/disable them as needed.

________________________________________
From: Dyninst-api <dyninst-api-bounces@xxxxxxxxxxx> on behalf of Marc Brünink <marc@xxxxxxxxx>
Sent: Tuesday, November 17, 2015 9:08 PM
To: dyninst-api@xxxxxxxxxxx
Subject: Re: [DynInst_API:] Deleting snippets

Hi,

I think I never got an answer to this one, did I?
-> Is it safe to delete snippets while a thread is executing them?

I suppose not. BPatchAddressSpace::deleteSnippet also seems to support the “no, not safe” assumption.

So what is the best practice to delete a snippet?
Currently I just disable them using a flag.

To actually delete them the way forward seems to be to
1. Disable the snippet
2. Queue them for deletion
3. Wait until I get lucky enough that no thread is actually executing the snippet.

#3 might never happen, though.

So how to delete snippets?


Marc


> On 30 Mar 2015, at 4:32 pm, Marc Brünink <marc@xxxxxxxxx> wrote:
>
> Dear all,
>
> is it safe to delete a snippet while a thread is actually executing the snippet?
> If not, what is the current best practice to delete a snippet?
>
> Kind regards,
> Marc


_______________________________________________
Dyninst-api mailing list
Dyninst-api@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api
[← Prev in Thread] Current Thread [Next in Thread→]