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($ch, CURLOPT_STDERR, $handle); 13: curl_setopt($ch, CURLOPT_VERBOSE, 1); 14: curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 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 Sat, 25 May 2013 18:49:39 +0000 (13 hours ago)
|