Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make -ansi -D_POSIX_C_SOURCE=200112L -DGCDEBUG=1 work #163

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jpco
Copy link
Collaborator

@jpco jpco commented Dec 28, 2024

This modifies the GCDEBUG stuff to be more standards-compliant. It removes the (nonfunctional, it turns out, on both macOS and the Hurd) special-cased mach stuff, changes the caddr_t to a void *, accounts for MAP_ANONYMOUS vs. MAP_ANON, and adds fallback behavior in case mmap() or mprotect() are missing. I tested that the fallback behavior still causes the shell to quickly implode when memory bugs are present. So this fixes #155. At the same time I added a fallback from va_copy to __va_copy to fix #157.

Tested on my usual set of OSes -- the Hurd, FreeBSD, Haiku, Omni OS, and Linux -- and on all of them -DGCDEBUG=1 works, both with and without -ansi -D_POSIX_C_SOURCE=200112L -DNSIG=28. I also tested macOS, and it works with -DGCDEBUG=1, but with the ansi flags, HAVE_MMAP needs to be turned off manually. Given this is still an improvement on the previous state on macOS, I'm not too motivated to investigate that at the moment :)

@jpco jpco changed the title More portable, more standards-compliant GCDEBUG Make -ansi -D_POSIX_C_SOURCE=200112L -DGCDEBUG=1 work Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant