From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 83A7D385841B; Fri, 10 Sep 2021 23:15:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83A7D385841B From: "glibc at v dot ewheeler.net" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: 2.21 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: glibc at v dot ewheeler.net X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 23:15:08 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D18684 Eric Wheeler changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |glibc at v dot ewheeler.net --- Comment #1 from Eric Wheeler --- 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=20 > set ns->_ns_main_searchlist to something. The most appropriate thing is t= o=20 > 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= .=20 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=3Dnew@entry=3D0x87be00) at dl-open= .c:101 101 =3D ns->_ns_main_searchlist->r_nlist + to_add + 8; (gdb) bt #0 0x00007ffff7dee9cd in add_to_global (new=3Dnew@entry=3D0x87be00) at dl-open.c:101 #1 0x00007ffff7def8b0 in dl_open_worker (a=3Da@entry=3D0x7fffffff7418) at dl-open.c:564 #2 0x00007ffff7dea7c4 in _dl_catch_error (objname=3Dobjname@entry=3D0x7fffffff7408, errstring=3Derrstring@entry=3D0x7fffffff7410, mallocedp=3Dmallocedp@entry=3D0x7fffffff7400, operate=3Doperate@entry=3D0x7= ffff7def150 , args=3Dargs@entry=3D0x7fffffff7418) at dl-error.c:177 #3 0x00007ffff7deeb7b in _dl_open (file=3D0x7fffffffc650 "/opt/intel/compilers_and_libraries_2020.4.304/linux/mkl/lib/intel64_lin/li= bmkl_core.so", mode=3D-2147483391, caller_dlopen=3D, nsid=3D-2, argc=3D2, argv=3D0x7fffffffe118, env=3D0x6feee0) at dl-open.c:649 Is there a workaround we can do from our code without touching glibc internals? Thanks for your help! -Eric --=20 You are receiving this mail because: You are on the CC list for the bug.=