Skip to content

Commit 6070923

Browse files
committed
Fix GH-16849: Error dialog causes process to hang
If `_DEBUG` is set, assertion failures and errors are directed to a debug message window by default[1]. That causes a process to hang, since these dialogs are modal. While we already cater to assertion failures, errors have apparently been overlooked. We choose a minimal fix for BC reasons; although passing `0` as `reportMode` is undocumented, it obviously works fine for a long time. We may consider to improve on this for the `master` branch. [1] <https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/crtsetreportmode>
1 parent fc1db70 commit 6070923

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2070,8 +2070,9 @@ zend_result php_module_startup(sapi_module_struct *sf, zend_module_entry *additi
20702070
_set_invalid_parameter_handler(old_invalid_parameter_handler);
20712071
}
20722072

2073-
/* Disable the message box for assertions.*/
2073+
/* Disable the message box for assertions and errors.*/
20742074
_CrtSetReportMode(_CRT_ASSERT, 0);
2075+
_CrtSetReportMode(_CRT_ERROR, 0);
20752076
#else
20762077
php_os = PHP_OS;
20772078
#endif

0 commit comments

Comments
 (0)