Thread: BUG #6046: select current_date crashes postgres

BUG #6046: select current_date crashes postgres

From
"Rikard Pavelic"
Date:
The following bug has been logged online:

Bug reference:      6046
Logged by:          Rikard Pavelic
Email address:      rikard.pavelic@zg.htnet.hr
PostgreSQL version: 9.1 beta 1
Operating system:   Windows 7 64bit
Description:        select current_date crashes postgres
Details:

select current_time
or select current_date

results in postgres crash.

select now()
works

Re: BUG #6046: select current_date crashes postgres

From
Craig Ringer
Date:
On 1/06/2011 1:28 AM, Rikard Pavelic wrote:

> select current_time
> or select current_date
>
> results in postgres crash.

Ouch. That's not ideal.

Please post the messages output to the postgresql log file from when the
backend crashes. You will find the log file in the pg_log directory
inside your data directory, which by default is under the postgresql
installation directory in Program Files.

Are you running the 32-bit or 64-bit build of PostgreSQL 9.1 beta? Both
will run on 64-bit Windows.

Did you get it from EnterpriseDB
(http://www.enterprisedb.com/products-services-training/pgdevdownload) ?

--
Craig Ringer

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

Re: BUG #6046: select current_date crashes postgres

From
Craig Ringer
Date:
Ah, never mind. I can reproduce the crash here on my 32-bit win7 with a
32-bit build of Pg. Looking into it now.

--
Craig Ringer

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

Re: BUG #6046: select current_date crashes postgres

From
Craig Ringer
Date:
On 1/06/2011 1:28 AM, Rikard Pavelic wrote:
>
> The following bug has been logged online:
>
> Bug reference:      6046
> Logged by:          Rikard Pavelic
> Email address:      rikard.pavelic@zg.htnet.hr
> PostgreSQL version: 9.1 beta 1
> Operating system:   Windows 7 64bit
> Description:        select current_date crashes postgres
> Details:
>
> select current_time
> or select current_date
>
> results in postgres crash.

The crash is a segfault:

2011-06-01 08:29:04 WST LOG:  server process (PID 2420) was terminated
by exception 0xC0000005

I've got a crash dump and am looking into it now. In the mean time,
what's even more worrying is this:

> 2011-06-01 08:33:18 WST WARNING:  terminating connection because of crash of another server process
> 2011-06-01 08:33:18 WST DETAIL:  The postmaster has commanded this server process to roll back the current
transactionand exit, because another server process exited abnormally and possibly corrupted shared memory. 
> 2011-06-01 08:33:18 WST HINT:  In a moment you should be able to reconnect to the database and repeat your command.
> 2011-06-01 08:33:18 WST LOG:  all server processes terminated; reinitializing
> 2011-06-01 08:33:28 WST FATAL:  pre-existing shared memory block is still in use
> 2011-06-01 08:33:28 WST HINT:  Check if there are any old server processes still running, and terminate them.

It looks like Pg isn't coming back up after the backend crash.  There
are no postgres.exe processes hanging around, and I can start PostgreSQL
back up from services.msc without a problem, but it doesn't successfully
re-launch its _self_ after a crash.

--
Craig Ringer

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

Re: BUG #6046: select current_date crashes postgres

From
Craig Ringer
Date:
Rikard,

I've moved this discussion to the pgsql-hackers mailing list, as I can
reproduce the crash you reported and have been able to get a
useful-looking crash dump to examine.

I removed you from the CC list when I moved the report to -hackers,
because there's often quite a burst of mail in some discussions and I
didn't want to flood you with mail. You can follow it in the
pgsql-hackers mailing list if you like, or ask for people to cc you.
Otherwise, once more is known I'll update you.

Thanks very much for your report, it's greatly appreciated.

--
Craig Ringer

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

Re: BUG #6046: select current_date crashes postgres

From
Craig Ringer
Date:
So much for my worries about a big long conversation. The short answer
from Tom Lane, who committed the fixes to git:

Tom Lane wrote:
> This is the known problem with timezone abbreviations not being
> initialized correctly on Windows --- anything involving interpreting a
> "keyword" in datetime input will go belly up.  See commits 2e82d0b39,
> e05b86644.
>
>             regards, tom lane

Those commits have a more detailed explanation, and can be found here:

http://git.postgresql.org/gitweb?p=postgresql.git;a=commit;h=2e82d0b396473b595a30f68b37b8dfd41c37dff8

http://git.postgresql.org/gitweb?p=postgresql.git;a=commit;h=e05b866447899211a0c2df31bf0671faac4fc3e5

but the short version appears to be "Fixed in the next version".

--
Craig Ringer