diff --git a/bin/named/win32/os.c b/bin/named/win32/os.c index 6705940850..c1fe90410c 100644 --- a/bin/named/win32/os.c +++ b/bin/named/win32/os.c @@ -110,6 +110,16 @@ named_os_init(const char *progname) { * ntservice_init(); */ version_check(progname); + /* + * If running in a Cygwin environment, clear the SEM_NOGPFAULTERRORBOX + * bit in the process error mode to prevent Cygwin from concealing + * non-abort() crashes, giving Windows Error Reporting a chance to + * handle such crashes. This is done to ensure all crashes triggered + * by system tests can be detected. + */ + if (getenv("CYGWIN") != NULL) { + SetErrorMode(GetErrorMode() & ~SEM_NOGPFAULTERRORBOX); + } } void