php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75470 Bug in mbstring functions
Submitted: 2017-10-31 15:19 UTC Modified: 2017-11-12 04:22 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: vovchuck dot bogdan at gmail dot com Assigned:
Status: No Feedback Package: mbstring related
PHP Version: 7.1.11 OS: Fedora 24
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-10-31 15:19 UTC] vovchuck dot bogdan at gmail dot com
Description:
------------
I use Zend Framework 1 with PHP 7.1.11. And any calls of multibyte functuions will produce this error

private function convert_recheck($var)
    {
        if (is_array($var)) {
            $new = array();
            foreach ($var as $key => $val) {
                $new[$key] = $this->convert_recheck($val);
            }
            $var = $new;
        } else if (is_string($var)) {
            if (!mb_detect_encoding($var, 'UTF-8', true)) {
                $var = iconv("CP1251", "UTF-8", $var);
            }
        }
        return $var;
    }

Actual result:
--------------
Oct 30 11:38:27 dev abrt-notification[7246]: Process 10130 (php-fpm) crashed in zend_std_cast_object_tostring()
Oct 30 11:50:18 dev /usr/libexec/gdm-x-session[1675]: Cinnamon warning: Log level 16: STACK_OP_RAISE_ABOVE: sibling window 0x500050e not in stack
Oct 30 11:50:21 dev mysql-workbench[2347]: Allocating size to wb_main_window 0x1a50260 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
Oct 30 11:50:21 dev mysql-workbench[2347]: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar
Oct 30 11:58:49 dev kernel: php-fpm[6697]: segfault at 7ffd9563ce08 ip 00007f8c34d7536d sp 00007ffd9563ce10 error 6 in mbstring.so[7f8c34d2b000+152000]
Oct 30 11:58:49 dev audit[6697]: ANOM_ABEND auid=4294967295 uid=48 gid=48 ses=4294967295 pid=6697 comm="php-fpm" exe="/usr/sbin/php-fpm" sig=11 res=1
Oct 30 11:58:49 dev systemd[1]: Started Process Core Dump (PID 8353/UID 0).
Oct 30 11:58:49 dev audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@2-8353-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Oct 30 11:58:50 dev systemd-coredump[8354]: Process 6697 (php-fpm) of user 48 dumped core.
                                            
                                            Stack trace of thread 6697:
                                            #0  0x00007f8c34d7536d mbfl_strpos (mbstring.so)
                                            #1  0x00007f8c34d8247f php_mb_stripos (mbstring.so)
                                            #2  0x00007f8c34d82622 zif_mb_stripos (mbstring.so)
                                            #3  0x000000f1eeaa30c2 ZEND_DO_FCALL_BY_NAME_SPEC_RETVAL_USED_HANDLER (php-fpm)
                                            #4  0x000000f1eea4b19b execute_ex (php-fpm)
                                            #5  0x000000f1ee9f1586 zend_call_function (php-fpm)
                                            #6  0x000000f1eea1fc6c zend_call_method (php-fpm)
                                            #7  0x000000f1eea3c1d3 zend_std_cast_object_tostring (php-fpm)
                                            #8  0x000000f1ee9f7f7e _zval_get_string_func (php-fpm)
                                            #9  0x000000f1eea910d0 ZEND_CAST_SPEC_CV_HANDLER (php-fpm)
                                            #10 0x000000f1eea4b19b execute_ex (php-fpm)
                                            #11 0x000000f1ee9f1586 zend_call_function (php-fpm)
                                            #12 0x000000f1eea1fc6c zend_call_method (php-fpm)
                                            #13 0x000000f1eea3c1d3 zend_std_cast_object_tostring (php-fpm)
                                            #14 0x000000f1ee9f7f7e _zval_get_string_func (php-fpm)
                                            #15 0x000000f1eea910d0 ZEND_CAST_SPEC_CV_HANDLER (php-fpm)
                                            #16 0x000000f1eea4b19b execute_ex (php-fpm)
                                            #17 0x000000f1ee9f1586 zend_call_function (php-fpm)
                                            #18 0x000000f1eea1fc6c zend_call_method (php-fpm)
                                            #19 0x000000f1eea3c1d3 zend_std_cast_object_tostring (php-fpm)
                                            #20 0x000000f1ee9f7f7e _zval_get_string_func (php-fpm)
                                            #21 0x000000f1eea910d0 ZEND_CAST_SPEC_CV_HANDLER (php-fpm)
                                            #22 0x000000f1eea4b19b execute_ex (php-fpm)
                                            #23 0x000000f1ee9f1586 zend_call_function (php-fpm)
                                            #24 0x000000f1eea1fc6c zend_call_method (php-fpm)
                                            #25 0x000000f1eea3c1d3 zend_std_cast_object_tostring (php-fpm)
                                            #26 0x000000f1ee9f7f7e _zval_get_string_func (php-fpm)
                                            #27 0x000000f1eea910d0 ZEND_CAST_SPEC_CV_HANDLER (php-fpm)
                                            #28 0x000000f1eea4b19b execute_ex (php-fpm)
                                            #29 0x000000f1ee9f1586 zend_call_function (php-fpm)
                                            #30 0x000000f1eea1fc6c zend_call_method (php-fpm)
                                            #31 0x000000f1eea3c1d3 zend_std_cast_object_tostring (php-fpm)
                                            #32 0x000000f1ee9f7f7e _zval_get_string_func (php-fpm)
                                            #33 0x000000f1eea910d0 ZEND_CAST_SPEC_CV_HANDLER (php-fpm)
                                            #34 0x000000f1eea4b19b execute_ex (php-fpm)
                                            #35 0x000000f1ee9f1586 zend_call_function (php-fpm)
                                            #36 0x000000f1eea1fc6c zend_call_method (php-fpm)
                                            #37 0x000000f1eea3c1d3 zend_std_cast_object_tostring (php-fpm)
                                            #38 0x000000f1ee9f7f7e _zval_get_string_func (php-fpm)
                                            #39 0x000000f1eea910d0 ZEND_CAST_SPEC_CV_HANDLER (php-fpm)
                                            #40 0x000000f1eea4b19b execute_ex (php-fpm)
                                            #41 0x000000f1ee9f1586 zend_call_function (php-fpm)
                                            #42 0x000000f1eea1fc6c zend_call_method (php-fpm)
                                            #43 0x000000f1eea3c1d3 zend_std_cast_object_tostring (php-fpm)
                                            #44 0x000000f1ee9f7f7e _zval_get_string_func (php-fpm)
                                            #45 0x000000f1eea910d0 ZEND_CAST_SPEC_CV_HANDLER (php-fpm)
                                            #46 0x000000f1eea4b19b execute_ex (php-fpm)
                                            #47 0x000000f1ee9f1586 zend_call_function (php-fpm)
                                            #48 0x000000f1eea1fc6c zend_call_method (php-fpm)
                                            #49 0x000000f1eea3c1d3 zend_std_cast_object_tostring (php-fpm)
                                            #50 0x000000f1ee9f7f7e _zval_get_string_func (php-fpm)
                                            #51 0x000000f1eea910d0 ZEND_CAST_SPEC_CV_HANDLER (php-fpm)
                                            #52 0x000000f1eea4b19b execute_ex (php-fpm)
                                            #53 0x000000f1ee9f1586 zend_call_function (php-fpm)
                                            #54 0x000000f1eea1fc6c zend_call_method (php-fpm)
                                            #55 0x000000f1eea3c1d3 zend_std_cast_object_tostring (php-fpm)
                                            #56 0x000000f1ee9f7f7e _zval_get_string_func (php-fpm)
                                            #57 0x000000f1eea910d0 ZEND_CAST_SPEC_CV_HANDLER (php-fpm)
                                            #58 0x000000f1eea4b19b execute_ex (php-fpm)
                                            #59 0x000000f1ee9f1586 zend_call_function (php-fpm)
                                            #60 0x000000f1eea1fc6c zend_call_method (php-fpm)
                                            #61 0x000000f1eea3c1d3 zend_std_cast_object_tostring (php-fpm)
                                            #62 0x000000f1ee9f7f7e _zval_get_string_func (php-fpm)
                                            #63 0x000000f1eea910d0 ZEND_CAST_SPEC_CV_HANDLER (php-fpm)
Oct 30 11:58:50 dev audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-coredump@2-8353-0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-11-01 01:40 UTC] laruence@php.net
-Status: Open +Status: Feedback
 [2017-11-01 01:40 UTC] laruence@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2017-11-12 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 03:01:28 2024 UTC