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

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Magnus Hagander <magnus(at)hagander(dot)net>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: Proposed Windows-specific change: Enable crash dumps (like core files)
Date: 2010-12-17 16:24:20
Message-ID: 4D0B8EB4.9090302@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 17/12/2010 7:17 PM, Magnus Hagander wrote:

> What version of dbghelp do you have?

6.1.7600.16385 by default, as shipped in Windows 7 32-bit, and what I
was testing with.

6.12.0002.633 is what came with my copy of Debugging Tools for windows,
from the windows SDK. The same version comes with Visual Studio 10 Express.

6.9.0003.113 is what came with Visual Studio 9 Express.

I've now re-tested with the latest, 6.12.0002.633, and have the same result.

> And what does the API report for it?

This:

version = (*pApiVersion)();
write_stderr("version: %hu.%hu.%hu\n",
version->MajorVersion,
version->MinorVersion,
version->Revision);

outputs "version: 4.0.5" when loading dbghelp.dll 6.12.0002.633 from
c:\postgres91\bin\dbghelp.dll as verified by a write_stderr() just
before LoadLibrary and a test verifying the LoadLibrary worked.

Shouldn't dbghelp.dll just ignore any flags it doesn't understand? I'm
surprised we can't just pass flags a particular version doesn't know
about and have it deal with them. Still, I guess it's not wise to assume
such things.

> The code is supposed to add the private memory if it finds version
> 6 or higher, perhaps that check is incorrect?

It begins to look like the version check might be lying. I'll dig
further in a bit; it's 12:20am now and I need to sleep.

I'm going on holiday in about 48 hours, and will be away from Windows
(phew!) unless I get a VM set up during that time. I'll see what I can do.

>> I'm happy with the patch as it stands, with the one exception that
>> consideration of mingw is required before it can be committed.
>
> What do you mean? That it has to be tested on mingw specifically, or
> something else?

I'm not even sure it'll compile or link with MinGW, and if it does, I
doubt it'll be useful. It should only be compiled and called for native
VC++ builds.

I'm not sure if backend\port\win32 is built for all win32, or only for
VC++. Testing for defined(_MSC_VER) would do the trick. I'm not sure
testing defined(WIN32_ONLY_COMPILER) is quite right, since I doubt
dbghelp.dll would be much use for a Pg compiled with Borland or the like
either if that were ever supported.

--
Craig Ringer

Tech-related writing at http://soapyfrogs.blogspot.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2010-12-17 16:27:23 Re: bug in SignalSomeChildren
Previous Message Alvaro Herrera 2010-12-17 16:24:15 Re: bug in SignalSomeChildren