Bug #71304 [NEW]: Slug with iconv
| From: | php_bug at binsp dot net | Date: | Thu, 07 Jan 2016 17:43:17 +0000 |
| Subject: | Bug #71304 [NEW]: Slug with iconv | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-198498@lists.php.net to get a copy of this message | ||
From: php_bug at binsp dot net
Operating system: FreeBSD 10.2-RELEASE-p7
PHP version: 7.0.2
Package: ICONV related
Bug Type: Bug
Bug description:Slug with iconv
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
--
Edit bug report at https://bugs.php.net/bug.php?id=71304&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71304&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71304&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71304&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71304&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71304&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71304&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71304&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71304&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71304&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71304&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71304&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71304&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71304&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71304&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71304&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71304&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71304&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71304&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71304&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71304&r=mysqlcfg