Bug #71861 [Fbk->Opn]: Buffer Overrun in curl_exec() causing hang

From: Date: Sun, 03 Apr 2016 17:19:37 +0000
Subject: Bug #71861 [Fbk->Opn]: Buffer Overrun in curl_exec() causing hang
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200323@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71861&edit=1

 ID:                 71861
 User updated by:    paul at salesintel dot com
 Reported by:        paul at salesintel dot com
 Summary:            Buffer Overrun in curl_exec() causing hang
-Status:             Feedback
+Status:             Open
 Type:               Bug
 Package:            cURL related
 Operating System:   Windows 10 x64
 PHP Version:        7.0.4
 Block user comment: N
 Private report:     N

 New Comment:

The repro() function now completes in all cases (although supplied arguments are invalid garbage).

I removed my workaround in my actual project, where similar curl_* calls occur (but with valid
parameters), and all appears to be working as expected.

I'm still curious, in the original php_curl version, why PHP hung rather than throwing an
Exception.

Regardless, thanks @ab@php.net so much for resolving. 
-paul

p.s. we're using the non-thread-safe 32b & 64b versions of php. Any chance of getting a
(hot)fixed build for those configurations?


Previous Comments:
------------------------------------------------------------------------
[2016-04-02 09:48:57] ab@php.net

@paul could you please check whether this build fixes the issue for you? http://windows.php.net/downloads/snaps/ostc/71861/
. Just drop it into the ext folder and activate in the php.ini instead of the php_curl.dll .

Thanks.

------------------------------------------------------------------------
[2016-03-30 14:47:55] ab@php.net

Till now it looks indeed like a libcurl issue, a simple program can reproduce the same behavior https://gist.github.com/weltling/15400de1018c7e6a4b476a415f08768d
. I filed an issue to the upstream on github https://github.com/curl/curl/issues/741 .

Thanks.

------------------------------------------------------------------------
[2016-03-30 12:02:14] ab@php.net

I was able to reproduce the hang now. Both latest 5.6 and 7 reproduce, both use libcurl 7.47.1 on
Windows. A step through shows, that where it hangs is curl_easy_perform(), around interface.c:2880
in 7.0;

So how it looks like, it is either a bug or a behavior change in libcurl. 7.48.0 show it as well,
7.42.1 doesn't. I currently don't see any suspicious commits to ext/libcurl that could
cause this regression. Will check with a small C program whether it behaves same.

Thanks.

------------------------------------------------------------------------
[2016-03-28 19:55:12] nikic@php.net

Curl confirmed that these warnings are indirectly caused by openssl, so we can ignore those.

I was not able to reproduce the original issue on Ubuntu 14.04.

I am able to reproduce the hang on Windows, but cannot help beyond that.

------------------------------------------------------------------------
[2016-03-28 17:12:41] paul at salesintel dot com

That it can be reproduced even more simply in both 5 and 7 starts pointing the finger to something
other than the php curl wrapper, should it not still be a bug, or problem, that an exception is
never thrown? That the program just hangs?

------------------------------------------------------------------------


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=71861


--
Edit this bug report at https://bugs.php.net/bug.php?id=71861&edit=1


Thread (15 messages)

« previous php.bugs (#200323) next »