# date() status

- Thread: https://externals.io/message/19535
- Original archive: https://news-web.php.net/php.internals/19535
- Started by Stanislav Malyshev on 2005-10-09T13:08:36+00:00
- Messages: 5
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #19535 — Stanislav Malyshev — 2005-10-09T13:08:36+00:00

URL: https://externals.io/message/19535#19535

I'm not sure if all the patches are commited as for now, but it still 
doesn't work for me. First, IDT setting still returns unknown timezone, 
second, now PHP crashes in:

0x08095bcd in timelib_tzinfo_dtor (tz=0x0) at php5/ext/date/lib/timelib.c:107
107             TIMELIB_TIME_FREE(tz->name);
(gdb) bt
#0  0x08095bcd in timelib_tzinfo_dtor (tz=0x0) at php5/ext/date/lib/timelib.c:107
#1  0x08076f31 in _php_date_tzinfo_dtor (tzinfo=0xa3252a0) at php5/ext/date/php_date.c

if I set 'IDT' timezone. Same if I set 'IST' timezone.

-- 
Stanislav Malyshev, Zend Products Engineer
stas@zend.com  http://www.zend.com/ +972-3-6139665 ext.115

---

## #19538 — Nuno Lopes — 2005-10-09T14:26:41+00:00

URL: https://externals.io/message/19535#19538 · In reply to: #19535

> I'm not sure if all the patches are commited as for now, but it still 
> doesn't work for me. First, IDT setting still returns unknown timezone, 
> second, now PHP crashes in:
>
> 0x08095bcd in timelib_tzinfo_dtor (tz=0x0) at 
> php5/ext/date/lib/timelib.c:107
> 107             TIMELIB_TIME_FREE(tz->name);
> (gdb) bt
> #0  0x08095bcd in timelib_tzinfo_dtor (tz=0x0) at 
> php5/ext/date/lib/timelib.c:107
> #1  0x08076f31 in _php_date_tzinfo_dtor (tzinfo=0xa3252a0) at 
> php5/ext/date/php_date.c
>
> if I set 'IDT' timezone. Same if I set 'IST' timezone.

This patch should fix the segfault: 
http://mega.ist.utl.pt/~ncpl/php_date_segf.txt

The problem of not recognising your timezones is because currently the code 
isn't doing any guessing magic (aka guess full name from abbr) when the TZ 
environment var is set.
Perhaps a timelib_timezone_id_from_abbr() call could be added in the 'if 
(env && *env)' section.

Nuno

---

## #19547 — Stanislav Malyshev — 2005-10-10T12:18:44+00:00

URL: https://externals.io/message/19535#19547 · In reply to: #19538

NL>>This patch should fix the segfault:
NL>>http://mega.ist.utl.pt/~ncpl/php_date_segf.txt

Any reason it's not in 5.1 CVS?

-- 
Stanislav Malyshev, Zend Products Engineer
stas@zend.com  http://www.zend.com/ +972-3-6139665 ext.115

---

## #19549 — Derick Rethans — 2005-10-10T12:33:46+00:00

URL: https://externals.io/message/19535#19549 · In reply to: #19547

> NL>>This patch should fix the segfault:
> NL>>http://mega.ist.utl.pt/~ncpl/php_date_segf.txt
> 
> Any reason it's not in 5.1 CVS?

Yes, I didn't have time to look at it yet. I've other things to do :)

Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org

---

## #19553 — Derick Rethans — 2005-10-10T16:43:58+00:00

URL: https://externals.io/message/19535#19553 · In reply to: #19538

> > […]
> 
> This patch should fix the segfault:
> http://mega.ist.utl.pt/~ncpl/php_date_segf.txt

I fixed it in a slightly different way. It's fine to cache missed 
lookups, but we shouldn't try to dtor those then.

> The problem of not recognising your timezones is because currently the 
> code isn't doing any guessing magic (aka guess full name from abbr) 
> when the TZ environment var is set. Perhaps a 
> timelib_timezone_id_from_abbr() call could be added in the 'if (env && 
> *env)' section.

No, setting a timezone through a TZ environment variable to an 
abbreviation is not a good idea. Either set your system's timezone 
correctly or use a full identifier in the TZ environment variable.

Derick

-- 
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org
