From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0C4C23858C1F; Tue, 22 Nov 2022 12:30:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C4C23858C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669120201; bh=gvZ/vweyLdsRcl2fATKRGm8WvgR1B2O3sijA2ow2mDI=; h=From:To:Subject:Date:From; b=OgikVliDOlVmO5EP75heo6uGs0aDDAbLzmi/nrysk9gqKwBhqp2m/sOSIpU+Y/TNH Puz5YfyUhExvG7leV1u9OaRLjDHM5e/ZrE7x7y4YMmmKqLkCNaea3T5OFpqxEdQOUO H4Id5aJTDh5Ii+yvjU3xG3bfvZCtR9He45w9OVto= From: "aburgess at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/29818] New: STAP probe map_failed is no longer generated. Date: Tue, 22 Nov 2022 12:29:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: aburgess at redhat dot com 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: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: 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=3D29818 Bug ID: 29818 Summary: STAP probe map_failed is no longer generated. Product: glibc Version: unspecified Status: NEW Severity: normal Priority: P2 Component: dynamic-link Assignee: unassigned at sourceware dot org Reporter: aburgess at redhat dot com Target Milestone: --- Created attachment 14472 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D14472&action=3Ded= it Remove the map_failed probe. While working on GDB, I noticed that in recent glibc, the map_failed probe = was no longer being generated within the dynamic linker. The reason is that the 'map_failed' probe is being optimised out by the compiler after this commit: commit ed3ce71f5c64c5f07cbde0ef03554ea8950d8f2c Author: Adhemerval Zanella Date: Thu Nov 11 09:28:21 2021 -0300 elf: Move la_activity (LA_ACT_ADD) after _dl_add_to_namespace_list() = (BZ #28062) The problem is that the map_failed probe is guarded like this: if (make_consistent && r !=3D NULL) { r->r_state =3D RT_CONSISTENT; _dl_debug_state (); LIBC_PROBE (map_failed, 2, nsid, r); } After the above commit the make_consistent variable can never be true when = this block of code is reached, as such, the compiler has optimised away this blo= ck, including the map_failed probe within it. Both the map_start and map_failed probes are in the function _dl_map_object_from_fd. Before the above commit it is was possible to reach the map_start probe, and then later in the function, decide that actually, = we couldn't map the requested file for some reason. We would then exit _dl_map_object_from_fd, but first we would pass through = the map_failed probe, this would allow observers to know that the mapping, identified by the previous map_start probe, had failed. After the above commit, the map_start probe is now only reached at the very= end of the function _dl_map_object_from_fd, when all other error checks have already been completed. As such, there is no longer a need for a map_failed probe. If an observer sees map_start, then they can know that the mapping = will proceed. This bug is really just me asking for confirmation of the above understandi= ng.=20 >From the GDB side, we were never actually using map_start / map_failed, but= we did check for both probes, so the absence of map_failed was causing GDB to = not make use of the probes. I already plan to remove the map_failed check from= GDB given there are glibc in the wild without that probe. But it would be nice= to confirm that the probe is now deprecated. I've attached a patch that removes the map_failed probe, but this is comple= tely untested. --=20 You are receiving this mail because: You are on the CC list for the bug.=