php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81298 mb_detect_encoding() segfaults when 7bit encoding is specified
Submitted: 2021-07-26 09:13 UTC Modified: 2021-07-28 08:01 UTC
From: alec@php.net Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 8.1Git-2021-07-26 (Git) OS: Linux
Private report: No CVE-ID: None
 [2021-07-26 09:13 UTC] alec@php.net
Description:
------------
Sorry for incomplete information. I hope someone could help me to find out more about this issue.

For https://github.com/roundcube/roundcubemail I just enabled Github Actions tests on PHP 8.1 and I got a core dump. I'm not sure this is Github or PHP's segfault.

I do not have a local PHP 8.1 installation to test with yet, so maybe someone would like to run the tests locally to verify.

Here's the raw log from the GA run: https://pipelines.actions.githubusercontent.com/u0loR6uBKIBHqKHhv0hTP4yFrcdLnLzpWEg6qJMnMYCKI8ovYJ/_apis/pipelines/1/runs/418/signedlogcontent/6?urlExpires=2021-07-26T09%3A11%3A08.4028855Z&urlSigningMethod=HMACV1&urlSignature=jdCF19d3rUDCj%2FFF66ORYaUssVkTBh1vJpkIe3ey1yY%3D


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-07-28 07:58 UTC] nikic@php.net
-Status: Open +Status: Verified
 [2021-07-28 07:58 UTC] nikic@php.net
Program received signal SIGSEGV, Segmentation fault.
0x0000555555a8b584 in mbfl_encoding_detector_new (elist=0x7ffff14f6600, 
    elistsz=81, strict=0)
    at /home/nikic/php/php-src/ext/mbstring/libmbfl/mbfl/mbfilter.c:321
321			identd->filter_list[i]->opaque = (void*)0;
(gdb) bt
#0  0x0000555555a8b584 in mbfl_encoding_detector_new (elist=0x7ffff14f6600, 
    elistsz=81, strict=0)
    at /home/nikic/php/php-src/ext/mbstring/libmbfl/mbfl/mbfilter.c:321
#1  0x0000555555a8ba63 in mbfl_identify_encoding (string=0x7fffffffa200, 
    elist=0x7ffff14f6600, elistsz=81, strict=0)
    at /home/nikic/php/php-src/ext/mbstring/libmbfl/mbfl/mbfilter.c:460
#2  0x0000555555a62097 in zif_mb_detect_encoding (execute_data=0x7ffff341c9d0, 
    return_value=0x7ffff341c990)
    at /home/nikic/php/php-src/ext/mbstring/mbstring.c:2719
 [2021-07-28 08:00 UTC] nikic@php.net
Reduced:

var_dump(mb_detect_encoding("foobar", "7bit"));
 [2021-07-28 08:01 UTC] nikic@php.net
-Summary: Core dump on PHP 8.1 +Summary: mb_detect_encoding() segfaults when 7bit encoding is specified
 [2021-07-28 08:12 UTC] git@php.net
Automatic comment on behalf of nikic
Revision: https://github.com/php/php-src/commit/9d0db2e98aa8ef90205a9257a96c26a01a7159bf
Log: Fixed bug #81298
 [2021-07-28 08:12 UTC] git@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 11:01:30 2024 UTC