Skip to content

Commit e75061b

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> Closes GH-16850.
1 parent de96b43 commit e75061b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ PHP NEWS
4747
. Fixed bug GH-16808 (Segmentation fault in RecursiveIteratorIterator
4848
->current() with a xml element input). (nielsdos)
4949

50+
- Windows:
51+
. Fixed bug GH-16849 (Error dialog causes process to hang). (cmb)
52+
5053
21 Nov 2024, PHP 8.2.26
5154

5255
- CLI:

main/main.c

+2-1
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)