From 607092385deee351d91a8c9f3f2e77f71d476da3 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 18 Nov 2024 22:54:28 +0100 Subject: [PATCH] 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] --- main/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main/main.c b/main/main.c index 3e03951e87755..b38ef8d2ecf2f 100644 --- a/main/main.c +++ b/main/main.c @@ -2070,8 +2070,9 @@ zend_result php_module_startup(sapi_module_struct *sf, zend_module_entry *additi _set_invalid_parameter_handler(old_invalid_parameter_handler); } - /* Disable the message box for assertions.*/ + /* Disable the message box for assertions and errors.*/ _CrtSetReportMode(_CRT_ASSERT, 0); + _CrtSetReportMode(_CRT_ERROR, 0); #else php_os = PHP_OS; #endif