Re: Re: Proposed Windows-specific change: Enable crash dumps (like core files)

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Dave Page <dpage(at)pgadmin(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: Proposed Windows-specific change: Enable crash dumps (like core files)
Date: 2010-11-23 14:09:35
Message-ID: 4CEBCB1F.1080405@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/23/2010 01:46 AM, Tom Lane wrote:

>> * However, when storing it in crashdumps, I think the code would need
>> to create that directory if it does not exist, doesn't it?
>
> If it didn't do so, then manual creation/removal of the directory could
> be used as an on/off switch for the feature.

Yep. That's how I'd want to do it in 9.1 - test for the directory and
use that to decide whether to set the handler during early backend
startup. That way you don't need a GUC, and should be able to load it
*very* early in backend startup.

> I haven't looked at the patch but this
> discussion makes it sound like the dumper is dependent on an
> uncomfortably large amount of backend code being functional. You need
> to minimize the number of assumptions of that sort.

It doesn't need to have any backend code working, really; all it needs
is a usable stack and the ability to allocate off the heap. It won't
save you in total OOM situations, stack exhaustion, or severe stack
corruption, but should work pretty much any other time.

The crash dump facility in dbghelp.dll offers *optional* features where
apps can stream in additional app-specific data like recent log
excerpts, etc. I didn't try to implement anything like that in the
initial module partly because I want to minimize the amount of the
backend that must be working for a crash dump to succeed.

--
Craig Ringer

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2010-11-23 14:12:04 Re: Re: Proposed Windows-specific change: Enable crash dumps (like core files)
Previous Message Craig Ringer 2010-11-23 14:05:01 Re: Re: Proposed Windows-specific change: Enable crash dumps (like core files)