#48203 [Ver]: crash when CURLOPT_STDERR is set to regular file
| From: | jani@php.net | Date: | Sat, 09 May 2009 21:30:59 +0000 |
| Subject: | #48203 [Ver]: crash when CURLOPT_STDERR is set to regular file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-137075@lists.php.net to get a copy of this message | ||
ID: 48203
Updated by: jani@php.net
Reported By: php-bug at paulsohier dot nl
Status: Verified
Bug Type: cURL related
Operating System: *
PHP Version: 5.*, 6CVS (2009-05-09)
New Comment:
Mark:
CURLOPT_STDERR
Pass a FILE * as parameter. Tell libcurl to use this stream instead of
stderr when showing the progress meter and displaying CURLOPT_VERBOSE
data.
Previous Comments:
------------------------------------------------------------------------
[2009-05-09 21:30:12] jani@php.net
Adding this as last line also fixes the problem (ie. reset to
default..)
curl_setopt($ch, CURLOPT_STDERR, STDERR);
I don't know why the other hosts work and other don't. Propably there's
some traffic / error and the file handle gets destroyed or otherwise
mangled during shutdown and curl then tries to use it..
------------------------------------------------------------------------
[2009-05-09 21:23:40] mark at dynom dot nl
I can reproduce it on cURL 7.19.4 on PHP 5.2.9, but only when not using
the verbose option.
When CURLOPT_VERBOSE is false, or not set at all, I get no segfaults.
When true, it segfaults.
------------------------------------------------------------------------
[2009-05-09 20:58:11] php-bug at paulsohier dot nl
Its also related somehow to the url thats used to fetch, as when you
try it with example.org the script works okay.
------------------------------------------------------------------------
[2009-05-09 20:51:47] jani@php.net
Verified with all branches using cURL 7.15.5
------------------------------------------------------------------------
[2009-05-09 20:51:04] jani@php.net
<?php
$url = 'www.hosthuis.nl';
$ch = curl_init();
$handle = fopen('/tmp/tt.tmp', 'w');
// $handle = STDERR; // This works
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_STDERR, $handle);
curl_setopt($ch, CURLOPT_URL, $url);
curl_exec($ch);
?>
------------------------------------------------------------------------
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
http://bugs.php.net/48203
--
Edit this bug report at http://bugs.php.net/?id=48203&edit=1