PHP  
 PHP_7_2
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/curl/tests/bug48203_multi.phpt ('Variation of bug #48203 with curl_multi_exec (Crash when file pointers passed to curl are closed before calling curl_multi_exec)')

Script

1: <?php
2:
include 'server.inc';
3: function 
checkForClosedFilePointer($target_url$curl_option$description) {
4:     
$fp fopen(dirname(__FILE__) . '/bug48203.tmp''w');
5:
6:     
$ch1 curl_init();
7:     
$ch2 curl_init();
8:
9:     
$options = array(
10:         
CURLOPT_RETURNTRANSFER => 1,
11:         
$curl_option => $fp,
12:         
CURLOPT_URL => $target_url,
13:     );
14:
15:     
// we also need to set CURLOPT_VERBOSE to test CURLOPT_STDERR properly
16:     
if (CURLOPT_STDERR == $curl_option) {
17:         
$options[CURLOPT_VERBOSE] = 1;
18:     }
19:
20:     if (
CURLOPT_INFILE == $curl_option) {
21:         
$options[CURLOPT_UPLOAD] = 1;
22:     }
23:
24:     
curl_setopt_array($ch1$options);
25:     
curl_setopt_array($ch2$options);
26:
27:     
fclose($fp); // <-- premature close of $fp caused a crash!
28:
29:     
$mh curl_multi_init();
30:
31:     
curl_multi_add_handle($mh$ch1);
32:     
curl_multi_add_handle($mh$ch2);
33:
34:     
$active 0;
35:     do {
36:         
curl_multi_exec($mh$active);
37:     } while (
$active 0);
38:
39:     
curl_multi_remove_handle($mh$ch1);
40:     
curl_multi_remove_handle($mh$ch2);
41:     
curl_multi_close($mh);
42:
43:     
// Force curl to output results
44:     
fflush(STDERR);
45:     
fflush(STDOUT);
46:
47:     echo 
"Ok for $description\n";
48: }
49:
50:
$options_to_check = array(
51:     
"CURLOPT_STDERR""CURLOPT_WRITEHEADER""CURLOPT_FILE""CURLOPT_INFILE"
52:
);
53:
54:
$target_url curl_cli_server_start();
55: foreach(
$options_to_check as $option) {
56:     
checkForClosedFilePointer($target_urlconstant($option), $option);
57: }
58:
59:
?>
60:

Expected

Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d

Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in %s on line %d
%A
Ok for CURLOPT_STDERR

Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %s on line %d

Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %s on line %d
Ok for CURLOPT_WRITEHEADER

Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d

Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d
Hello World!
Hello World!Hello World!
Hello World!Ok for CURLOPT_FILE

Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %s on line %d

Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %s on line %d
Ok for CURLOPT_INFILE

Output

Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in /var/php_gcov/PHP_7_2/ext/curl/tests/bug48203_multi.php on line 36

