From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C489F3857C6F; Wed, 13 Mar 2024 20:27:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C489F3857C6F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1710361676; bh=iXM3ljTUY6c9J17AWiWBAYPw3bFkz9Dc4GaABV2TzoI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KiFO+75mH5Evf0UPkOUDCMWXn1OIGqXwYgDk2plc2ESuo8cIZBSdhgqGRvLyeIn5y LD56QC56gH7U3WT4azit1PA5oRLfLQ2tnEShia9PBvi6A4WfecdC1DJMKHmP1wh0Qw Lw37niAk8KlriP61zD41FrZt3xaYgj9PBHZPgiyk= From: "conanhc at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/25615] dlopen RTLD_NOLOAD optimization Date: Wed, 13 Mar 2024 20:27:56 +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.31 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: conanhc at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status resolution 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 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D25615 Conan Huang changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #2 from Conan Huang --- Optimization breaks following scenario: If we dlopen(library, RTLD_NOLOAD | RTLD_LAZY). If that library doesn't have its local search scope already set up (l_local_scope). Then dlopen will set= it up by calling _dl_map_object_deps and going thru its dependencies. With NOLOAD optimization patch, it'll skip _dl_map_object_deps, and not set= up l_local_scope. If we call dlsym after dlopen(library, RTLD_NOLOAD), dynamic loader tries to search that library's local scope for a definition. If l_local_scope is emp= ty, dynamic loader will segfault. As a result, _dl_map_object_deps is needed to generate l_local_scope. --=20 You are receiving this mail because: You are on the CC list for the bug.=