This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC][BZ #14577] Unload failed modules even if nodelete is specified.


On Thu, Oct 31, 2013 at 01:13:30PM -0700, Roland McGrath wrote:
> Needs a test case.
> 
> I don't see how that fix could be right.  DF_1_NODELETE is not set until
> after _dl_init is called (and sets l_init_called).
> 
> In fact, it looks to me like there may be a bug in the other direction.
> That is, since DF_1_NODELETE is not set until after _dl_init, the
> initializers themselves could cause a dlclose call that results in their
> own removal.  When RTLD_NODELETE was not requested, that would just be a
> bug in the module itself.  But with RTLD_NODELETE, the module has a
> reasonable expectation that dlclose would be a no-op.  Maybe you'd like to
> write a test case for that scenario as well?

A testcase is in bugzilla. 
https://sourceware.org/bugzilla/attachment.cgi?id=6633

A problem here is that unload was caused by unresolved function when
RTLD_NOW is passed to library with NODELETE.

LD_BIND_NOW=1 ./program 
Opening module.so (first attempt)...
Result: fail
Opening module.so (second attempt)...
Result: OK
Getting function...
Result: OK
Calling function...
Segmentation fault (core dumped)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]