public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "glibc at v dot ewheeler.net" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug dynamic-link/18684] dlmopen a DSO that dlopen's into RTLD_GLOBAL segfaults.
Date: Fri, 10 Sep 2021 23:15:08 +0000 [thread overview]
Message-ID: <bug-18684-131-pJCgSj9jvw@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-18684-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=18684
Eric Wheeler <glibc at v dot ewheeler.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |glibc at v dot ewheeler.net
--- Comment #1 from Eric Wheeler <glibc at v dot ewheeler.net> ---
I could be wrong, but Carlos's suggested fix sounds simple and reasonable:
> We need a similar initialization in elf/dl-open.c (add_to_global) and
> set ns->_ns_main_searchlist to something. The most appropriate thing is to
> set it to the searchlist of the first DSO loaded into the namespace with
> RTLD_GLOBAL.
Can the priority be bumped here?
We just hit this trying to load Intel's libmkl_rt.so into its own namespace.
Here are the detailf from gdb, looks like the same thing Carlos hit:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7dee9cd in add_to_global (new=new@entry=0x87be00) at dl-open.c:101
101 = ns->_ns_main_searchlist->r_nlist + to_add + 8;
(gdb) bt
#0 0x00007ffff7dee9cd in add_to_global (new=new@entry=0x87be00) at
dl-open.c:101
#1 0x00007ffff7def8b0 in dl_open_worker (a=a@entry=0x7fffffff7418) at
dl-open.c:564
#2 0x00007ffff7dea7c4 in _dl_catch_error
(objname=objname@entry=0x7fffffff7408,
errstring=errstring@entry=0x7fffffff7410,
mallocedp=mallocedp@entry=0x7fffffff7400, operate=operate@entry=0x7ffff7def150
<dl_open_worker>, args=args@entry=0x7fffffff7418) at dl-error.c:177
#3 0x00007ffff7deeb7b in _dl_open (file=0x7fffffffc650
"/opt/intel/compilers_and_libraries_2020.4.304/linux/mkl/lib/intel64_lin/libmkl_core.so",
mode=-2147483391, caller_dlopen=<optimized out>, nsid=-2, argc=2,
argv=0x7fffffffe118, env=0x6feee0) at dl-open.c:649
Is there a workaround we can do from our code without touching glibc
internals?
Thanks for your help!
-Eric
--
You are receiving this mail because:
You are on the CC list for the bug.
next prev parent reply other threads:[~2021-09-10 23:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-16 3:15 [Bug dynamic-link/18684] New: " carlos at redhat dot com
2015-10-16 21:36 ` [Bug dynamic-link/18684] " orion at cora dot nwra.com
2021-09-10 23:15 ` glibc at v dot ewheeler.net [this message]
2021-09-10 23:18 ` glibc at v dot ewheeler.net
2021-09-10 23:28 ` glibc at v dot ewheeler.net
2022-10-08 8:47 ` mtk.manpages at gmail dot com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-18684-131-pJCgSj9jvw@http.sourceware.org/bugzilla/ \
--to=sourceware-bugzilla@sourceware.org \
--cc=glibc-bugs@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).