Problem with ControlFileData structure being ABI dependent - Mailing list pgsql-hackers

From Gregory Stark
Subject Problem with ControlFileData structure being ABI dependent
Date
Msg-id 877ijrx5vl.fsf@oxford.xeocode.com
Whole thread Raw
Responses Re: Problem with ControlFileData structure being ABI dependent  (Dave Page <dpage@postgresql.org>)
List pgsql-hackers
In trying to run a benchmark comparing mingw with VC++ builds Dave discovered
that if you initdb with one and try to run with the other you get a message
saying "incorrect checksum in control file" rather than the more appropriate
and friendly "database files are incompatible with server".

This is because of (at least) two changes in the ABI between the runtimes used
by mingw and VC++. 1) Enums are apparently 8 bytes on VC++ but 4 bytes on
mingw and 2) time_t is 8 bytes on VC++ but 4 bytes on mingw.

To get the right message we could add the size of the control file (or
offsetof(crc)) to the control file itself near the top and check it before the
checksum. That would be an initdb though which would be annoying at this
point. I think we should do this at the next opportunity though.

But I'm a bit concerned about change in ABI between mingw and VC++. I thought
these two used the same ABI. Are we sure Slony et al don't use time_t or enums
or anything else which may have changed between these two runtimes?

--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com Ask me about EnterpriseDB's Slony Replication
support!


pgsql-hackers by date:

Previous
From: Manolo _
Date:
Subject: Compiling PG on linux
Next
From: Dave Page
Date:
Subject: Re: Problem with ControlFileData structure being ABI dependent