All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Alcock <nick.alcock@oracle.com>
To: Nick Alcock via DTrace-devel <dtrace-devel@oss.oracle.com>
Cc: dtrace@lists.linux.dev
Subject: Re: [DTrace-devel] [PATCH 4/5] libproc: guard against Puntrace() of terminated processes
Date: Tue, 03 Dec 2024 18:06:30 +0000	[thread overview]
Message-ID: <87ed2ozlnd.fsf@esperi.org.uk> (raw)
In-Reply-To: <20241203113610.75104-5-nick.alcock@oracle.com> (Nick Alcock via DTrace-devel's message of "Tue, 3 Dec 2024 11:36:09 +0000")

On 3 Dec 2024, Nick Alcock via DTrace-devel spake thusly:

> If processes terminate while the main dtrace thread is doing something in
> libproc, the process-control thread will clean up, releasing all resources,
> including cancelling all ptraces.  Unfortunately if the main thread is in
> the middle of a Ptrace()-related operation at the time, it will finish off
> by doing a balancing Puntrace().  This is of course now unbalanced, because
> the process cleanup did all the Puntrace()s for us; it will then try to pop
> a state vector that has already been freed, yielding a crash that looks like
> this:
>
>     at libproc/rtld_db.c:1934
>     at libdtrace/dt_pid.c:987
>     at libdtrace/dt_pid.c:1265
>     rfunc=0x40419e <chewrec>, arg=0x0) at libdtrace/dt_work.c:377

Oh yuck, what the hell happened here?

... gdb backtraces start with a # character and git filtered it out!

Fixed commit coming right away.

-- 
NULL && (void)

  reply	other threads:[~2024-12-03 18:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-03 11:36 [PATCH 0/5] fix test/unittest/usdt/tst.multitrace.sh Nick Alcock
2024-12-03 11:36 ` [PATCH 1/5] Revert "Tweak self-armouring" Nick Alcock
2024-12-07  4:37   ` [DTrace-devel] " Kris Van Hees
2024-12-03 11:36 ` [PATCH 2/5] proc: more self-grab improvements Nick Alcock
2024-12-03 13:43   ` Nick Alcock
2024-12-05 12:58     ` Nick Alcock
2024-12-05 13:43       ` [DTrace-devel] " Nick Alcock
2024-12-07  4:38   ` Kris Van Hees
2024-12-03 11:36 ` [PATCH 3/5] libproc: debugging improvements Nick Alcock
2024-12-07  4:38   ` Kris Van Hees
2024-12-03 11:36 ` [PATCH 4/5] libproc: guard against Puntrace() of terminated processes Nick Alcock
2024-12-03 18:06   ` Nick Alcock [this message]
2024-12-03 18:09     ` Nick Alcock
2024-12-07  4:38       ` Kris Van Hees
2024-12-03 11:36 ` [PATCH 5/5] libproc: drop Pgrab() special cases in Ptrace() Nick Alcock
2024-12-07  4:40   ` Kris Van Hees

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=87ed2ozlnd.fsf@esperi.org.uk \
    --to=nick.alcock@oracle.com \
    --cc=dtrace-devel@oss.oracle.com \
    --cc=dtrace@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.