NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: toolchain/59549: gdb is not ctype(3) safe



The full patch is 2K lines long (attached). I will apply it if someone else here says I should :-)

christos

Attachment: gdb.patch
Description: Binary data




> On Jul 27, 2025, at 9:31 AM, Taylor R Campbell <riastradh%NetBSD.org@localhost> wrote:
> 
>> Date: Sat, 26 Jul 2025 10:06:15 -0400
>> From: Christos Zoulas <christos%zoulas.com@localhost>
>> 
>>> We should just patch gdb locally and file an upstream bug, basic case
>>> of clear undefined behaviour that is triggered in real-world use.
>>> Christos's patch looks fine to me (but I did not check whether there
>>> are any missing cases).
>> 
>> There are a few more missing, I thought of changing all of the ctype
>> macros to gdb_isfoo() instead of all the local casts.
> 
> Let's let upstream decide how they want to tidy things up (there is
> already a `safe-ctype.h' in binutils with uppercase macros instead,
> restricted to char inputs that are never EOF, but I don't know whether
> it's appropriate here).
> 
>>                                                      I think we should
>> let upstream fix it first.
> 
> This is actively interfering with development and debugging on NetBSD,
> so it is a high priority to work around while we wait for upstream.
> We should just make sure that we're not applying this to any cases
> that might legitimately have EOF in the domain.
> 
> If upstream does it differently, no big deal, we can just replace our
> local patch by their different patch later.

Attachment: signature.asc
Description: Message signed with OpenPGP



Home | Main Index | Thread Index | Old Index