Bug #76307 [NEW]: strftime format %Z crash php

From: Date: Sun, 06 May 2018 17:29:07 +0000
Subject: Bug #76307 [NEW]: strftime format %Z crash php
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-215134@lists.php.net to get a copy of this message
From:             drop_box at live dot de
Operating system: Windows 10 1803
PHP version:      7.2.5
Package:          Date/time related
Bug Type:         Bug
Bug description:strftime format %Z crash php

Description:
------------
Since Windows 10 1803 php crash the apache service (httpd.exe),
when setlocal is called in the "wrong" order and then strftime is called
with %Z format on all other formats like %z the "crash" doesn't happen.

Wrong order:
setlocale(LC_TIME,'en_US.UTF-8');
setlocale(LC_CTYPE,'en_US.UTF-8');
strftime('%Z');

Right order:
setlocale(LC_CTYPE,'en_US.UTF-8');
setlocale(LC_TIME,'en_US.UTF-8');
strftime('%Z');

Error is notice in alle php 7+ version (5.6 doesn't had this issue)
tested version:  5.6.35 (no issue here) ,7.0.29, 7.1.16, 7.2.4, 7.2.5

Test script:
---------------
<?php
$value = strftime('%Z');
echo $value.'%Z';
echo '<br>';

setlocale(LC_TIME,'en_US.UTF-8');
$value = strftime('%Z');
echo $value.'%Z';
echo '<br>';

setlocale(LC_CTYPE,'en_US.UTF-8');
// here came the crash in the next line
$value = strftime('%Z');
echo $value.'%Z';
echo '<br>';

Expected result:
----------------
Result should be that it behavior in the same as when you run %z.


-- 
Edit bug report at https://bugs.php.net/bug.php?id=76307&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=76307&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=76307&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=76307&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=76307&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=76307&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=76307&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=76307&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=76307&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=76307&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=76307&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=76307&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=76307&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=76307&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76307&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=76307&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=76307&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=76307&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76307&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=76307&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=76307&r=mysqlcfg



Thread (18 messages)

« previous php.bugs (#215134) next »