This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC][BZ #14577] Unload failed modules even if nodelete is specified.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 31 Oct 2013 21:43:52 +0100
- Subject: Re: [RFC][BZ #14577] Unload failed modules even if nodelete is specified.
- Authentication-results: sourceware.org; auth=none
- References: <20131026084410 dot GA17601 at domone dot podge> <20131031201330 dot D14837469D at topped-with-meat dot com>
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)