php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75362 Unsupported charset results in stack overflow
Submitted: 2017-10-12 01:16 UTC Modified: 2017-10-12 08:00 UTC
From: soreepeong at gmail dot com Assigned:
Status: Duplicate Package: Reproducible crash
PHP Version: 7.1.10 OS: CentOS 6
Private report: No CVE-ID: None
 [2017-10-12 01:16 UTC] soreepeong at gmail dot com
Description:
------------
It happens whenever PHP encounters some kind of error message. It tries to print an error message, which apparently requires charset conversion, which triggers a warning about unsupported charset, and it tries to convert encoding again, and so on.

GDB Backtrace: https://pastebin.com/7u96Z8HE


Test script:
---------------
<?php

// the following invalid line prints error (expected)
asdf


// this one segfaults at the 2nd line
ini_set('default_charset', "EUC-KR");
@ini_set('mbstring.internal_encoding', "EUC-KR");

Expected result:
----------------
Print error, or actually suppress the deprecated warning since it has "@"

Actual result:
--------------
Segfault

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-12 08:00 UTC] requinix@php.net
-Status: Open +Status: Duplicate
 [2017-10-12 08:00 UTC] requinix@php.net
Duplicate of bug #75236, will be fixed in PHP 7.0.25 and 7.1.1.
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Mon Dec 17 10:01:25 2018 UTC