Re: Re: Proposed Windows-specific change: Enable crash dumps (like core files) - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: Re: Proposed Windows-specific change: Enable crash dumps (like core files)
Date
Msg-id AANLkTik2yrEHBOFWKuK9Zw4e+2da9dmGa0E6BRGf6vwy@mail.gmail.com
Whole thread Raw
In response to Re: Re: Proposed Windows-specific change: Enable crash dumps (like core files)  (Craig Ringer <craig@postnewspapers.com.au>)
Responses Re: Re: Proposed Windows-specific change: Enable crash dumps (like core files)  (Robert Haas <robertmhaas@gmail.com>)
Re: Re: Proposed Windows-specific change: Enable crash dumps (like core files)  (Magnus Hagander <magnus@hagander.net>)
Re: Re: Proposed Windows-specific change: Enable crash dumps (like core files)  (Craig Ringer <craig@postnewspapers.com.au>)
List pgsql-hackers
On Thu, Dec 16, 2010 at 09:21, Craig Ringer <craig@postnewspapers.com.au> wrote:
> Hi all
>
> Updated patch attached. This one avoids the inline function stuff and
> instead just decides whether to compile unix_crashdump.c or
> win32_crashdump.c based on build system tests. It passes "make check" on
> nix and tests on win32, both with and without the "crashdumps" directory
> existing. The inadvertent duplication of the functon prototype is fixed.

I've updated this patch in quite a few ways, and you can find the
latest on my github (will attach when I'm done with cleanups). Things
I've changed so far:

* I moved it all into backend/port/win32, and thus removed all the
autoconf things, since they are not necessary. This is only for win32
at this point, and AFAIK we don't expect it to be for other platforms.
If that's needed, we can move it back later, but for now let's keep it
simple.
* using elog() really isn't safe. We set the crash handler *long*
before we have loaded the elog subsystem. It's better to get a log to
eventlog than to not get it at all.
* Plus a number of smaller changes

One thing that I did notice, and I'm not entirely sure what to do with
- which is why I wanted to post this while I'm still working on the
cleanup:

We use the existance of the "crashdumps" directory as an indication we
want crashdumps. That's fine when the system is up. But what if we
crash *in the postmaster before we have done chdir()*?

Should we perhaps instead define a subdirectory of *where the .EXE
file is*, and dump the file there?

> I haven't added any SGML documentation yet, as I'm not sure (a) to what
> level it should be documented, and (b) whether it should be in the main
> docs or just the developer docs plus the crash debugging guide on the
> wiki. Thoughts?

It needs to be documented somewhere.Perhaps in "15.8 Platform Specific
Notes"? That's really about building it, but it might be reasonable
there anyway? It does hold a number of things today that aren't
related to building, for other platforms.

(And yes, it should go in the wiki as well, of course)

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/


pgsql-hackers by date:

Previous
From: Greg Smith
Date:
Subject: Re: Tab completion for view triggers in psql
Next
From: Greg Smith
Date:
Subject: Re: Extensions, patch v17