Re: [PATCH] MIPS/GDB/linux-nat.c: Fix a child detach condition for uClibc-ng

Maciej W. Rozycki
2018-07-09T11:20:47Z

On Fri, 6 Jul 2018, Andrew Burgess wrote:

> The problem is that signal 0x00 isn't coming from the kernel, it's
> being synthesised in GDB with 'W_STOPCODE (0)', which builds the
> status 007f.

Right, somehow I didn't fully realise that it is GDB being responsible
for creating this status code artificially. Sorry for the confusion.

> I might even be bold enough to declare that 'W_STOPCODE (0)' should be
> declare a bad thing .... maybe ...

I think it would be reasonable for an implementation to require the
argument to be a valid signal number and therefore users of this API
would have to avoid passing other numbers as that would cause undefined
behaviour.

> Still, I don't see how uClibc-ng is doing anything wrong, a status is
> only a stop status if (a) it ends in 0x7f, and (b) the signal number
> is non-zero, this seems pretty reasonable really.

Agreed. Garbage in, garbage out.

Maciej