Bug #73318 [NEW]: curling HTTPS URL in pcntl_fork child causes crash
From: dougnelson at silktide dot com
Operating system: MacOS + Linux (confirmed)
PHP version: 7.0.12
Package: cURL related
Bug Type: Bug
Bug description:curling HTTPS URL in pcntl_fork child causes crash
Description:
------------
Steps:
1. curl a HTTPS URL
2. run pcntl_fork
3. have the child process curl another HTTPS url
4. check the status of the child process, it will have crashed
This has been discussed here:
http://stackoverflow.com/questions/34901910/curl-and-pcntl-fork
And in a different guise here:
http://stackoverflow.com/questions/15466809/libcurl-ssl-error-after-fork?lq=1
The answer from the second link implies that it's a known issue when
forking with libcurl, and the way to get around it is to call
curl_global_cleanup pre-forking, a function that doesn't seem to have
a PHP function wrapper.
Is this functionality intentionally not exposed through the PHP
interface, or is it something that can be added (with the only trauma
being the addition of another function)?
Test script:
---------------
http://pastebin.com/VJNFucmH
Expected result:
----------------
d41d8cd98f00b204e9800998ecf8427e
407dfffa37092ff8017e06f071bb0f93
Array
(
[URL] => http://php.net
[Successful Exit] => Yes
[Exit Code] => 0
)
eff6abf853a3b5758b1449bca208df8b
Array
(
[URL] => https://stackoverflow.com/
[Successful Exit] => Yes
[Exit Code] => 0
)
Actual result:
--------------
d41d8cd98f00b204e9800998ecf8427e
407dfffa37092ff8017e06f071bb0f93
Array
(
[URL] => http://php.net
[Process Running] => No
[Successful Exit] => Yes
[Exit Code] => 0
)
Array
(
[URL] => https://stackoverflow.com/
[Process Running] => No
[Successful Exit] => No
[Exit Code] => 0
)
--
Edit bug report at https://bugs.php.net/bug.php?id=73318&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73318&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73318&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73318&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73318&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73318&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73318&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73318&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73318&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73318&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73318&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73318&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73318&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73318&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73318&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73318&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73318&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73318&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73318&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73318&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73318&r=mysqlcfg
Thread (6 messages)
- dougnelson at silktide dot com