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

Test Failure Report for ext/curl/tests/curl_file_deleted_before_curl_close.phpt ('Memory corruption error if fp of just created file is closed before curl_close.')

Script

1: <?php
2:
3: $ch 
curl_init(getenv('PHP_CURL_HTTP_REMOTE_SERVER'));
4:
5:
$temp_file dirname(__FILE__) . '/curl_file_deleted_before_curl_close.tmp';
6: if (
file_exists($temp_file)) {
7:     
unlink($temp_file); // file should not exist before test
8:
}
9:
10:
$handle fopen($temp_file'w');
11:
12:
curl_setopt($chCURLOPT_STDERR$handle);
13:
curl_setopt($chCURLOPT_VERBOSE1);
14:
curl_setopt($chCURLOPT_RETURNTRANSFER1);
15:
16:
curl_exec($ch);
17:
18:
fclose($handle); // causes glibc memory error
19:
20: //unlink($temp_file); // uncomment to test segfault (file not found on iowrite.c)
21:
22:
curl_close($ch);
23: echo 
"Closed correctly\n";
24:
?>
25:

Expected

* Closing connection #%d
Closed correctly

Output

Closed correctly

Diff

001- * Closing connection #%d

 

Generated at Thu, 16 Oct 2014 05:27:17 +0000 (4 days ago)

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