Re: [DynInst_API:] How about unloadLibrary() ?


Date: Fri, 26 Oct 2012 10:14:10 -0500
From: Andrew Bernat <bernat@xxxxxxxxxxx>
Subject: Re: [DynInst_API:] How about unloadLibrary() ?
On Oct 25, 2012, at 7:49 PM, Josh Stone <jistone@xxxxxxxxxx> wrote:

Hi,

A big part of our Dyninst usage involves BPatch_process::loadLibrary to
inject our own code.  But I can't find a parallel unloadLibrary to call
when we detach.  Would this be possible to add?

Yes, but. And it's always the "but" that's hard. 

We've talked about implementing a library unload. The concern is that if any instrumentation references that library, the user may cause unexpected and hard to track down behavior. Since dynamic instrumentation is hard-coded instead of using function pointers, such calls could be executed well after the library is unloaded. 

We'll be happy to discuss implementation and limitations, but it'll be a post-8.0 thing. That doesn't mean far future, though, since we hope to have 8.0 out within a month. 

Drew


It could be a directly parallel method of BPatch_process, or perhaps a
method of BPatch_object and/or BPatch_module.  I looked a bit at how
DYNINSTloadLibrary works in RTlinux.c, and it's currently discarding the
handle from dlopen -- so if that's not recoverable elsewhere, then the
RT may have to save it somewhere.

Thoughts?

Thanks,
Josh
_______________________________________________
Dyninst-api mailing list
Dyninst-api@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/dyninst-api




[← Prev in Thread] Current Thread [Next in Thread→]