|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80070 mb_http_input("UTF-8"); does crash php8.0.0beta3
Submitted: 2020-09-07 05:27 UTC Modified: 2020-09-07 08:05 UTC
From: call dot user dot func at gmail dot com Assigned: nikic (profile)
Status: Closed Package: mbstring related
PHP Version: 8.0.0beta3 OS: Windows 10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: call dot user dot func at gmail dot com
New email:
PHP Version: OS:


 [2020-09-07 05:27 UTC] call dot user dot func at gmail dot com
Starting with php8.0.0beta3 on windows (all prev. versions work as expected), php does crash on line mb_http_input() with enabled mbstring extension:

echo mb_substr("foo", 0, 1);

This is in command line and apache module. Apache does crash the thread with no clear error log. PHP CLI just crash without error, at least i can't find any.

Are there any dependency that we must update with beta3? As i can read here: - I see there is a Fixed bug #55847 (DOTNET .NET 4.0 GAC new location). (cmb)

Maybe something happened here?

Test script:
echo mb_substr("foo", 0, 1);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-09-07 06:00 UTC]
-Status: Open +Status: Verified -Package: Reproducible crash +Package: mbstring related
 [2020-09-07 06:00 UTC]
valgrind of php -r 'mb_http_input("UTF-8");'

==50== Process terminating with default action of signal 11 (SIGSEGV)
==50==  Access not within mapped region at address 0x8
==50==    at 0x4D0A03: zif_mb_http_input (mbstring.c:1379)
==50==    by 0x7ECC63: ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1234)
==50==    by 0x85D411: execute_ex (zend_vm_execute.h:55325)
==50==    by 0x861DE3: zend_execute (zend_vm_execute.h:59932)
==50==    by 0x79E3A8: zend_eval_stringl (zend_execute_API.c:1177)
==50==    by 0x79E5A2: zend_eval_stringl_ex (zend_execute_API.c:1218)
==50==    by 0x79E617: zend_eval_string_ex (zend_execute_API.c:1228)
==50==    by 0x8A1656: do_cli (php_cli.c:979)
==50==    by 0x8A25A1: main (php_cli.c:1336)
 [2020-09-07 08:02 UTC]
-Status: Verified +Status: Closed -Assigned To: +Assigned To: nikic
 [2020-09-07 08:02 UTC]
This has already been fixed in

However, after seeing your code I also changed it to throw a ValueError:

mb_http_input() is a function to get the input encoding, not to set it. Passing an encoding to it doesn't make sense.
 [2020-09-07 08:05 UTC] call dot user dot func at gmail dot com
Thanks for fast reply. Also i'm surprised why we had that wrong parameter. Never thought about it until today. I guess we had it because in next line we do mb_http_output() which accepts an encoding parameter.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 09:01:28 2024 UTC