public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: libc-alpha@sourceware.org
Subject: [PATCH] dlopen: skip debugger notification for DSO loaded from sprof (bug 30258)
Date: Thu, 23 Mar 2023 17:33:14 +0100	[thread overview]
Message-ID: <mvm355vwhpx.fsf@suse.de> (raw)

Avoid inconsistent state in the debugger interface.
---
 elf/dl-load.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/elf/dl-load.c b/elf/dl-load.c
index 9a0e40c0e9..39c63ff1b3 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1483,6 +1483,10 @@ cannot enable executable stack as shared object requires");
   /* Now that the object is fully initialized add it to the object list.  */
   _dl_add_to_namespace_list (l, nsid);
 
+  /* Skip auditing and debugger notification when called from 'sprof'.  */
+  if (mode & __RTLD_SPROF)
+    return l;
+
   /* Signal that we are going to add new objects.  */
   struct r_debug *r = _dl_debug_update (nsid);
   if (r->r_state == RT_CONSISTENT)
-- 
2.40.0


-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

             reply	other threads:[~2023-03-23 16:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23 16:33 Andreas Schwab [this message]
2023-03-24 11:18 ` Florian Weimer
2023-05-08 14:08 Andreas Schwab
2023-05-08 16:04 ` Florian Weimer

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=mvm355vwhpx.fsf@suse.de \
    --to=schwab@suse.de \
    --cc=libc-alpha@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).