This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdb: Fix instability in thread groups test


On 08/13/2018 02:01 PM, Andrew Burgess wrote:
> * Pedro Alves <palves@redhat.com> [2018-08-13 13:03:47 +0100]:

>> I wonder whether we can prevent PID reuse by keeping a descriptor
>> for /proc/PID/ open while we open the other files.  Probably not.
> 
> That was my first though, I tried:
> 
>   - chdir /proc/PID
>   - opendir for /proc/PID
> 
>   - Kill /proc/PID
> 
>   - Read from the opendir handle, find nothing there.
> 
> Which didn't really surprise me, but was worth a try...

Does it return "nothing else" even if you don't kill
the process?  Or does returning nothing indicate the
process is gone already?

Regardless, I don't think that proves keeping the opendir dir handle
open (or some other file under /proc/PID) does not prevent the kernel
from reusing the PID until the handle is closed, even though I
do suspect it does not.

But thinking a bit more, maybe it's useless to try to detect PID reuse,
because the process we're collecting info for can just as well exec,
which makes the info we had collected so far become invalid in pretty
much the same way...

>>> and the original patch to remove the unstable result applied?
>>> Or maybe the test updated to either PASS or KFAIL?
>>
>> I'd prefer the KFAIL option.  At the very least, a comment in
>> the .exp file.
> 
> I'll put something together...

Maybe it's not worth the bother.  After thinking about it some more,
I'll be happy with a comment in the .exp file.

Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]