Re: BUG #4162: Hotbackup recovery doesn't work in windows - Mailing list pgsql-bugs

From Magnus Hagander
Subject Re: BUG #4162: Hotbackup recovery doesn't work in windows
Date
Msg-id 20080513225627.4783dc30@mha-laptop.hagander.net
Whole thread Raw
In response to Re: BUG #4162: Hotbackup recovery doesn't work in windows  ("Javier Pimás" <elpochodelagente@gmail.com>)
List pgsql-bugs
Javier Pim=C3=A1s wrote:
> Hi, I'm making a base backup, and then I try to recover from it. I
> install postgres from msi installer, add some tables and data and
> then follow the steps in "24.3.2. Making a Base Backup". I don't keep
> archiving files forever but archive just the indispensable (basicaly
> the same than pg_hotbackup project but in windows).
> After that I tryied to test the backup by reinstalling postgres and
> following the steps in  "24.3.3. Recovering using a Continuous Archive
> Backup" . It fails in step 8, throwing an error message box. After a
> while I downloaded postgres source files and debug symbols and
> attached visual studio to postgres.exe and debugged it. It always
> failed in the line I told before. It may be possible that any kind of
> recovery be failing, I didn't test.
>=20
> I'm not compiling anything, but made a binary patch to the exe (I was
> in a hurry!) that avoids calling close with -1 and recovery process
> started working.

Ok, so the reason we've not seen this before is probably that the
runtime used by a mingw build doesn't crash when given a negative file
descriptor.

I've applied a patch for this and backpatched it all the way to 7.4 to
be consistent (even though that one doesn't build with MSVC, there
could theoretically be other platforms with the same problem - though
we most likely would've seen them by now).

I'll defer to somebody else to try to figure out if something else is
wrong that caused this codepath to be hit, but either way we certainly
shouldn't go around crashing like this...

Thanks for your report and diagnosis!

//Magnus

pgsql-bugs by date:

Previous
From: "Javier Pimás"
Date:
Subject: Re: BUG #4162: Hotbackup recovery doesn't work in windows
Next
From: Simon Riggs
Date:
Subject: Re: BUG #4162: Hotbackup recovery doesn't work in windows