Skip to content

Commit cbfffee

Browse files
committed
Install Windows crash dump handler before all else.
Apart from calling write_stderr() on failure, the handler depends on no PostgreSQL facilities. We have experienced crashes before reaching the former call site. Given such an early crash, this change cannot hurt and may produce a helpful dump. Absent an early crash, this change has no effect. Back-patch to 9.3 (all supported versions). Takayuki Tsunakawa Discussion: https://postgr.es/m/0A3221C70F24FB45833433255569204D1F80CD13@G01JPEXMBYT05
1 parent e02571b commit cbfffee

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/backend/main/main.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ main(int argc, char *argv[])
6161
{
6262
bool do_check_root = true;
6363

64+
/*
65+
* If supported on the current platform, set up a handler to be called if
66+
* the backend/postmaster crashes with a fatal signal or exception.
67+
*/
68+
#if defined(WIN32) && defined(HAVE_MINIDUMP_TYPE)
69+
pgwin32_install_crashdump_handler();
70+
#endif
71+
6472
progname = get_progname(argv[0]);
6573

6674
/*
@@ -81,14 +89,6 @@ main(int argc, char *argv[])
8189
*/
8290
argv = save_ps_display_args(argc, argv);
8391

84-
/*
85-
* If supported on the current platform, set up a handler to be called if
86-
* the backend/postmaster crashes with a fatal signal or exception.
87-
*/
88-
#if defined(WIN32) && defined(HAVE_MINIDUMP_TYPE)
89-
pgwin32_install_crashdump_handler();
90-
#endif
91-
9292
/*
9393
* Fire up essential subsystems: error and memory management
9494
*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy