Bug 197462 - dlmopen with LM_ID_NEWLM and RTLD_GLOBAL segfaults in add_to_global
dlmopen with LM_ID_NEWLM and RTLD_GLOBAL segfaults in add_to_global
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-07-02 04:07 EDT by Nicholas Miell
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version: 2.4.90-15
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-08-07 06:49:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
gdb debugging log (3.79 KB, text/plain)
2006-07-02 04:07 EDT, Nicholas Miell
no flags Details
test program (174 bytes, text/x-csrc)
2006-07-02 04:08 EDT, Nicholas Miell
no flags Details

  None (edit)
Description Nicholas Miell 2006-07-02 04:07:02 EDT
Created attachment 131847 [details]
gdb debugging log
Comment 1 Nicholas Miell 2006-07-02 04:07:02 EDT
dlmopen will segfault in the rtld when passed flags LM_ID_NEWLM and
RTLD_GLOBAL|RTLD_NOW.

Failure is at dl-open.c line 102/103:

99        if (GL(dl_ns)[new->l_ns]._ns_global_scope_alloc == 0)
100         {
101           /* This is the first dynamic object given global scope.  */
102           GL(dl_ns)[new->l_ns]._ns_global_scope_alloc
103             = GL(dl_ns)[new->l_ns]._ns_main_searchlist->r_nlist + to_add + 8;
104           new_global = (struct link_map **)
105             malloc (GL(dl_ns)[new->l_ns]._ns_global_scope_alloc
106                     * sizeof (struct link_map *));

because _rtld_local._dl_ns[new->l_ns]._ns_main_searchlist is NULL.
Comment 2 Nicholas Miell 2006-07-02 04:08:03 EDT
Created attachment 131848 [details]
test program
Comment 3 Ulrich Drepper 2006-07-26 10:35:02 EDT
It makes no sense to use RTLD_GLOBAL when dlmopen loads the object in anything
but the first namespace.  I added a test to catch that upstream.  It'll be in
the next rawhide release.

Note You need to log in before you can comment on or make changes to this bug.