NetBSD-Bugs archive

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

re: kern/58425: negation of pid or pgid is UB for INT_MIN



The following reply was made to PR kern/58425; it has been noted by GNATS.

From: matthew green <mrg%eterna23.net@localhost>
To: Robert Elz <kre%munnari.OZ.AU@localhost>
Cc: netbsd-bugs%netbsd.org@localhost, gnats-bugs%netbsd.org@localhost
Subject: re: kern/58425: negation of pid or pgid is UB for INT_MIN
Date: Sun, 14 Jul 2024 14:57:10 +1000

 >   | This could be a theoretical issue or it could be a practical issue,
 >
 > I believe that unless we have some architecture which traps when
 > executing -INT_MIN rather than just generating INT_MIN as the result
 
 this may not be relevant, but it triggered me. :-)
 
 i recently was dealing with a trap related to exactly this.
 
 i was running atf on m68k virt68k qemu and it crashed the emulator
 itself.  turns out -INT_MAX/-1 traps on x86.
 
 i have this uncommited/unsubmitted patch for qemu:
 
    https://www.netbsd.org/~mrg/patch-target_m68k_op_helper.c
 
 
 .mrg.
 


Home | Main Index | Thread Index | Old Index