From:             ab
Operating system: Windows
PHP version:      Irrelevant
Package:          Date/time related
Bug Type:         Feature/Change Request
Bug description:strftime crash with php/vc11

Description:
------------
PHP crashes only when compiled with VC11. I could track it back with 5.4.1
compiled with VC11. Another not obvious crash happens with 5.5/VC9 using
O+. Here's the backtrace 5.5/VC11:

 msvcr110d.dll!_invoke_watson(const wchar_t * pszExpression, const wchar_t
* pszFunction, const wchar_t * pszFile, unsigned int nLine, unsigned int
pReserved) Line 131C++
 msvcr110d.dll!_invoke_watson_if_error(int _ExpressionError, const wchar_t
* _Expression, const wchar_t * _Function, const wchar_t * _File, unsigned
int _Line, unsigned int _Reserved) Line 730C
 msvcr110d.dll!_W_expandtime(localeinfo_struct * plocinfo, wchar_t
specifier, const tm * timeptr, wchar_t * * string, unsigned int * left,
__lc_time_data * lc_time, unsigned int alternate_form) Line 722C++
 msvcr110d.dll!_Wcsftime_l(wchar_t * string, unsigned int maxsize, const
wchar_t * format, const tm * timeptr, void * lc_time_arg, localeinfo_struct
* plocinfo) Line 323C++
 msvcr110d.dll!_Strftime_l(char * string, unsigned int maxsize, const char
* format, const tm * timeptr, void * lc_time_arg, localeinfo_struct *
plocinfo) Line 285C++
 msvcr110d.dll!strftime(char * string, unsigned int maxsize, const char *
format, const tm * timeptr) Line 189C++
 php5_debug.dll!php_strftime(int ht, _zval_struct * return_value,
_zval_struct * * return_value_ptr, _zval_struct * this_ptr, int
return_value_used, int gmt) Line 1631C
 php5_debug.dll!zif_strftime(int ht, _zval_struct * return_value,
_zval_struct * * return_value_ptr, _zval_struct * this_ptr, int
return_value_used) Line 1657C
 php5_debug.dll!zend_do_fcall_common_helper_SPEC(_zend_execute_data *
execute_data) Line 542C
 php5_debug.dll!ZEND_DO_FCALL_SPEC_CONST_HANDLER(_zend_execute_data *
execute_data) Line 2321C
 php5_debug.dll!execute_ex(_zend_execute_data * execute_data) Line 356C
 php5_debug.dll!zend_execute(_zend_op_array * op_array) Line 381C
 php5_debug.dll!zend_eval_stringl(char * str, int str_len, _zval_struct *
retval_ptr, char * string_name) Line 1181C
 php5_debug.dll!zend_eval_stringl_ex(char * str, int str_len, _zval_struct
* retval_ptr, char * string_name, int handle_exceptions) Line 1228C
 php5_debug.dll!zend_eval_string_ex(char * str, _zval_struct * retval_ptr,
char * string_name, int handle_exceptions) Line 1239C
 php.exe!do_cli(int argc, char * * argv) Line 1028C
 php.exe!main(int argc, char * * argv) Line 1364C
 php.exe!__tmainCRTStartup() Line 536C
 php.exe!mainCRTStartup() Line 377C
 kernel32.dll!@BaseThreadInitThunk@12()Unknown
 ntdll.dll!___RtlUserThreadStart@8()Unknown
 ntdll.dll!__RtlUserThreadStart@8()Unknown


Test script:
---------------
ext/date/tests/009_win32.phpt 

or this snippet

var_dump(strftime('%a %A %b %B %c %d %H %I %j %m %M %p %S %U %W %w %x %X %y
%Y %Z %z %%', mktime(0,0,0, 6, 27, 2013)));

Expected result:
----------------
no crash

Actual result:
--------------
PHP crash

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

Reply via email to