php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71304 Apache exit with signal 10 when use iconv
Submitted: 2016-01-07 17:43 UTC Modified: 2018-09-30 16:23 UTC
Votes:3
Avg. Score:4.7 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:3 (100.0%)
From: php_bug at binsp dot net Assigned:
Status: Open Package: ICONV related
PHP Version: 7.0.2 OS: Linux & BSD
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php_bug at binsp dot net
New email:
PHP Version: OS:

 

 [2016-01-07 17:43 UTC] php_bug at binsp dot net
Description:
------------
Sorry for my english

When i want rename uploaded file apache exit with signal 10
kernel: pid 12219 (httpd), uid 80: exited on signal 10 (core dumped)


PHP 7.0.2 (cli) (built: Jan  7 2016 12:43:59) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies

[PHP Modules] Core curl date dom filter gettext hash iconv imagick json libxml mbstring openssl pcre  pgsql Reflection  session SPL  standard yac

FreeBSD srv1.xxxx 10.2-RELEASE-p7 FreeBSD 10.2-RELEASE-p7


I have the same issue with Linux Sun 4.3.3-2-ARCH #1

the probleme appear at update to 7.0.2 when I realize it I tested without probleme on another server with php 7.0.1 
When I updated this server I had the same problem.



Test script:
---------------
    public static function slugMe($str, $replace=array(), $delimiter='-')
    {
        if (!empty($replace)) {
            $str = str_replace((array)$replace, ' ', $str);
        }

        $sluged = iconv('UTF-8', 'ASCII//TRANSLIT', $str);
        $sluged = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $sluged);
        $sluged = strtolower(trim($sluged, '-'));
        $sluged = preg_replace("/[\/_|+ -]+/", $delimiter, $sluged);

        return $sluged;
    }

Actual result:
--------------
(gdb) bt
#0  0x0000000801bd7bc1 in __bsd_iconv () from /lib/libc.so.7
#1  0x00000008041edf2a in php_iconv_string (in_p=0x806472130 "zoom.jpg", in_len=8, out=0x7fffffffce50, out_charset=<value optimized out>, in_charset=<value optimized out>) at iconv.c:654
#2  0x00000008041eb915 in php_if_iconv (execute_data=<value optimized out>, return_value=0x8064131d0) at iconv.c:2462
#3  0x00000008043c96fb in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0x8064130e0) at zend_vm_execute.h:714
#4  0x00000008043951f8 in execute_ex (ex=<value optimized out>) at zend_vm_execute.h:417
#5  0x0000000804395438 in zend_execute (op_array=0x806475000, return_value=<value optimized out>) at zend_vm_execute.h:458
#6  0x0000000804356b9f in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:1427
#7  0x00000008042f6443 in php_execute_script (primary_file=0x7fffffffe630) at main.c:2471
#8  0x00000008043e3d45 in php_handler (r=0x8026b4290) at sapi_apache2.c:678
#9  0x0000000000452197 in ap_invoke_handler ()
#10 0x0000000000467c76 in ap_internal_redirect ()
#11 0x0000000803c3edc0 in ?? () from /usr/local/libexec/apache24/mod_rewrite.so
#12 0x0000000000452197 in ap_invoke_handler ()
#13 0x000000000046777f in ap_process_async_request ()
#14 0x0000000000467819 in ap_process_request ()
#15 0x00000000004643ec in ap_expr_yyrealloc ()
#16 0x000000000045c886 in ap_process_connection ()
#17 0x000000000046edd3 in ap_set_etag ()
#18 0x000000000046e91f in ap_set_etag ()
#19 0x000000000046e113 in ap_set_etag ()
#20 0x00000000004374cd in ap_run_mpm ()
#21 0x000000000043085f in main ()

bt full
#1  0x00000008041edf2a in php_iconv_string (in_p=0x806472130 "zoom.jpg", in_len=8, out=0x7fffffffce50, out_charset=<value optimized out>, in_charset=<value optimized out>) at iconv.c:654
	out_left = 40
	in_left = 8
	out_left = 40
	out_p = 0x8064a2248 "\030\"J\006\b"
	in_left = 8
	in_left = 8
	out_p = 0x8064a2248 "\030\"J\006\b"
	retval = Cannot access memory at address 0x6


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-01-07 17:58 UTC] php_bug at binsp dot net
-Summary: Slug with iconv +Summary: Apache exit with signal 10 when use iconv -Operating System: FreeBSD 10.2-RELEASE-p7 +Operating System: Linux & BSD
 [2016-01-07 17:58 UTC] php_bug at binsp dot net
change summary
 [2016-01-07 18:09 UTC] php_bug at binsp dot net
To reproduce bug

php -r "iconv ( 'UTF-8', 'ASCII//TRANSLIT', 'PHP_BUG' );"

return => Bus error (core dumped)
 [2016-01-07 18:14 UTC] php_bug at binsp dot net
To reproduce

php -r "iconv ( 'UTF-8', 'ASCII//TRANSLIT', 'PHP_BUG' );"
Bus error (core dumped)
 [2016-01-08 03:12 UTC] laruence@php.net
I can not reproduce this
 [2016-01-08 05:47 UTC] rasmus@php.net
I checked on FreeBSD, Debian, Ubuntu and Centos and couldn't reproduce it either.
 [2016-01-09 00:17 UTC] yohgaki@php.net
Cannot reproduce on Fedora 23

[yohgaki@dev PHP-7.0]$ uname -a
Linux localhost 4.2.8-300.fc23.x86_64 #1 SMP Tue Dec 15 16:49:06 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[yohgaki@dev PHP-7.0]$ ./sapi/cli/php -r "var_dump(iconv( 'UTF-8', 'ASCII//TRANSLIT', 'PHP_BUG' ));"
string(7) "PHP_BUG"
[yohgaki@dev PHP-7.0]$ echo $?
0
 [2018-09-30 16:23 UTC] cmb@php.net
This might be a duplicate of bug #72198.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 10:01:30 2024 UTC