This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Correct global-scope dlopen issues in static executables
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: "Maciej W. Rozycki" <macro at codesourcery dot com>
- Cc: <libc-alpha at sourceware dot org>, <libc-ports at sourceware dot org>
- Date: Wed, 16 Jan 2013 20:30:00 +0000
- Subject: Re: [PATCH] Correct global-scope dlopen issues in static executables
- References: <alpine.DEB.1.10.1301152056590.4834@tp.orcam.me.uk>
On Wed, 16 Jan 2013, Maciej W. Rozycki wrote:
> We have two issues with dlopen issued from static executables when the
> global scope is accessed.
>
> First, an attempt to add a dynamic shared module to the global scope
> (i.e. with RTLD_GLOBAL requested) crashes like this:
>
> Program received signal SIGSEGV, Segmentation fault.
> add_to_global (new=0x49ef60) at dl-open.c:101
> 101 ns->_ns_global_scope_alloc
>
> This is because at this point in static executables no global search list
> data structure has been initialised and as result the _ns_main_searchlist
> member of _dl_ns[LM_ID_BASE] (the initial namespace) is null.
>
> Second, an attempt to access the global scope itself (i.e. by using a
> null file name pointer) fails with an obscure error like:
Could you file a bug (or two bugs) for these issues in glibc Bugzilla
(component dynamic-link), if there isn't already one there? We like to
have a bug in Bugzilla for any patch submission that fixes a user-visible
bug that was present in a glibc release, so that the issue remains visible
if the patch takes a while to review and so that people can search
resolved bugs in Bugzilla to see if a bug they have found in a past
release is known and fixed. See item 1 at
<http://sourceware.org/glibc/wiki/Contribution%20checklist>. (The fixed
bugs are then listed using [BZ #N] notation in the ChangeLog entries for
the patch that fixes them, and added to the list of fixed bugs in NEWS
when committing the patch.)
I hope someone more familiar with the details of the dynamic linker will
review the substance of this patch.
--
Joseph S. Myers
joseph@codesourcery.com