Bug #76307 [Fbk->Opn]: strftime format %Z crash php
| From: | drop_box at live dot de | Date: | Mon, 14 May 2018 20:58:46 +0000 |
| Subject: | Bug #76307 [Fbk->Opn]: strftime format %Z crash php | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-215253@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76307&edit=1
ID: 76307
User updated by: drop_box at live dot de
Reported by: drop_box at live dot de
Summary: strftime format %Z crash php
-Status: Feedback
+Status: Open
Type: Bug
Package: Date/time related
Operating System: Windows 10 1803
PHP Version: 7.2.5
Block user comment: N
Private report: N
New Comment:
After change and recompile the error msg keep the same.
The default locale is:
LC_COLLATE=C;LC_CTYPE=German_Germany.1252;LC_MONETARY=C;LC_NUMERIC=C;LC_TIME=C
Previous Comments:
------------------------------------------------------------------------
[2018-05-14 10:25:49] ab@php.net
@drop_box, I still have no crash even on the debug build :/ Perhaps it depends on the system locale,
dunno. Which locale is on your machine by default? And nevertheless, since you can compile yourself,
could you please apply the following and see whether it fixes the issue?
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 993a7b11cf..1a8f3a8e83 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -1644,7 +1644,7 @@ PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gmt)
zend_long timestamp = 0;
struct tm ta;
int max_reallocs = 5;
- size_t buf_len = 256, real_len;
+ size_t buf_len = 512, real_len;
timelib_time *ts;
timelib_tzinfo *tzi;
timelib_time_offset *offset = NULL;
Thanks.
------------------------------------------------------------------------
[2018-05-09 13:49:08] drop_box at live dot de
since i got the debug version now,
i get an error message which i think could be helpful:
HEAP CORRUPTION DETECTED: before CRT block (#15222) at 0x0721CDB8.
CRT dectected that the application wrote to memory before start of heap buffer.
Memory allocated at
minkernel\crts\ucrt\src\appcrt\time\strftime.cpp(147).
------------------------------------------------------------------------
[2018-05-09 13:27:02] spam2 at rhsoft dot net
> because i don't understand what the meaning of "debug symbols" is
https://en.wikipedia.org/wiki/Debug_symbol
the debug symbols are what is responsible for outputs like below
php7ts_debug.dll!zif_strftime(_zend_execute_data * execute_data, _zval_struct * return_value) line
1740 C
php7ts_debug.dll!ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER(_zend_execute_data * execute_data) line
617 C
------------------------------------------------------------------------
[2018-05-09 13:17:41] drop_box at live dot de
I also install in the meantime the update: KB4103721
but nothing changed in my eyes (as you see on my backtrace/crash report)
------------------------------------------------------------------------
[2018-05-09 13:15:45] drop_box at live dot de
Well i use here the x86 ts version of php,
on the other hand I try my best to compile my self a debug version,
because i don't understand what the meaning of "debug symbols" is.
Here the output of my 7.2.5 debug x86 ts version:
php7ts_debug.dll!php_strftime(_zend_execute_data * execute_data, _zval_struct * return_value, int
gmt) line 1707 C
php7ts_debug.dll!zif_strftime(_zend_execute_data * execute_data, _zval_struct * return_value) line
1740 C
php7ts_debug.dll!ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER(_zend_execute_data * execute_data) line
617 C
php7ts_debug.dll!execute_ex(_zend_execute_data * ex) line 59723 C
php7ts_debug.dll!zend_execute(_zend_op_array * op_array, _zval_struct * return_value) line 63760 C
php7ts_debug.dll!zend_execute_scripts(int type, _zval_struct * retval, int file_count, ...) line
1496 C
php7ts_debug.dll!php_execute_script(_zend_file_handle * primary_file) line 2590 C
php.exe!do_cli(int argc, char * * argv) line 1011 C
php.exe!main(int argc, char * * argv) line 1404 C
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=76307
--
Edit this bug report at https://bugs.php.net/bug.php?id=76307&edit=1