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


Date: Fri, 26 Oct 2012 11:57:09 -0700
From: Josh Stone <jistone@xxxxxxxxxx>
Subject: Re: [DynInst_API:] How about unloadLibrary() ?
On 10/26/2012 08:42 AM, Barton Miller wrote:
> We have talked about this and there are straightforward ways to do it.
> But as Drew said, it's a post-8.0 issue.

Understood.

> On Oct 26, 2012, at 10:14 AM, Andrew Bernat wrote:
>> On Oct 25, 2012, at 7:49 PM, Josh Stone wrote:
>>> 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. 

Is that really any different than the normal caveats with dlopen and
dlclose?  If you try to use a dlsym pointer after dlclose... boom!

I suppose Dyninst could try to be clever and prevent such errors, but it
seems sufficient to me to state that users must themselves remove any
instrumentation that might be using the library before unload.

>> 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. 

Sounds good, thanks!

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