aboutsummaryrefslogtreecommitdiff
path: root/src/backend/parser/parse_utilcmd.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2022-02-02 18:33:25 -0800
committerAndres Freund <andres@anarazel.de>2022-02-02 18:33:25 -0800
commitf3feff825940972c0dcf1173f0a6a4ff43f8d382 (patch)
tree240f85d6078a26b7c6b6a93737a2d81d10abfded /src/backend/parser/parse_utilcmd.c
parent6dcc18526673ec6cfa2fa286d2039ae85fb8eb9e (diff)
downloadpostgresql-f3feff825940972c0dcf1173f0a6a4ff43f8d382.tar.gz
postgresql-f3feff825940972c0dcf1173f0a6a4ff43f8d382.zip
windows: Improve crash / assert / exception handling.
startup_hacks() called SetErrorMode() with the SEM_NOGPFAULTERRORBOX argument to prevent GUI popups on error. While that likely was sufficient at some point, there are other sources of error popups. At the same time SEM_NOGPFAULTERRORBOX unfortunately also prevents "just-in-time debuggers" from working reliably, i.e. the ability to attach to a process on crash. This prevents collecting crash dumps as part of CI. The error popups are particularly problematic when they occur during automated testing, as they can cause the tests to hang, waiting for a button to be clicked. This commit improves the error handling setup in startup_hacks() to address those problems. SEM_NOGPFAULTERRORBOX is not used anymore, instead various other APIs are used to disable popups and to redirect output to stderr where possible. While this improves the situation for postgres.exe, it doesn't address similar issues in all the other executables. There currently is no codepath that's called early on for all frontend programs. I've tested that this prevents GUI popups and allows JIT debugging in case of crashes due to: - abort() - assert() - C runtime errors - unhandled exceptions both in debug and non-debug mode, on Win10 with MSVC 2019 and with MinGW. Now that crash reports are generated on windows, collect them in windows CI. Discussion: https://postgr.es/m/20211005193033.tg4pqswgvu3hcolm@alap3.anarazel.de
Diffstat (limited to 'src/backend/parser/parse_utilcmd.c')
0 files changed, 0 insertions, 0 deletions