php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75452 ftp_nb_get_large.phpt generates valgrind warnings
Submitted: 2017-10-28 14:28 UTC Modified: 2021-02-19 15:04 UTC
From: nikic@php.net Assigned: cmb (profile)
Status: Closed Package: FTP related
PHP Version: 7.2.0RC5 OS:
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nikic@php.net
New email:
PHP Version: OS:

 

 [2017-10-28 14:28 UTC] nikic@php.net
Description:
------------
This problem did not exist in PHP 7.1.

==21348== Invalid read of size 8
==21348==    at 0x99B7EB: _php_stream_free (streams.c:372)
==21348==    by 0x66F4FF: ftp_close (ftp.c:171)
==21348==    by 0x66B922: ftp_destructor_ftpbuf (php_ftp.c:317)
==21348==    by 0xA5D26F: zend_resource_dtor (zend_list.c:76)
==21348==    by 0xA5D88E: zend_close_rsrc (zend_list.c:230)
==21348==    by 0xA5A215: zend_hash_reverse_apply (zend_hash.c:1597)
==21348==    by 0xA5D8B4: zend_close_rsrc_list (zend_list.c:238)
==21348==    by 0xA2051B: shutdown_executor (zend_execute_API.c:262)
==21348==    by 0xA3F10F: zend_deactivate (zend.c:1036)
==21348==    by 0x975F0D: php_request_shutdown (main.c:1904)
==21348==    by 0xB45F99: do_cli (php_cli.c:1178)
==21348==    by 0xB46940: main (php_cli.c:1404)
==21348==  Address 0x92d59e0 is 144 bytes inside a block of size 224 free'd
==21348==    at 0x4C2EDEB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==21348==    by 0x9FA9B5: _efree (zend_alloc.c:2444)
==21348==    by 0x99BD03: _php_stream_free (streams.c:510)
==21348==    by 0x99E67F: stream_resource_regular_dtor (streams.c:1588)
==21348==    by 0xA5D26F: zend_resource_dtor (zend_list.c:76)
==21348==    by 0xA5D88E: zend_close_rsrc (zend_list.c:230)
==21348==    by 0xA5A215: zend_hash_reverse_apply (zend_hash.c:1597)
==21348==    by 0xA5D8B4: zend_close_rsrc_list (zend_list.c:238)
==21348==    by 0xA2051B: shutdown_executor (zend_execute_API.c:262)
==21348==    by 0xA3F10F: zend_deactivate (zend.c:1036)
==21348==    by 0x975F0D: php_request_shutdown (main.c:1904)
==21348==    by 0xB45F99: do_cli (php_cli.c:1178)
==21348==  Block was alloc'd at
==21348==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==21348==    by 0x9FBA4C: __zend_malloc (zend_alloc.c:2829)
==21348==    by 0x9FA83A: _emalloc (zend_alloc.c:2429)
==21348==    by 0x99B42E: _php_stream_alloc (streams.c:273)
==21348==    by 0x9A531E: _php_stream_fopen_from_fd_int (plain_wrapper.c:186)
==21348==    by 0x9A5691: _php_stream_fopen_from_fd (plain_wrapper.c:248)
==21348==    by 0x9A6CBB: _php_stream_fopen (plain_wrapper.c:1024)
==21348==    by 0x9A6F10: php_plain_files_stream_opener (plain_wrapper.c:1080)
==21348==    by 0x9A00BE: _php_stream_open_wrapper_ex (streams.c:2024)
==21348==    by 0x66D75E: zif_ftp_nb_get (php_ftp.c:1042)
==21348==    by 0xAAEA62: ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:573)
==21348==    by 0xB3D1B4: execute_ex (zend_vm_execute.h:59734)
==21348== 
==21348== Invalid read of size 4
==21348==    at 0x99B815: _php_stream_free (streams.c:375)
==21348==    by 0x66F4FF: ftp_close (ftp.c:171)
==21348==    by 0x66B922: ftp_destructor_ftpbuf (php_ftp.c:317)
==21348==    by 0xA5D26F: zend_resource_dtor (zend_list.c:76)
==21348==    by 0xA5D88E: zend_close_rsrc (zend_list.c:230)
==21348==    by 0xA5A215: zend_hash_reverse_apply (zend_hash.c:1597)
==21348==    by 0xA5D8B4: zend_close_rsrc_list (zend_list.c:238)
==21348==    by 0xA2051B: shutdown_executor (zend_execute_API.c:262)
==21348==    by 0xA3F10F: zend_deactivate (zend.c:1036)
==21348==    by 0x975F0D: php_request_shutdown (main.c:1904)
==21348==    by 0xB45F99: do_cli (php_cli.c:1178)
==21348==    by 0xB46940: main (php_cli.c:1404)
==21348==  Address 0x92d59c4 is 116 bytes inside a block of size 224 free'd
==21348==    at 0x4C2EDEB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==21348==    by 0x9FA9B5: _efree (zend_alloc.c:2444)
==21348==    by 0x99BD03: _php_stream_free (streams.c:510)
==21348==    by 0x99E67F: stream_resource_regular_dtor (streams.c:1588)
==21348==    by 0xA5D26F: zend_resource_dtor (zend_list.c:76)
==21348==    by 0xA5D88E: zend_close_rsrc (zend_list.c:230)
==21348==    by 0xA5A215: zend_hash_reverse_apply (zend_hash.c:1597)
==21348==    by 0xA5D8B4: zend_close_rsrc_list (zend_list.c:238)
==21348==    by 0xA2051B: shutdown_executor (zend_execute_API.c:262)
==21348==    by 0xA3F10F: zend_deactivate (zend.c:1036)
==21348==    by 0x975F0D: php_request_shutdown (main.c:1904)
==21348==    by 0xB45F99: do_cli (php_cli.c:1178)
==21348==  Block was alloc'd at
==21348==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==21348==    by 0x9FBA4C: __zend_malloc (zend_alloc.c:2829)
==21348==    by 0x9FA83A: _emalloc (zend_alloc.c:2429)
==21348==    by 0x99B42E: _php_stream_alloc (streams.c:273)
==21348==    by 0x9A531E: _php_stream_fopen_from_fd_int (plain_wrapper.c:186)
==21348==    by 0x9A5691: _php_stream_fopen_from_fd (plain_wrapper.c:248)
==21348==    by 0x9A6CBB: _php_stream_fopen (plain_wrapper.c:1024)
==21348==    by 0x9A6F10: php_plain_files_stream_opener (plain_wrapper.c:1080)
==21348==    by 0x9A00BE: _php_stream_open_wrapper_ex (streams.c:2024)
==21348==    by 0x66D75E: zif_ftp_nb_get (php_ftp.c:1042)
==21348==    by 0xAAEA62: ZEND_DO_ICALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:573)
==21348==    by 0xB3D1B4: execute_ex (zend_vm_execute.h:59734)



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-29 17:10 UTC] yuliakostrikova at gmail dot com
How to reproduce it?
 [2021-02-19 15:02 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-02-19 15:02 UTC] cmb@php.net
I cannot reproduce this with PHP-7.4.  Has this been resolved in
the meantime?
 [2021-02-19 15:04 UTC] nikic@php.net
-Status: Feedback +Status: Closed
 [2021-02-19 15:04 UTC] nikic@php.net
Yeah, this has been fixed at some point...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 06 23:01:26 2024 UTC