Bug #69402 [NEW]: Reading empty SSL stream hangs until timeout
| From: | carl dot vuorinen at w3 dot fi | Date: | Thu, 09 Apr 2015 06:08:29 +0000 |
| Subject: | Bug #69402 [NEW]: Reading empty SSL stream hangs until timeout | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-191912@lists.php.net to get a copy of this message | ||
From: carl dot vuorinen at w3 dot fi
Operating system: Ubuntu 14.04
PHP version: 5.6.7
Package: Streams related
Bug Type: Bug
Bug description:Reading empty SSL stream hangs until timeout
Description:
------------
Connecting to an SSL socket stream and trying to read from the stream
when it's empty, results in the script hanging with 100% CPU usage until
timeout (either socket timeout or PHP max execution time, which ever
comes first).
Only environment where I (and others) have been able to reproduce this
is PHP 5.6.7 on Ubuntu 14.04. I have tested on few CentOS servers with
PHP 5.4, 5.5 and 5.6 and they all work fine. Also on a Debian server
with PHP 5.4 the same script works fine.
More info here:
https://github.com/zendframework/ZendService_Apple_Apns/issues/19
Test script:
---------------
Unfortunately I haven't been able to reproduce this without a valid SSL
stream so the example code requires a connection to Apple APNS sandbox
server and a valid local certificate provided by Apple (which I
obviously cannot share). If anyone knows how this kind of connection
could be established in a more generic and easily reproducible way, that
would be great.
https://gist.github.com/cvuorinen/1640b1a8ff2a7a19dd8e
Expected result:
----------------
string(0) ""
Actual result:
--------------
Fatal error: Maximum execution time of 10 seconds exceeded in
/tmp/stream_test.php on line 27
Call Stack:
0.0001 233600 1. {main}() /tmp/stream_test.php:0
0.4907 236528 2. fread() /tmp/stream_test.php:27
--
Edit bug report at https://bugs.php.net/bug.php?id=69402&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69402&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69402&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69402&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69402&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69402&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69402&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69402&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69402&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69402&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69402&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69402&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69402&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69402&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69402&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69402&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69402&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69402&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69402&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69402&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69402&r=mysqlcfg