aboutsummaryrefslogtreecommitdiff
path: root/include/gcc-c-interface.h
diff options
context:
space:
mode:
authorKen Brown <kbrown@cornell.edu>2024-12-27 10:10:06 -0500
committerKen Brown <kbrown@cornell.edu>2025-01-07 16:34:27 -0500
commit8adc45fdece5d8ea8017e635575562b76c4e9bcd (patch)
tree3297586a98e23ac2c96cfeb39445f00e0756edd2 /include/gcc-c-interface.h
parent5e5e51f1dc56a99eb4648c28e00d73b6ea44a8b0 (diff)
downloadnewlib-8adc45fdece5d8ea8017e635575562b76c4e9bcd.zip
newlib-8adc45fdece5d8ea8017e635575562b76c4e9bcd.tar.gz
newlib-8adc45fdece5d8ea8017e635575562b76c4e9bcd.tar.bz2
Cygwin: mmap: fix mmap_is_attached_or_noreserve
This commit fixes two problems. The first is that mmap_is_attached_or_noreserve would sometimes call VirtualAlloc with MEM_COMMIT on address ranges that were not known to have MEM_RESERVE status. These calls could fail, causing SIGBUS to be raised incorrectly. See https://cygwin.com/pipermail/cygwin-developers/2024-December/012725.html for details. Fix this by calling VirtualAlloc only on the part of the address range that's contained in the current mmap_record. The second problem is that the code would sometimes break out of the main loop without knowing whether attached mappings still occur later in the mmap_list. This could cause SIGBUS to not be raised when it should be. Fix this by using "continue" rather than "break". For efficiency, introduce a boolean variable "nocover" that's set to true if we discover that the address range cannot be covered by noreserve mmap regions. Addresses: https://cygwin.com/pipermail/cygwin-developers/2024-December/012725.html Fixes: 70e476d27be8 ("* include/cygwin/version.h: Bump DLL version to 1.7.0") Signed-off-by: Ken Brown <kbrown@cornell.edu>
Diffstat (limited to 'include/gcc-c-interface.h')
0 files changed, 0 insertions, 0 deletions