forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitf3feff8
committed
windows: Improve crash / assert / exception handling.
startup_hacks() called SetErrorMode() with the SEM_NOGPFAULTERRORBOX argumentto prevent GUI popups on error. While that likely was sufficient at somepoint, 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 toa process on crash. This prevents collecting crash dumps as part of CI.The error popups are particularly problematic when they occur during automatedtesting, as they can cause the tests to hang, waiting for a button to beclicked.This commit improves the error handling setup in startup_hacks() to addressthose problems. SEM_NOGPFAULTERRORBOX is not used anymore, instead variousother APIs are used to disable popups and to redirect output to stderr wherepossible.While this improves the situation for postgres.exe, it doesn't address similarissues in all the other executables. There currently is no codepath that'scalled early on for all frontend programs.I've tested that this prevents GUI popups and allows JIT debugging in case ofcrashes due to:- abort()- assert()- C runtime errors- unhandled exceptionsboth 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.de1 parent6dcc185 commitf3feff8
2 files changed
+58
-3
lines changedLines changed: 5 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
437 | 437 |
| |
438 | 438 |
| |
439 | 439 |
| |
440 |
| - | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
441 | 445 |
| |
442 | 446 |
| |
443 | 447 |
| |
|
Lines changed: 53 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 |
| |
26 | 30 |
| |
27 | 31 |
| |
| |||
237 | 241 |
| |
238 | 242 |
| |
239 | 243 |
| |
240 |
| - | |
241 |
| - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
242 | 293 |
| |
243 | 294 |
| |
244 | 295 |
| |
|
0 commit comments
Comments
(0)