Server crash with older tzload library

From: Jeevan Chalke <jeevan(dot)chalke(at)enterprisedb(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Server crash with older tzload library
Date: 2010-03-11 10:51:37
Message-ID: be46a4f31003110251u1068025as73b1345844dc4406@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Tom,

While setting timezone using SET command (say GMT+3:30), postgres sometimes
crashes randomly.
After debugging into the code, it is observed that if tzload() call fails in
pg_tzset() for whatever reason, the returned value of the function then have
garbage values for state variable. And this will assigned to
session_timezone in assign_timezone() function later.

Now as session_timezone.state variable has garbage values, it is causing a
server crash further. Unfortunately it is happening with few garbage values
and not crashing the server always.

Here are the two statements used:

SET TimeZone = 'GMT+3:30';
SELECT '1969-12-31 20:30:00'::timestamptz;

After, initializing tzstate variable to zero in pg_tzset() function, server
crash didn't come up again.

The upstream zoneinfo project just released a new tzcode version, 2010c.
After syncing the code to this version does not lead to server crash. The
new release is now initializing the tzstate variable with zeros to avoid any
garbage values.

PFA, patch which will bring us up-to date to 2010c.

Note: This behavior was observed on Windows machine.

Thanks

--
Jeevan B Chalke
Software Engineer, R&D
EnterpriseDB Corporation
The Enterprise Postgres Company

Phone: +91 20 30589500

Website: www.enterprisedb.com
EnterpriseDB Blog: http://blogs.enterprisedb.com/
Follow us on Twitter: http://www.twitter.com/enterprisedb

This e-mail message (and any attachment) is intended for the use of the
individual or entity to whom it is addressed. This message contains
information from EnterpriseDB Corporation that may be privileged,
confidential, or exempt from disclosure under applicable law. If you are not
the intended recipient or authorized to receive this for the intended
recipient, any use, dissemination, distribution, retention, archiving, or
copying of this communication is strictly prohibited. If you have received
this e-mail in error, please notify the sender immediately by reply e-mail
and delete this message.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeevan Chalke 2010-03-11 11:02:13 Re: Server crash with older tzload library
Previous Message Dmitry Fefelov 2010-03-11 10:25:25 Re: Dyamic updates of NEW with pl/pgsql