Re: [PATCH] kill all threadapply processes at end of test

Pedro Franco de Carvalho via Gdb-patches
2021-05-18T21:57:05Z

Hello,

I didn't review the patch in detail, but one concern is that this could
cause a pid recycling issue. After expect gets the pid from the stopped
inferior, and the gdb under expect detaches from the inferior, it could
happen that the inferior finishes, there's lots and lots of processes in
the test system, and that same pid might get reused for a completely
different process, which GDB would attach to and kill, assuming it has
ptrace privileges over it. This might be unlikely, but it would be bad
for the testsuite to kill a random process in the system. I'm not sure
if there's an easy and portable solution to this.

Apart from that, it might be simpler to do the attaching and killing
inside proc thr_apply_detach.

Thanks,
Pedro Franco de Carvalho