Bug #68922 [NEW]: Crash with setlocale LC_ALL and curl errors with special chars
| From: | mail at tomsommer dot dk | Date: | Tue, 27 Jan 2015 16:23:02 +0000 |
| Subject: | Bug #68922 [NEW]: Crash with setlocale LC_ALL and curl errors with special chars | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-190251@lists.php.net to get a copy of this message | ||
From: mail at tomsommer dot dk
Operating system: CentOS 6
PHP version: 5.6.5
Package: Reproducible crash
Bug Type: Bug
Bug description:Crash with setlocale LC_ALL and curl errors with special chars
Description:
------------
Settings <?php setlocale(LC_ALL, 'danish') ?> and running a curl request
against a hostname that returns a special timeout (firewall block),
makes PHP segfault.
If one does NOT use LC_ALL, but LC_MESSAGES or all of the LC_*, it does
not crash. It _only_ happens for LC_ALL
Test script:
---------------
Testing requires one to run curl from a host that is blocked by firewall
to the remote host.
Cannot provide test script, hope strace is enough.
Can only reproduce with mod_php5, and not in CLI, perhaps due to
environment variables.
Actual result:
--------------
stat("/var/www/example.com/vendor/guzzlehttp/ringphp/src/Core.php",
{st_mode=S_IFREG|0644, st_size=11015, ...}) = 0
rt_sigaction(SIGALRM, NULL, {SIG_DFL, [], SA_RESTORER, 0x7f9168323710},
8) = 0
rt_sigaction(SIGALRM, {0x7f9164198e40, [], SA_RESTORER, 0x7f9168323710},
NULL, 8) = 0
alarm(1) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
alarm(0) = 1
rt_sigaction(SIGALRM, {SIG_DFL, [], SA_RESTORER, 0x7f9168323710}, NULL,
8) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 43
fcntl(43, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(43, F_SETFL, O_RDWR|O_NONBLOCK) = 0
connect(43, {sa_family=AF_INET, sin_port=htons(443),
sin_addr=inet_addr("193.163.102.37")}, 16) = -1 EINPROGRESS (Operation
now in progress)
poll([{fd=43, events=POLLOUT|POLLWRNORM}], 1, 500) = 0 (Timeout)
getsockopt(43, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
close(43) = 0
socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP) = 43
fcntl(43, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(43, F_SETFL, O_RDWR|O_NONBLOCK) = 0
connect(43, {sa_family=AF_INET6, sin6_port=htons(443),
inet_pton(AF_INET6, "2a01:630:0:40::37", &sin6_addr), sin6_flowinfo=0,
sin6_scope_id=0}, 28) = -1 ENETUNREACH (Network is unreachable)
open("/usr/share/locale/da_DK.ISO-8859-1/LC_MESSAGES/libc.mo", O_RDONLY)
= -1 ENOENT (No such file or directory)
open("/usr/share/locale/da_DK.iso88591/LC_MESSAGES/libc.mo", O_RDONLY) =
-1 ENOENT (No such file or directory)
open("/usr/share/locale/da_DK/LC_MESSAGES/libc.mo", O_RDONLY) = -1
ENOENT (No such file or directory)
open("/usr/share/locale/da.ISO-8859-1/LC_MESSAGES/libc.mo", O_RDONLY) =
-1 ENOENT (No such file or directory)
open("/usr/share/locale/da.iso88591/LC_MESSAGES/libc.mo", O_RDONLY) = -1
ENOENT (No such file or directory)
open("/usr/share/locale/da/LC_MESSAGES/libc.mo", O_RDONLY) = 44
fstat(44, {st_mode=S_IFREG|0644, st_size=129959, ...}) = 0
mmap(NULL, 129959, PROT_READ, MAP_PRIVATE, 44, 0) = 0x7f9169c43000
close(44) = 0
getsockopt(43, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
close(43) = 0
access("/var/www/example.com/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureArray.php",
F_OK) = 0
stat("/var/www/example.com/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureArray.php",
{st_mode=S_IFREG|0644, st_size=866, ...}) = 0
access("/var/www/example.com/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureValue.php",
F_OK) = 0
stat("/var/www/example.com/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureValue.php",
{st_mode=S_IFREG|0644, st_size=1377, ...}) = 0
access("/var/www/example.com/vendor/guzzlehttp/ringphp/src/Future/FutureArrayInterface.php",
F_OK) = 0
stat("/var/www/example.com/vendor/guzzlehttp/ringphp/src/Future/FutureArrayInterface.php",
{st_mode=S_IFREG|0644, st_size=213, ...}) = 0
access("/var/www/example.com/vendor/guzzlehttp/ringphp/src/Exception/ConnectException.php",
F_OK) = 0
stat("/var/www/example.com/vendor/guzzlehttp/ringphp/src/Exception/ConnectException.php",
{st_mode=S_IFREG|0644, st_size=138, ...}) = 0
access("/var/www/example.com/vendor/guzzlehttp/ringphp/src/Exception/RingException.php",
F_OK) = 0
stat("/var/www/example.com/vendor/guzzlehttp/ringphp/src/Exception/RingException.php",
{st_mode=S_IFREG|0644, st_size=94, ...}) = 0
access("/var/www/example.com/vendor/react/promise/src/FulfilledPromise.php",
F_OK) = 0
stat("/var/www/example.com/vendor/react/promise/src/FulfilledPromise.php",
{st_mode=S_IFREG|0644, st_size=1791, ...}) = 0
access("/var/www/example.com/vendor/react/promise/src/ExtendedPromiseInterface.php",
F_OK) = 0
stat("/var/www/example.com/vendor/react/promise/src/ExtendedPromiseInterface.php",
{st_mode=S_IFREG|0644, st_size=584, ...}) = 0
access("/var/www/example.com/vendor/react/promise/src/PromiseInterface.php",
F_OK) = 0
stat("/var/www/example.com/vendor/react/promise/src/PromiseInterface.php",
{st_mode=S_IFREG|0644, st_size=226, ...}) = 0
access("/var/www/example.com/vendor/react/promise/src/CancellablePromiseInterface.php",
F_OK) = 0
stat("/var/www/example.com/vendor/react/promise/src/CancellablePromiseInterface.php",
{st_mode=S_IFREG|0644, st_size=166, ...}) = 0
access("/var/www/example.com/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php",
F_OK) = 0
stat("/var/www/example.com/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php",
{st_mode=S_IFREG|0644, st_size=3420, ...}) = 0
access("/var/www/example.com/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php",
F_OK) = 0
stat("/var/www/example.com/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php",
{st_mode=S_IFREG|0644, st_size=92, ...}) = 0
access("/var/www/example.com/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php",
F_OK) = 0
stat("/var/www/example.com/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php",
{st_mode=S_IFREG|0644, st_size=90, ...}) = 0
access("/var/www/example.com/vendor/guzzlehttp/guzzle/src/Event/ErrorEvent.php",
F_OK) = 0
stat("/var/www/example.com/vendor/guzzlehttp/guzzle/src/Event/ErrorEvent.php",
{st_mode=S_IFREG|0644, st_size=676, ...}) = 0
access("/var/www/example.com/vendor/guzzlehttp/guzzle/src/Event/AbstractRetryableEvent.php",
F_OK) = 0
stat("/var/www/example.com/vendor/guzzlehttp/guzzle/src/Event/AbstractRetryableEvent.php",
{st_mode=S_IFREG|0644, st_size=1473, ...}) = 0
access("/var/www/example.com/vendor/guzzlehttp/guzzle/src/Event/AbstractTransferEvent.php",
F_OK) = 0
stat("/var/www/example.com/vendor/guzzlehttp/guzzle/src/Event/AbstractTransferEvent.php",
{st_mode=S_IFREG|0644, st_size=1825, ...}) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
chdir("/usr/local/apache2") = 0
rt_sigaction(SIGSEGV, {SIG_DFL, [], SA_RESTORER|SA_INTERRUPT,
0x7f9168323710}, {SIG_DFL, [], SA_RESTORER|SA_RESETHAND,
0x7f9168323710}, 8) = 0
kill(23746, SIGSEGV) = 0
rt_sigreturn(0x5cc2) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
Process 23746 detached
--
Edit bug report at https://bugs.php.net/bug.php?id=68922&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68922&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68922&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68922&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68922&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68922&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68922&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68922&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68922&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68922&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68922&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68922&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68922&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68922&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68922&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68922&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68922&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68922&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68922&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68922&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68922&r=mysqlcfg