Bug #75452 [NEW]: ftp_nb_get_large.phpt generates valgrind warnings
| From: | nikic@php.net | Date: | Sat, 28 Oct 2017 14:28:54 +0000 |
| Subject: | Bug #75452 [NEW]: ftp_nb_get_large.phpt generates valgrind warnings | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-212349@lists.php.net to get a copy of this message | ||
From: nikic
Operating system:
PHP version: 7.2.0RC5
Package: FTP related
Bug Type: Bug
Bug description:ftp_nb_get_large.phpt generates valgrind warnings
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)
--
Edit bug report at https://bugs.php.net/bug.php?id=75452&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75452&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75452&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75452&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=75452&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=75452&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=75452&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=75452&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=75452&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=75452&r=support
Expected behavior: https://bugs.php.net/fix.php?id=75452&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=75452&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=75452&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=75452&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75452&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=75452&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=75452&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=75452&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=75452&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=75452&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=75452&r=mysqlcfg