FW: timezone code - re-entrancy issue
Olson, Arthur David (NIH/NCI) [E]
olsona at dc37a.nci.nih.gov
Mon Jan 12 18:09:52 UTC 2009
I'm forwarding this message from John Dlugosz, who is not on the time
zone mailing list. Those of you who are on the list, please direct
From: John Dlugosz [mailto:JDlugosz at TradeStation.com]
Sent: Tuesday, January 06, 2009 7:36
To: tz at lecserver.nci.nih.gov
Subject: timezone code - re-entrancy issue
At the bottom of localsub,
tzname[tmp->tm_isdst] = &sp->chars[ttisp->tt_abbrind];
I think this is to update the tzname string to the last time zone abbr.
actually used in to produce the tm values.
It is not re-entrant. This is called even by localtime_r, which may be
changing the values even as another thread (who called plain localtime)
is reading it. It also changes all the time as the "binary search" is
being done by mktime. That violates the "behaves as if never called"
rule, and putting it in a subroutine doesn't help there.
Am I missing something?
More information about the tz