You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now one might think this is an errenous assertion, but there seems to be special support; from what I can tell it works _CRTDBG_MODE_FILE and _CRTDBG_FILE_STDERR have been set. If I only set _CRTDBG_MODE_FILE, the output goes nowhere since the report file defaults to INVALID_HANDLE_VALUE.
Dialog asserts are still generated during tests.
Not really. The dialogs are about the inevitable error after an assertion failure where abort() will be called.
I think it's probably best to choose a minimal solution as bug fix (i.e. add _CrtSetReportMode(_CRT_ERROR, 0);), and possibly be more fancy as new feature (the dialogs are nifty during testing if a post-mortem debugger is attached).
However, setting PHP_WIN32_HEAP_DEBUG enables a bunch of other stuff that isn't necessarily wanted.
Well, it's likely the best memory leak detector available for MSVC builds (might find a couple of other memory related issues, but ASan is far superior). Set USE_ZEND_ALLOC=0, USE_TRACKED_ALLOC=1 and PHP_WIN32_DEBUG_HEAP=1 to find leaks when running php.exe (not implemented for other SAPIs).
Just an FYI @cmb69 this fix seems to prevent catching assertion failures under Visual Studio Debugger. Might be worth gating these report mode changes behind !IsDebuggerPresent().
Thanks for the update, @dktapps! I don't think this is caused by e75061b, but there is certainly room for improvement. I'll try to have a closer look, but wouldn't be sad if someone beats me to it – PRs welcome!
Activity
cmb69 commentedon Nov 18, 2024
Indeed, it is undocumented. If I pass e.g.
16instead, I get:Now one might think this is an errenous assertion, but there seems to be special support; from what I can tell it works
_CRTDBG_MODE_FILEand_CRTDBG_FILE_STDERRhave been set. If I only set_CRTDBG_MODE_FILE, the output goes nowhere since the report file defaults toINVALID_HANDLE_VALUE.Not really. The dialogs are about the inevitable error after an assertion failure where
abort()will be called.I think it's probably best to choose a minimal solution as bug fix (i.e. add
_CrtSetReportMode(_CRT_ERROR, 0);), and possibly be more fancy as new feature (the dialogs are nifty during testing if a post-mortem debugger is attached).cmb69 commentedon Nov 18, 2024
Well, it's likely the best memory leak detector available for MSVC builds (might find a couple of other memory related issues, but ASan is far superior). Set
USE_ZEND_ALLOC=0,USE_TRACKED_ALLOC=1andPHP_WIN32_DEBUG_HEAP=1to find leaks when running php.exe (not implemented for other SAPIs).[-]Windows VC++ Runtime assert dialogs are not actually disabled[/-][+]Error dialog causes process to hang[/+]Fix phpGH-16849: Error dialog causes process to hang
dktapps commentedon Nov 18, 2024
Ah, I hadn't realized there was a difference.
Fix GH-16849: Error dialog causes process to hang
Merge branch 'PHP-8.2' into PHP-8.3
Merge branch 'PHP-8.3' into PHP-8.4
Merge branch 'PHP-8.4'
dktapps commentedon Jan 15, 2025
Just an FYI @cmb69 this fix seems to prevent catching assertion failures under Visual Studio Debugger. Might be worth gating these report mode changes behind
!IsDebuggerPresent().cmb69 commentedon Jan 16, 2025
Thanks for the update, @dktapps! I don't think this is caused by e75061b, but there is certainly room for improvement. I'll try to have a closer look, but wouldn't be sad if someone beats me to it – PRs welcome!