PHP  
 PHP_HEAD
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

==13302== Invalid read of size 8
==13302==    at 0x1067D12: _php_stream_free (streams.c:368)
==13302==    by 0x84210D: ftp_close (ftp.c:171)
==13302==    by 0x83C387: ftp_destructor_ftpbuf (php_ftp.c:317)
==13302==    by 0x1186930: zend_resource_dtor (zend_list.c:76)
==13302==    by 0x1187357: zend_close_rsrc (zend_list.c:230)
==13302==    by 0x117C089: zend_hash_reverse_apply (zend_hash.c:1752)
==13302==    by 0x11873A3: zend_close_rsrc_list (zend_list.c:238)
==13302==    by 0x1114C61: shutdown_executor (zend_execute_API.c:263)
==13302==    by 0x1146E95: zend_deactivate (zend.c:1106)
==13302==    by 0x1035097: php_request_shutdown (main.c:1904)
==13302==    by 0x13986D9: do_cli (php_cli.c:1169)
==13302==    by 0x139900E: main (php_cli.c:1395)
==13302==  Address 0x15861bf0 is 144 bytes inside a block of size 224 free'd
==13302==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==13302==    by 0x10D9476: _efree (zend_alloc.c:2506)
==13302==    by 0x1068552: _php_stream_free (streams.c:506)
==13302==    by 0x106CB1A: stream_resource_regular_dtor (streams.c:1588)
==13302==    by 0x1186930: zend_resource_dtor (zend_list.c:76)
==13302==    by 0x1187357: zend_close_rsrc (zend_list.c:230)
==13302==    by 0x117C089: zend_hash_reverse_apply (zend_hash.c:1752)
==13302==    by 0x11873A3: zend_close_rsrc_list (zend_list.c:238)
==13302==    by 0x1114C61: shutdown_executor (zend_execute_API.c:263)
==13302==    by 0x1146E95: zend_deactivate (zend.c:1106)
==13302==    by 0x1035097: php_request_shutdown (main.c:1904)
==13302==    by 0x13986D9: do_cli (php_cli.c:1169)
==13302==  Block was alloc'd at
==13302==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==13302==    by 0x10DD159: __zend_malloc (zend_alloc.c:2898)
==13302==    by 0x10D521C: _emalloc_224 (zend_alloc.c:2419)
==13302==    by 0x10679D9: _php_stream_alloc (streams.c:274)
==13302==    by 0x1076386: _php_stream_fopen_from_fd_int (plain_wrapper.c:186)
==13302==    by 0x10766C4: _php_stream_fopen_from_fd (plain_wrapper.c:248)
==13302==    by 0x10788D9: _php_stream_fopen (plain_wrapper.c:1047)
==13302==    by 0x1078EDF: php_plain_files_stream_opener (plain_wrapper.c:1103)
==13302==    by 0x106EEE0: _php_stream_open_wrapper_ex (streams.c:2026)
==13302==    by 0x83F4F9: zif_ftp_nb_get (php_ftp.c:1042)
==13302==    by 0x1369B0F: ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:645)
==13302==    by 0x1369B0F: execute_ex (zend_vm_execute.h:54922)
==13302==    by 0x1391814: zend_execute (zend_vm_execute.h:60358)
==13302== 
==13302== Invalid read of size 4
==13302==    at 0x1067D60: _php_stream_free (streams.c:371)
==13302==    by 0x84210D: ftp_close (ftp.c:171)
==13302==    by 0x83C387: ftp_destructor_ftpbuf (php_ftp.c:317)
==13302==    by 0x1186930: zend_resource_dtor (zend_list.c:76)
==13302==    by 0x1187357: zend_close_rsrc (zend_list.c:230)
==13302==    by 0x117C089: zend_hash_reverse_apply (zend_hash.c:1752)
==13302==    by 0x11873A3: zend_close_rsrc_list (zend_list.c:238)
==13302==    by 0x1114C61: shutdown_executor (zend_execute_API.c:263)
==13302==    by 0x1146E95: zend_deactivate (zend.c:1106)
==13302==    by 0x1035097: php_request_shutdown (main.c:1904)
==13302==    by 0x13986D9: do_cli (php_cli.c:1169)
==13302==    by 0x139900E: main (php_cli.c:1395)
==13302==  Address 0x15861bd4 is 116 bytes inside a block of size 224 free'd
==13302==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==13302==    by 0x10D9476: _efree (zend_alloc.c:2506)
==13302==    by 0x1068552: _php_stream_free (streams.c:506)
==13302==    by 0x106CB1A: stream_resource_regular_dtor (streams.c:1588)
==13302==    by 0x1186930: zend_resource_dtor (zend_list.c:76)
==13302==    by 0x1187357: zend_close_rsrc (zend_list.c:230)
==13302==    by 0x117C089: zend_hash_reverse_apply (zend_hash.c:1752)
==13302==    by 0x11873A3: zend_close_rsrc_list (zend_list.c:238)
==13302==    by 0x1114C61: shutdown_executor (zend_execute_API.c:263)
==13302==    by 0x1146E95: zend_deactivate (zend.c:1106)
==13302==    by 0x1035097: php_request_shutdown (main.c:1904)
==13302==    by 0x13986D9: do_cli (php_cli.c:1169)
==13302==  Block was alloc'd at
==13302==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==13302==    by 0x10DD159: __zend_malloc (zend_alloc.c:2898)
==13302==    by 0x10D521C: _emalloc_224 (zend_alloc.c:2419)
==13302==    by 0x10679D9: _php_stream_alloc (streams.c:274)
==13302==    by 0x1076386: _php_stream_fopen_from_fd_int (plain_wrapper.c:186)
==13302==    by 0x10766C4: _php_stream_fopen_from_fd (plain_wrapper.c:248)
==13302==    by 0x10788D9: _php_stream_fopen (plain_wrapper.c:1047)
==13302==    by 0x1078EDF: php_plain_files_stream_opener (plain_wrapper.c:1103)
==13302==    by 0x106EEE0: _php_stream_open_wrapper_ex (streams.c:2026)
==13302==    by 0x83F4F9: zif_ftp_nb_get (php_ftp.c:1042)
==13302==    by 0x1369B0F: ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:645)
==13302==    by 0x1369B0F: execute_ex (zend_vm_execute.h:54922)
==13302==    by 0x1391814: zend_execute (zend_vm_execute.h:60358)
==13302== 
==13302== Invalid read of size 1
==13302==    at 0x1067D87: _php_stream_free (streams.c:384)
==13302==    by 0x84210D: ftp_close (ftp.c:171)
==13302==    by 0x83C387: ftp_destructor_ftpbuf (php_ftp.c:317)
==13302==    by 0x1186930: zend_resource_dtor (zend_list.c:76)
==13302==    by 0x1187357: zend_close_rsrc (zend_list.c:230)
==13302==    by 0x117C089: zend_hash_reverse_apply (zend_hash.c:1752)
==13302==    by 0x11873A3: zend_close_rsrc_list (zend_list.c:238)
==13302==    by 0x1114C61: shutdown_executor (zend_execute_API.c:263)
==13302==    by 0x1146E95: zend_deactivate (zend.c:1106)
==13302==    by 0x1035097: php_request_shutdown (main.c:1904)
==13302==    by 0x13986D9: do_cli (php_cli.c:1169)
==13302==    by 0x139900E: main (php_cli.c:1395)
==13302==  Address 0x15861bc0 is 96 bytes inside a block of size 224 free'd
==13302==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==13302==    by 0x10D9476: _efree (zend_alloc.c:2506)
==13302==    by 0x1068552: _php_stream_free (streams.c:506)
==13302==    by 0x106CB1A: stream_resource_regular_dtor (streams.c:1588)
==13302==    by 0x1186930: zend_resource_dtor (zend_list.c:76)
==13302==    by 0x1187357: zend_close_rsrc (zend_list.c:230)
==13302==    by 0x117C089: zend_hash_reverse_apply (zend_hash.c:1752)
==13302==    by 0x11873A3: zend_close_rsrc_list (zend_list.c:238)
==13302==    by 0x1114C61: shutdown_executor (zend_execute_API.c:263)
==13302==    by 0x1146E95: zend_deactivate (zend.c:1106)
==13302==    by 0x1035097: php_request_shutdown (main.c:1904)
==13302==    by 0x13986D9: do_cli (php_cli.c:1169)
==13302==  Block was alloc'd at
==13302==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==13302==    by 0x10DD159: __zend_malloc (zend_alloc.c:2898)
==13302==    by 0x10D521C: _emalloc_224 (zend_alloc.c:2419)
==13302==    by 0x10679D9: _php_stream_alloc (streams.c:274)
==13302==    by 0x1076386: _php_stream_fopen_from_fd_int (plain_wrapper.c:186)
==13302==    by 0x10766C4: _php_stream_fopen_from_fd (plain_wrapper.c:248)
==13302==    by 0x10788D9: _php_stream_fopen (plain_wrapper.c:1047)
==13302==    by 0x1078EDF: php_plain_files_stream_opener (plain_wrapper.c:1103)
==13302==    by 0x106EEE0: _php_stream_open_wrapper_ex (streams.c:2026)
==13302==    by 0x83F4F9: zif_ftp_nb_get (php_ftp.c:1042)
==13302==    by 0x1369B0F: ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:645)
==13302==    by 0x1369B0F: execute_ex (zend_vm_execute.h:54922)
==13302==    by 0x1391814: zend_execute (zend_vm_execute.h:60358)
==13302== 
==13302== Invalid read of size 1
==13302==    at 0x1067D9A: _php_stream_free (streams.c:386)
==13302==    by 0x84210D: ftp_close (ftp.c:171)
==13302==    by 0x83C387: ftp_destructor_ftpbuf (php_ftp.c:317)
==13302==    by 0x1186930: zend_resource_dtor (zend_list.c:76)
==13302==    by 0x1187357: zend_close_rsrc (zend_list.c:230)
==13302==    by 0x117C089: zend_hash_reverse_apply (zend_hash.c:1752)
==13302==    by 0x11873A3: zend_close_rsrc_list (zend_list.c:238)
==13302==    by 0x1114C61: shutdown_executor (zend_execute_API.c:263)
==13302==    by 0x1146E95: zend_deactivate (zend.c:1106)
==13302==    by 0x1035097: php_request_shutdown (main.c:1904)
==13302==    by 0x13986D9: do_cli (php_cli.c:1169)
==13302==    by 0x139900E: main (php_cli.c:1395)
==13302==  Address 0x15861bc0 is 96 bytes inside a block of size 224 free'd
==13302==    at 0x4C28BD4: free (vg_replace_malloc.c:529)
==13302==    by 0x10D9476: _efree (zend_alloc.c:2506)
==13302==    by 0x1068552: _php_stream_free (streams.c:506)
==13302==    by 0x106CB1A: stream_resource_regular_dtor (streams.c:1588)
==13302==    by 0x1186930: zend_resource_dtor (zend_list.c:76)
==13302==    by 0x1187357: zend_close_rsrc (zend_list.c:230)
==13302==    by 0x117C089: zend_hash_reverse_apply (zend_hash.c:1752)
==13302==    by 0x11873A3: zend_close_rsrc_list (zend_list.c:238)
==13302==    by 0x1114C61: shutdown_executor (zend_execute_API.c:263)
==13302==    by 0x1146E95: zend_deactivate (zend.c:1106)
==13302==    by 0x1035097: php_request_shutdown (main.c:1904)
==13302==    by 0x13986D9: do_cli (php_cli.c:1169)
==13302==  Block was alloc'd at
==13302==    at 0x4C291FA: malloc (vg_replace_malloc.c:298)
==13302==    by 0x10DD159: __zend_malloc (zend_alloc.c:2898)
==13302==    by 0x10D521C: _emalloc_224 (zend_alloc.c:2419)
==13302==    by 0x10679D9: _php_stream_alloc (streams.c:274)
==13302==    by 0x1076386: _php_stream_fopen_from_fd_int (plain_wrapper.c:186)
==13302==    by 0x10766C4: _php_stream_fopen_from_fd (plain_wrapper.c:248)
==13302==    by 0x10788D9: _php_stream_fopen (plain_wrapper.c:1047)
==13302==    by 0x1078EDF: php_plain_files_stream_opener (plain_wrapper.c:1103)
==13302==    by 0x106EEE0: _php_stream_open_wrapper_ex (streams.c:2026)
==13302==    by 0x83F4F9: zif_ftp_nb_get (php_ftp.c:1042)
==13302==    by 0x1369B0F: ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:645)
==13302==    by 0x1369B0F: execute_ex (zend_vm_execute.h:54922)
==13302==    by 0x1391814: zend_execute (zend_vm_execute.h:60358)
==13302== 

 

Generated at Thu, 19 Jul 2018 09:51:32 +0000 (2 days ago)

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