Bug #73318 [Opn]: curling HTTPS URL in pcntl_fork child causes crash

From: Date: Tue, 18 Oct 2016 12:46:29 +0000
Subject: Bug #73318 [Opn]: curling HTTPS URL in pcntl_fork child causes crash
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204896@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73318&edit=1 ID: 73318 Updated by: krakjoe@php.net Reported by: dougnelson at silktide dot com Summary: curling HTTPS URL in pcntl_fork child causes crash Status: Open Type: Bug Package: cURL related Operating System: MacOS + Linux (confirmed) PHP Version: 7.0.12 Block user comment: N Private report: N New Comment: We believe this may have been fixed with the latest changes to OpenSSL. Would be nice if someone could confirm and update this bug. Previous Comments: ------------------------------------------------------------------------ [2016-10-13 23:15:40] dougnelson at silktide dot com 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 this bug report at https://bugs.php.net/bug.php?id=73318&edit=1

« previous php.bugs (#204896) next »