Yes, Dyninst was designed to allow safe live insertion and deletion of snippets.

--bart


On 11/18/2015 9:45 AM, Bill Williams wrote:
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 <[email protected]> on behalf of Marc Brünink 
<[email protected]>
Sent: Tuesday, November 17, 2015 9:08 PM
To: [email protected]
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 <[email protected]> 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
[email protected]
https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api
_______________________________________________
Dyninst-api mailing list
[email protected]
https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api

_______________________________________________
Dyninst-api mailing list
[email protected]
https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api

Reply via email to