php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68922 Crash with setlocale LC_ALL and curl errors with special chars
Submitted: 2015-01-27 16:23 UTC Modified: 2015-02-08 04:22 UTC
From: mail at tomsommer dot dk Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 5.6.5 OS: CentOS 6
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-01-27 16:23 UTC] mail at tomsommer dot dk
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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-30 06:11 UTC] laruence@php.net
-Status: Open +Status: Feedback
 [2015-01-30 06:11 UTC] laruence@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2015-02-08 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 15:01:32 2024 UTC