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

Valgrind Report for ext/ftp/tests/ftp_nb_get_large.phpt ('Testing ftp_nb_fget can handle large files incl. resume')

Script

1: <?php
2:
require 'server.inc';
3:
4:
$ftp ftp_connect('127.0.0.1'$port);
5:
ftp_login($ftp'user''pass');
6: if (!
$ftp) die("Couldn't connect to the server");
7:
8:
$local_file dirname(__FILE__) . DIRECTORY_SEPARATOR "ftp_nb_get_large.txt";
9:
touch($local_file);
10:
ftp_nb_get($ftp$local_file'fget_large.txt'FTP_BINARY5368709119);
11:
$fp fopen($local_file'r');
12:
fseek($fp5368709119);
13:
var_dump(fread($fp1));
14:
var_dump(filesize($local_file));
15:
fclose($fp);
16:
?>
17:

Report

==6458== Invalid read of size 8
==6458==    at 0x100FD51: _php_stream_free (streams.c:373)
==6458==    by 0x80AD83: ftp_close (ftp.c:171)
==6458==    by 0x805067: ftp_destructor_ftpbuf (php_ftp.c:317)
==6458==    by 0x11331C4: zend_resource_dtor (zend_list.c:76)
==6458==    by 0x1133BE9: zend_close_rsrc (zend_list.c:230)
==6458==    by 0x1128C31: zend_hash_reverse_apply (zend_hash.c:1597)
==6458==    by 0x1133C35: zend_close_rsrc_list (zend_list.c:238)
==6458==    by 0x10BB4F3: shutdown_executor (zend_execute_API.c:263)
==6458==    by 0x10EF242: zend_deactivate (zend.c:1036)
==6458==    by 0xFDFCFB: php_request_shutdown (main.c:1904)
==6458==    by 0x13739C8: do_cli (php_cli.c:1178)
==6458==    by 0x13742FD: main (php_cli.c:1404)
==6458==  Address 0x159b1b20 is 144 bytes inside a block of size 224 free'd
==6458==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==6458==    by 0x1084671: _efree (zend_alloc.c:2444)
==6458==    by 0x1010591: _php_stream_free (streams.c:511)
==6458==    by 0x10149A1: stream_resource_regular_dtor (streams.c:1591)
==6458==    by 0x11331C4: zend_resource_dtor (zend_list.c:76)
==6458==    by 0x1133BE9: zend_close_rsrc (zend_list.c:230)
==6458==    by 0x1128C31: zend_hash_reverse_apply (zend_hash.c:1597)
==6458==    by 0x1133C35: zend_close_rsrc_list (zend_list.c:238)
==6458==    by 0x10BB4F3: shutdown_executor (zend_execute_API.c:263)
==6458==    by 0x10EF242: zend_deactivate (zend.c:1036)
==6458==    by 0xFDFCFB: php_request_shutdown (main.c:1904)
==6458==    by 0x13739C8: do_cli (php_cli.c:1178)
==6458==  Block was alloc'd at
==6458==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==6458==    by 0x1085BD7: __zend_malloc (zend_alloc.c:2829)
==6458==    by 0x1080399: _emalloc_224 (zend_alloc.c:2352)
==6458==    by 0x100F9AB: _php_stream_alloc (streams.c:274)
==6458==    by 0x101DB51: _php_stream_fopen_from_fd_int (plain_wrapper.c:186)
==6458==    by 0x101DE8F: _php_stream_fopen_from_fd (plain_wrapper.c:248)
==6458==    by 0x1020014: _php_stream_fopen (plain_wrapper.c:1024)
==6458==    by 0x102054F: php_plain_files_stream_opener (plain_wrapper.c:1080)
==6458==    by 0x1016CEB: _php_stream_open_wrapper_ex (streams.c:2027)
==6458==    by 0x808197: zif_ftp_nb_get (php_ftp.c:1042)
==6458==    by 0x1344F0E: ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:573)
==6458==    by 0x1344F0E: execute_ex (zend_vm_execute.h:59747)
==6458==    by 0x136C9B8: zend_execute (zend_vm_execute.h:63776)
==6458== 
==6458== Invalid read of size 4
==6458==    at 0x100FD9F: _php_stream_free (streams.c:376)
==6458==    by 0x80AD83: ftp_close (ftp.c:171)
==6458==    by 0x805067: ftp_destructor_ftpbuf (php_ftp.c:317)
==6458==    by 0x11331C4: zend_resource_dtor (zend_list.c:76)
==6458==    by 0x1133BE9: zend_close_rsrc (zend_list.c:230)
==6458==    by 0x1128C31: zend_hash_reverse_apply (zend_hash.c:1597)
==6458==    by 0x1133C35: zend_close_rsrc_list (zend_list.c:238)
==6458==    by 0x10BB4F3: shutdown_executor (zend_execute_API.c:263)
==6458==    by 0x10EF242: zend_deactivate (zend.c:1036)
==6458==    by 0xFDFCFB: php_request_shutdown (main.c:1904)
==6458==    by 0x13739C8: do_cli (php_cli.c:1178)
==6458==    by 0x13742FD: main (php_cli.c:1404)
==6458==  Address 0x159b1b04 is 116 bytes inside a block of size 224 free'd
==6458==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==6458==    by 0x1084671: _efree (zend_alloc.c:2444)
==6458==    by 0x1010591: _php_stream_free (streams.c:511)
==6458==    by 0x10149A1: stream_resource_regular_dtor (streams.c:1591)
==6458==    by 0x11331C4: zend_resource_dtor (zend_list.c:76)
==6458==    by 0x1133BE9: zend_close_rsrc (zend_list.c:230)
==6458==    by 0x1128C31: zend_hash_reverse_apply (zend_hash.c:1597)
==6458==    by 0x1133C35: zend_close_rsrc_list (zend_list.c:238)
==6458==    by 0x10BB4F3: shutdown_executor (zend_execute_API.c:263)
==6458==    by 0x10EF242: zend_deactivate (zend.c:1036)
==6458==    by 0xFDFCFB: php_request_shutdown (main.c:1904)
==6458==    by 0x13739C8: do_cli (php_cli.c:1178)
==6458==  Block was alloc'd at
==6458==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==6458==    by 0x1085BD7: __zend_malloc (zend_alloc.c:2829)
==6458==    by 0x1080399: _emalloc_224 (zend_alloc.c:2352)
==6458==    by 0x100F9AB: _php_stream_alloc (streams.c:274)
==6458==    by 0x101DB51: _php_stream_fopen_from_fd_int (plain_wrapper.c:186)
==6458==    by 0x101DE8F: _php_stream_fopen_from_fd (plain_wrapper.c:248)
==6458==    by 0x1020014: _php_stream_fopen (plain_wrapper.c:1024)
==6458==    by 0x102054F: php_plain_files_stream_opener (plain_wrapper.c:1080)
==6458==    by 0x1016CEB: _php_stream_open_wrapper_ex (streams.c:2027)
==6458==    by 0x808197: zif_ftp_nb_get (php_ftp.c:1042)
==6458==    by 0x1344F0E: ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:573)
==6458==    by 0x1344F0E: execute_ex (zend_vm_execute.h:59747)
==6458==    by 0x136C9B8: zend_execute (zend_vm_execute.h:63776)
==6458== 
==6458== Invalid read of size 1
==6458==    at 0x100FDC6: _php_stream_free (streams.c:389)
==6458==    by 0x80AD83: ftp_close (ftp.c:171)
==6458==    by 0x805067: ftp_destructor_ftpbuf (php_ftp.c:317)
==6458==    by 0x11331C4: zend_resource_dtor (zend_list.c:76)
==6458==    by 0x1133BE9: zend_close_rsrc (zend_list.c:230)
==6458==    by 0x1128C31: zend_hash_reverse_apply (zend_hash.c:1597)
==6458==    by 0x1133C35: zend_close_rsrc_list (zend_list.c:238)
==6458==    by 0x10BB4F3: shutdown_executor (zend_execute_API.c:263)
==6458==    by 0x10EF242: zend_deactivate (zend.c:1036)
==6458==    by 0xFDFCFB: php_request_shutdown (main.c:1904)
==6458==    by 0x13739C8: do_cli (php_cli.c:1178)
==6458==    by 0x13742FD: main (php_cli.c:1404)
==6458==  Address 0x159b1af0 is 96 bytes inside a block of size 224 free'd
==6458==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==6458==    by 0x1084671: _efree (zend_alloc.c:2444)
==6458==    by 0x1010591: _php_stream_free (streams.c:511)
==6458==    by 0x10149A1: stream_resource_regular_dtor (streams.c:1591)
==6458==    by 0x11331C4: zend_resource_dtor (zend_list.c:76)
==6458==    by 0x1133BE9: zend_close_rsrc (zend_list.c:230)
==6458==    by 0x1128C31: zend_hash_reverse_apply (zend_hash.c:1597)
==6458==    by 0x1133C35: zend_close_rsrc_list (zend_list.c:238)
==6458==    by 0x10BB4F3: shutdown_executor (zend_execute_API.c:263)
==6458==    by 0x10EF242: zend_deactivate (zend.c:1036)
==6458==    by 0xFDFCFB: php_request_shutdown (main.c:1904)
==6458==    by 0x13739C8: do_cli (php_cli.c:1178)
==6458==  Block was alloc'd at
==6458==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==6458==    by 0x1085BD7: __zend_malloc (zend_alloc.c:2829)
==6458==    by 0x1080399: _emalloc_224 (zend_alloc.c:2352)
==6458==    by 0x100F9AB: _php_stream_alloc (streams.c:274)
==6458==    by 0x101DB51: _php_stream_fopen_from_fd_int (plain_wrapper.c:186)
==6458==    by 0x101DE8F: _php_stream_fopen_from_fd (plain_wrapper.c:248)
==6458==    by 0x1020014: _php_stream_fopen (plain_wrapper.c:1024)
==6458==    by 0x102054F: php_plain_files_stream_opener (plain_wrapper.c:1080)
==6458==    by 0x1016CEB: _php_stream_open_wrapper_ex (streams.c:2027)
==6458==    by 0x808197: zif_ftp_nb_get (php_ftp.c:1042)
==6458==    by 0x1344F0E: ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:573)
==6458==    by 0x1344F0E: execute_ex (zend_vm_execute.h:59747)
==6458==    by 0x136C9B8: zend_execute (zend_vm_execute.h:63776)
==6458== 
==6458== Invalid read of size 1
==6458==    at 0x100FDD9: _php_stream_free (streams.c:391)
==6458==    by 0x80AD83: ftp_close (ftp.c:171)
==6458==    by 0x805067: ftp_destructor_ftpbuf (php_ftp.c:317)
==6458==    by 0x11331C4: zend_resource_dtor (zend_list.c:76)
==6458==    by 0x1133BE9: zend_close_rsrc (zend_list.c:230)
==6458==    by 0x1128C31: zend_hash_reverse_apply (zend_hash.c:1597)
==6458==    by 0x1133C35: zend_close_rsrc_list (zend_list.c:238)
==6458==    by 0x10BB4F3: shutdown_executor (zend_execute_API.c:263)
==6458==    by 0x10EF242: zend_deactivate (zend.c:1036)
==6458==    by 0xFDFCFB: php_request_shutdown (main.c:1904)
==6458==    by 0x13739C8: do_cli (php_cli.c:1178)
==6458==    by 0x13742FD: main (php_cli.c:1404)
==6458==  Address 0x159b1af0 is 96 bytes inside a block of size 224 free'd
==6458==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==6458==    by 0x1084671: _efree (zend_alloc.c:2444)
==6458==    by 0x1010591: _php_stream_free (streams.c:511)
==6458==    by 0x10149A1: stream_resource_regular_dtor (streams.c:1591)
==6458==    by 0x11331C4: zend_resource_dtor (zend_list.c:76)
==6458==    by 0x1133BE9: zend_close_rsrc (zend_list.c:230)
==6458==    by 0x1128C31: zend_hash_reverse_apply (zend_hash.c:1597)
==6458==    by 0x1133C35: zend_close_rsrc_list (zend_list.c:238)
==6458==    by 0x10BB4F3: shutdown_executor (zend_execute_API.c:263)
==6458==    by 0x10EF242: zend_deactivate (zend.c:1036)
==6458==    by 0xFDFCFB: php_request_shutdown (main.c:1904)
==6458==    by 0x13739C8: do_cli (php_cli.c:1178)
==6458==  Block was alloc'd at
==6458==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==6458==    by 0x1085BD7: __zend_malloc (zend_alloc.c:2829)
==6458==    by 0x1080399: _emalloc_224 (zend_alloc.c:2352)
==6458==    by 0x100F9AB: _php_stream_alloc (streams.c:274)
==6458==    by 0x101DB51: _php_stream_fopen_from_fd_int (plain_wrapper.c:186)
==6458==    by 0x101DE8F: _php_stream_fopen_from_fd (plain_wrapper.c:248)
==6458==    by 0x1020014: _php_stream_fopen (plain_wrapper.c:1024)
==6458==    by 0x102054F: php_plain_files_stream_opener (plain_wrapper.c:1080)
==6458==    by 0x1016CEB: _php_stream_open_wrapper_ex (streams.c:2027)
==6458==    by 0x808197: zif_ftp_nb_get (php_ftp.c:1042)
==6458==    by 0x1344F0E: ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:573)
==6458==    by 0x1344F0E: execute_ex (zend_vm_execute.h:59747)
==6458==    by 0x136C9B8: zend_execute (zend_vm_execute.h:63776)
==6458== 

 

Generated at Thu, 12 Jul 2018 17:17:45 +0000 (7 days ago)

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