aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2017-11-12 14:31:00 -0800
committerNoah Misch <noah@leadboat.com>2017-11-12 14:31:04 -0800
commit8c92e66f1a168fdb0862b8d96db4fe0353effc9d (patch)
tree00c4e7ce10c1ad461c273e1f3cbc1a2d0aa044cd /src
parentfd5da32fc62f96952a54696f8ab2ce913fe19bc0 (diff)
downloadpostgresql-8c92e66f1a168fdb0862b8d96db4fe0353effc9d.tar.gz
postgresql-8c92e66f1a168fdb0862b8d96db4fe0353effc9d.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/backend/main/main.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/backend/main/main.c b/src/backend/main/main.c
index c018c90524f..1180b22f2a6 100644
--- a/src/backend/main/main.c
+++ b/src/backend/main/main.c
@@ -61,6 +61,14 @@ main(int argc, char *argv[])
{
bool do_check_root = true;
+ /*
+ * If supported on the current platform, set up a handler to be called if
+ * the backend/postmaster crashes with a fatal signal or exception.
+ */
+#if defined(WIN32) && defined(HAVE_MINIDUMP_TYPE)
+ pgwin32_install_crashdump_handler();
+#endif
+
progname = get_progname(argv[0]);
/*
@@ -82,14 +90,6 @@ main(int argc, char *argv[])
argv = save_ps_display_args(argc, argv);
/*
- * If supported on the current platform, set up a handler to be called if
- * the backend/postmaster crashes with a fatal signal or exception.
- */
-#if defined(WIN32) && defined(HAVE_MINIDUMP_TYPE)
- pgwin32_install_crashdump_handler();
-#endif
-
- /*
* Fire up essential subsystems: error and memory management
*
* Code after this point is allowed to use elog/ereport, though