Warning: curl_multi_exec(): CURLOPT_STDERR resource has gone away, resetting to stderr in /var/php_gcov/PHP_7_2/ext/curl/tests/bug48203_multi.php on line 36
* About to connect() to gcov.php.net port 80 (#0)
*   Trying 208.69.122.227... * connected
* Connected to gcov.php.net (208.69.122.227) port 80 (#0)
* About to connect() to gcov.php.net port 80 (#1)
*   Trying 208.69.122.227... * connected
* Connected to gcov.php.net (208.69.122.227) port 80 (#1)
> GET /responder HTTP/1.1
Host: gcov.php.net
Accept: */*

> GET /responder HTTP/1.1
Host: gcov.php.net
Accept: */*

< HTTP/1.1 301 Moved Permanently
< Date: Sun, 19 Nov 2017 05:48:46 GMT
< Server: Apache/2.2.15 (CentOS)
< Location: http://gcov.php.net/responder/
< Content-Length: 238
< Connection: close
< Content-Type: text/html; charset=iso-8859-1
< 
< HTTP/1.1 301 Moved Permanently
< Date: Sun, 19 Nov 2017 05:48:46 GMT
< Server: Apache/2.2.15 (CentOS)
< Location: http://gcov.php.net/responder/
< Content-Length: 238
< Connection: close
< Content-Type: text/html; charset=iso-8859-1
< 
* Closing connection #0
* Closing connection #1
Ok for CURLOPT_STDERR

Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in /var/php_gcov/PHP_7_2/ext/curl/tests/bug48203_multi.php on line 36

Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in /var/php_gcov/PHP_7_2/ext/curl/tests/bug48203_multi.php on line 36
Ok for CURLOPT_WRITEHEADER

Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in /var/php_gcov/PHP_7_2/ext/curl/tests/bug48203_multi.php on line 36

Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in /var/php_gcov/PHP_7_2/ext/curl/tests/bug48203_multi.php on line 36
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://gcov.php.net/responder/">here</a>.</p>
</body></html>
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://gcov.php.net/responder/">here</a>.</p>
</body></html>
Ok for CURLOPT_FILE

Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in /var/php_gcov/PHP_7_2/ext/curl/tests/bug48203_multi.php on line 36

Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in /var/php_gcov/PHP_7_2/ext/curl/tests/bug48203_multi.php on line 36
Ok for CURLOPT_INFILE

Diff

005+ *   Trying 208.69.122.227... * connected
006+ * Connected to gcov.php.net (208.69.122.227) port 80 (#0)
007+ * About to connect() to gcov.php.net port 80 (#1)
008+ *   Trying 208.69.122.227... * connected
009+ * Connected to gcov.php.net (208.69.122.227) port 80 (#1)
010+ > GET /responder HTTP/1.1
011+ Host: gcov.php.net
012+ Accept: */*
005- Ok for CURLOPT_STDERR
007- Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %s on line %d
009- Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in %s on line %d
010- Ok for CURLOPT_WRITEHEADER
011- 
012- Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d
013- 
014- Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in %s on line %d
015- Hello World!
016- Hello World!Hello World!
017- Hello World!Ok for CURLOPT_FILE
014+ > GET /responder HTTP/1.1
015+ Host: gcov.php.net
016+ Accept: */*
018+ < HTTP/1.1 301 Moved Permanently
019+ < Date: Sun, 19 Nov 2017 05:48:46 GMT
020+ < Server: Apache/2.2.15 (CentOS)
021+ < Location: http://gcov.php.net/responder/
022+ < Content-Length: 238
023+ < Connection: close
024+ < Content-Type: text/html; charset=iso-8859-1
025+ < 
026+ < HTTP/1.1 301 Moved Permanently
027+ < Date: Sun, 19 Nov 2017 05:48:46 GMT
028+ < Server: Apache/2.2.15 (CentOS)
029+ < Location: http://gcov.php.net/responder/
030+ < Content-Length: 238
031+ < Connection: close
032+ < Content-Type: text/html; charset=iso-8859-1
033+ < 
034+ * Closing connection #0
035+ * Closing connection #1
036+ Ok for CURLOPT_STDERR
019- Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %s on line %d
021- Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in %s on line %d
022- Ok for CURLOPT_INFILE
038+ Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in /var/php_gcov/PHP_7_2/ext/curl/tests/bug48203_multi.php on line 36
039+ 
040+ Warning: curl_multi_exec(): CURLOPT_WRITEHEADER resource has gone away, resetting to default in /var/php_gcov/PHP_7_2/ext/curl/tests/bug48203_multi.php on line 36
041+ Ok for CURLOPT_WRITEHEADER
042+ 
043+ Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in /var/php_gcov/PHP_7_2/ext/curl/tests/bug48203_multi.php on line 36
045+ Warning: curl_multi_exec(): CURLOPT_FILE resource has gone away, resetting to default in /var/php_gcov/PHP_7_2/ext/curl/tests/bug48203_multi.php on line 36
046+ <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
047+ <html><head>
048+ <title>301 Moved Permanently</title>
049+ </head><body>
050+ <h1>Moved Permanently</h1>
051+ <p>The document has moved <a href="http://gcov.php.net/responder/">here</a>.</p>
052+ </body></html>
053+ <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
054+ <html><head>
055+ <title>301 Moved Permanently</title>
056+ </head><body>
057+ <h1>Moved Permanently</h1>
058+ <p>The document has moved <a href="http://gcov.php.net/responder/">here</a>.</p>
059+ </body></html>
060+ Ok for CURLOPT_FILE
061+ 
062+ Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in /var/php_gcov/PHP_7_2/ext/curl/tests/bug48203_multi.php on line 36
063+ 
064+ Warning: curl_multi_exec(): CURLOPT_INFILE resource has gone away, resetting to default in /var/php_gcov/PHP_7_2/ext/curl/tests/bug48203_multi.php on line 36
065+ Ok for CURLOPT_INFILE

 

Generated at Tue, 21 Nov 2017 01:17:01 +0000 (5 hours ago)

Copyright © 2005-2017 The PHP Group
All rights reserved.