[DTrace-devel] [PATCH 4/5] libproc: guard against Puntrace() of terminated processes

Nick Alcock nick.alcock at oracle.com
Tue Dec 3 18:06:30 UTC 2024


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)



More information about the DTrace-devel mailing list