bug#42530: 28.0.50; Integer overflows in alloc.c on macOS
-fsanitize=undefined finds the following integer overflows in alloc.c:
alloc.c:4641:33: runtime error: addition of unsigned offset to 0x000102496c05 overflowed to 0x000102496c00
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior alloc.c:4641:33 in
alloc.c:4852:9: runtime error: pointer index expression with base 0xffffffffffffffff overflowed to 0x00010344053f
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior alloc.c:4852:9 in
I briefly checked the code, but couldn't find anything obviously wrong.
Note that UBSan also checks for unsigned integer overflows, which are
technically not undefined, but might still be fishy. If these overflows
are intended, we should probably use INT_ADD_WRAPV to make that clear
and suppress the sanitizer.
In GNU Emacs 28.0.50 (build 66, x86_64-apple-darwin19.5.0, NS appkit-1894.50 Version 10.15.5 (Build 19F101))
Repository revision: 3b44829823f43d3736b8ec9db2258eeff7f6c16a
Repository branch: master
Windowing system distributor 'Apple', version 10.3.1894
System Description: Mac OS X 10.15.5
For information about GNU Emacs and the GNU system, type C-h C-a.
value of $LANG: de_DE.UTF-8
Major mode: Lisp Interaction
Minor modes in effect: