Bug #74563 [Com]: curl_exec() throws internal error in curl_error()

From: Date: Wed, 10 May 2017 22:52:05 +0000
Subject: Bug #74563 [Com]: curl_exec() throws internal error in curl_error()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-209050@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74563&edit=1 ID: 74563 Comment by: danack@php.net Reported by: jeremys at ha dot com Summary: curl_exec() throws internal error in curl_error() Status: Open Type: Bug Package: cURL related Operating System: RHEL 7.3 PHP Version: 7.1.4 Block user comment: N Private report: N New Comment: Ok, so it's impossible, but it's happening.... Two suggestions of how to investigate this further: i) Attach a debugger like gdb to the process, set a breakpoint in zif_curl_error (which is the C symbol name for the PHP curl_error function), and print the backtrace...this should reveal how the code even reaches there. ii) Report this to RogueWave or whoever supports ZendServer.....as you're seeing it as part of a non-standard distribution, and it's theoretically impossible in stock PHP, someone who has access to that will need to investigate it. Previous Comments: ------------------------------------------------------------------------ [2017-05-10 13:01:54] jeremys at ha dot com I appreciate your skepticism as I was quite skeptical such an error could occur, too, but alas.. With the opcache.enable directive still set to 0, I changed the die in the anonymous error handler function to print 'Error occurred.', and still received the following output (note the different line number and additional string printed at the end): Array ( [0] => 2 [1] => curl_error() expects parameter 1 to be resource, boolean given [2] => /usr/local/apache/htdocs2/common/curl-error-test.php [3] => 18 ) Error occurred. ------------------------------------------------------------------------ [2017-05-09 21:59:19] danack@php.net > I disabled opcache for the script by adding the following line to the top of the script: > ini_set( 'opcache.enable', 0 ); If the script is being cached, then editing the script won't make a difference. Please try editing what is being printed out in the error handler, to confirm the exact code you're reporting is causing the error. The reason I'm so sceptical about what code is making that error appear, is that the error message is one that is shown when userland code calls an internal function, but is very unlikely to appear due to how curl works internally. ------------------------------------------------------------------------ [2017-05-09 15:32:58] jeremys at ha dot com No Suhosin or other security modules are running/enabled. Do you need a particular part of the php.ini? I disabled opcache for the script by adding the following line to the top of the script: ini_set( 'opcache.enable', 0 ); And the error still occasionally happens. ------------------------------------------------------------------------ [2017-05-09 15:16:06] danack@php.net In fact - please can you just double check that you are seeing the error from the code you have listed here. I strongly suspect you have OPCache running and the error you are seeing is from code that has been cached in memory, rather than running the latest version of that file. ------------------------------------------------------------------------ [2017-05-09 15:04:57] danack@php.net Do you have Suhosin or any other security module enabled? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=74563 -- Edit this bug report at https://bugs.php.net/bug.php?id=74563&edit=1

« previous php.bugs (#209050) next »