public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "ulrich.weigand at de dot ibm.com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug tdep/28623] Missing catching return of execve syscall of PowerPC
Date: Thu, 16 Nov 2023 17:00:27 +0000	[thread overview]
Message-ID: <bug-28623-4717-J6sGHXWWqI@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-28623-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=28623

--- Comment #5 from ulrich.weigand at de dot ibm.com ---
So if I get this correctly, the problem is that the execve syscall doesn't
really "return" as such, but rather starts execution at the entry point of the
new executable.  At this point, memory contents reflect the new executable and
register context are reset to the default setting on startup.

This means that you cannot reliably detect that you previously executed execve,
as that requires looking at memory and/or register contents (depending on
platform ABI details).  I guess your suggested patch(es) are heuristics to work
around that problem, but this seems somewhat fragile to me.

On the other hand, there is a reliable way to detect that we just executed an
execve syscall, and that is the TARGET_WAITKIND_EXECD wait state.  Maybe the
catch syscall logic, in the special case of catching execve, should somehow
hook into that event instead?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2023-11-16 17:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-24 19:27 [Bug gdb/28623] New: " simark at simark dot ca
2023-11-16 10:30 ` [Bug gdb/28623] " vries at gcc dot gnu.org
2023-11-16 10:42 ` vries at gcc dot gnu.org
2023-11-16 11:48 ` vries at gcc dot gnu.org
2023-11-16 11:50 ` [Bug tdep/28623] " vries at gcc dot gnu.org
2023-11-16 11:51 ` vries at gcc dot gnu.org
2023-11-16 17:00 ` ulrich.weigand at de dot ibm.com [this message]
2023-11-17 12:37 ` vries at gcc dot gnu.org
2023-11-17 14:32 ` ulrich.weigand at de dot ibm.com
2023-11-17 20:57 ` simon.marchi at polymtl dot ca
2023-11-20 15:44 ` vries at gcc dot gnu.org
2023-11-20 15:49 ` vries at gcc dot gnu.org
2023-11-21 12:42 ` vries at gcc dot gnu.org
2023-11-23 14:53 ` sam at gentoo dot org

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-28623-4717-J6sGHXWWqI@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@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).