Bug #76510 [Com]: file_exists() stopped working for phar:// in PHP 7.3

From: Date: Wed, 29 Aug 2018 18:15:09 +0000
Subject: Bug #76510 [Com]: file_exists() stopped working for phar:// in PHP 7.3
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216785@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76510&edit=1 ID: 76510 Comment by: bugs dot php dot net at majkl578 dot cz Reported by: sebastian@php.net Summary: file_exists() stopped working for phar:// in PHP 7.3 Status: Open Type: Bug Package: PHAR related Operating System: Linux PHP Version: 7.3Git-2018-06-21 (Git) Block user comment: N Private report: N New Comment: Any update on this one? It also breaks Composer and other PHAR-distributed tools (i.e. PHPStan, Infection). Previous Comments: ------------------------------------------------------------------------ [2018-08-07 14:38:25] cmb@php.net Thanks, Sebastian! I did run valgrind on a build (master@8c76dc3) where the test succeeds, and get a long list of errors[1]. My configure line: ./configure --disable-all --disable-cgi --disable-phpdbg --enable-phar --enable-json --enable-filter --with-iconv --with-openssl --enable-hash --enable-libxml --enable-dom --enable-xml --enable-xmlwriter --enable-mbstring --enable-pdo --enable-tokenizer --enable-zip --without-libzip [1] <https://gist.github.com/cmb69/c7d78afcbc22274cf6bd1ba64100c4f2> ------------------------------------------------------------------------ [2018-08-06 19:01:33] sebastian@php.net $ USE_ZEND_ALLOC=0 valgrind --tool=memcheck --num-callers=30 --log-file=/tmp/valgrind.txt --track-origins=yes /usr/local/php-7.3/bin/php ../../../phpunit ==20559== Memcheck, a memory error detector ==20559== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==20559== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info ==20559== Command: /usr/local/php-7.3/bin/php ../../../phpunit ==20559== Parent PID: 19979 ==20559== ==20559== Conditional jump or move depends on uninitialised value(s) ==20559== at 0x4072122: ??? ==20559== by 0x1BEB2687: ??? ==20559== by 0x1BEB2687: ??? ==20559== by 0x1BEB26AC: ??? ==20559== by 0xEB577AF: ??? ==20559== by 0x1BEB2687: ??? ==20559== Uninitialised value was created by a heap allocation ==20559== at 0x4C2EBAB: malloc (vg_replace_malloc.c:299) ==20559== by 0x82D278: __zend_malloc (zend_alloc.c:2896) ==20559== by 0x7B0AC6: zend_string_alloc (zend_string.h:133) ==20559== by 0x7B0AC6: php_str_to_str_ex (string.c:3266) ==20559== by 0x7B6629: php_str_replace_in_subject.isra.4 (string.c:4409) ==20559== by 0x7B6D6E: php_str_replace_common (string.c:4478) ==20559== by 0x8D0007: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:690) ==20559== by 0x8D0007: execute_ex (zend_vm_execute.h:55462) ==20559== by 0x8466F5: zend_call_function (zend_execute_API.c:756) ==20559== by 0x86DCBC: zend_call_method (zend_interfaces.c:103) ==20559== by 0x7549D1: spl_filter_it_fetch (spl_iterators.c:1833) ==20559== by 0x7549D1: spl_filter_it_rewind (spl_iterators.c:1852) ==20559== by 0x7549D1: zim_spl_FilterIterator_rewind (spl_iterators.c:1872) ==20559== by 0x8465B1: zend_call_function (zend_execute_API.c:770) ==20559== by 0x86DCBC: zend_call_method (zend_interfaces.c:103) ==20559== by 0x86E1AA: zend_user_it_rewind (zend_interfaces.c:224) ==20559== by 0x755CD6: spl_dual_it_rewind (spl_iterators.c:1671) ==20559== by 0x755CD6: spl_append_it_next_iterator (spl_iterators.c:3319) ==20559== by 0x75606F: zim_spl_AppendIterator_append (spl_iterators.c:3376) ==20559== by 0x8D5667: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:980) ==20559== by 0x8D5667: execute_ex (zend_vm_execute.h:55482) ==20559== by 0x8D5F41: zend_execute (zend_vm_execute.h:60882) ==20559== by 0x853963: zend_execute_scripts (zend.c:1562) ==20559== by 0x7F89FF: php_execute_script (main.c:2630) ==20559== by 0x8D83A5: do_cli (php_cli.c:997) ==20559== by 0x47AB55: main (php_cli.c:1390) ==20559== ==20559== Conditional jump or move depends on uninitialised value(s) ==20559== at 0x4072122: ??? ==20559== by 0x1BEB6A57: ??? ==20559== by 0x1BEB6A57: ??? ==20559== by 0x1BEB6A7C: ??? ==20559== by 0xEB577AF: ??? ==20559== by 0x1BEB6A57: ??? ==20559== Uninitialised value was created by a heap allocation ==20559== at 0x4C2EBAB: malloc (vg_replace_malloc.c:299) ==20559== by 0x82D278: __zend_malloc (zend_alloc.c:2896) ==20559== by 0x7B0AC6: zend_string_alloc (zend_string.h:133) ==20559== by 0x7B0AC6: php_str_to_str_ex (string.c:3266) ==20559== by 0x7B6629: php_str_replace_in_subject.isra.4 (string.c:4409) ==20559== by 0x7B6D6E: php_str_replace_common (string.c:4478) ==20559== by 0x8D0007: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:690) ==20559== by 0x8D0007: execute_ex (zend_vm_execute.h:55462) ==20559== by 0x8466F5: zend_call_function (zend_execute_API.c:756) ==20559== by 0x86DCBC: zend_call_method (zend_interfaces.c:103) ==20559== by 0x7549D1: spl_filter_it_fetch (spl_iterators.c:1833) ==20559== by 0x7549D1: spl_filter_it_rewind (spl_iterators.c:1852) ==20559== by 0x7549D1: zim_spl_FilterIterator_rewind (spl_iterators.c:1872) ==20559== by 0x8465B1: zend_call_function (zend_execute_API.c:770) ==20559== by 0x86DCBC: zend_call_method (zend_interfaces.c:103) ==20559== by 0x86E1AA: zend_user_it_rewind (zend_interfaces.c:224) ==20559== by 0x755CD6: spl_dual_it_rewind (spl_iterators.c:1671) ==20559== by 0x755CD6: spl_append_it_next_iterator (spl_iterators.c:3319) ==20559== by 0x7560ED: zim_spl_AppendIterator_rewind (spl_iterators.c:3417) ==20559== by 0x8465B1: zend_call_function (zend_execute_API.c:770) ==20559== by 0x86DCBC: zend_call_method (zend_interfaces.c:103) ==20559== by 0x86E1AA: zend_user_it_rewind (zend_interfaces.c:224) ==20559== by 0x8902E1: zend_fe_reset_iterator (zend_execute.c:3256) ==20559== by 0x8B4D72: ZEND_FE_RESET_R_SPEC_CV_HANDLER (zend_vm_execute.h:37768) ==20559== by 0x8CD993: execute_ex (zend_vm_execute.h:59386) ==20559== by 0x8D5F41: zend_execute (zend_vm_execute.h:60882) ==20559== by 0x853963: zend_execute_scripts (zend.c:1562) ==20559== by 0x7F89FF: php_execute_script (main.c:2630) ==20559== by 0x8D83A5: do_cli (php_cli.c:997) ==20559== by 0x47AB55: main (php_cli.c:1390) ==20559== ==20559== Conditional jump or move depends on uninitialised value(s) ==20559== at 0x4072122: ??? ==20559== by 0x1BF75907: ??? ==20559== by 0x1BF75907: ??? ==20559== by 0x1BF75913: ??? ==20559== by 0xEB577AF: ??? ==20559== by 0x1BF75907: ??? ==20559== Uninitialised value was created by a heap allocation ==20559== at 0x4C2EBAB: malloc (vg_replace_malloc.c:299) ==20559== by 0x82D278: __zend_malloc (zend_alloc.c:2896) ==20559== by 0x7B0AC6: zend_string_alloc (zend_string.h:133) ==20559== by 0x7B0AC6: php_str_to_str_ex (string.c:3266) ==20559== by 0x7B6629: php_str_replace_in_subject.isra.4 (string.c:4409) ==20559== by 0x7B6D6E: php_str_replace_common (string.c:4478) ==20559== by 0x8D0007: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:690) ==20559== by 0x8D0007: execute_ex (zend_vm_execute.h:55462) ==20559== by 0x8466F5: zend_call_function (zend_execute_API.c:756) ==20559== by 0x86DCBC: zend_call_method (zend_interfaces.c:103) ==20559== by 0x7549D1: spl_filter_it_fetch (spl_iterators.c:1833) ==20559== by 0x7549D1: spl_filter_it_rewind (spl_iterators.c:1852) ==20559== by 0x7549D1: zim_spl_FilterIterator_rewind (spl_iterators.c:1872) ==20559== by 0x8465B1: zend_call_function (zend_execute_API.c:770) ==20559== by 0x86DCBC: zend_call_method (zend_interfaces.c:103) ==20559== by 0x86E1AA: zend_user_it_rewind (zend_interfaces.c:224) ==20559== by 0x755CD6: spl_dual_it_rewind (spl_iterators.c:1671) ==20559== by 0x755CD6: spl_append_it_next_iterator (spl_iterators.c:3319) ==20559== by 0x75606F: zim_spl_AppendIterator_append (spl_iterators.c:3376) ==20559== by 0x8D5667: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:980) ==20559== by 0x8D5667: execute_ex (zend_vm_execute.h:55482) ==20559== by 0x8D5F41: zend_execute (zend_vm_execute.h:60882) ==20559== by 0x853963: zend_execute_scripts (zend.c:1562) ==20559== by 0x7F89FF: php_execute_script (main.c:2630) ==20559== by 0x8D83A5: do_cli (php_cli.c:997) ==20559== by 0x47AB55: main (php_cli.c:1390) ==20559== ==20559== Conditional jump or move depends on uninitialised value(s) ==20559== at 0x4072122: ??? ==20559== by 0x1BF77587: ??? ==20559== by 0x1BF77587: ??? ==20559== by 0x1BF77593: ??? ==20559== by 0xEB577AF: ??? ==20559== by 0x1BF77587: ??? ==20559== Uninitialised value was created by a heap allocation ==20559== at 0x4C2EBAB: malloc (vg_replace_malloc.c:299) ==20559== by 0x82D278: __zend_malloc (zend_alloc.c:2896) ==20559== by 0x7B0AC6: zend_string_alloc (zend_string.h:133) ==20559== by 0x7B0AC6: php_str_to_str_ex (string.c:3266) ==20559== by 0x7B6629: php_str_replace_in_subject.isra.4 (string.c:4409) ==20559== by 0x7B6D6E: php_str_replace_common (string.c:4478) ==20559== by 0x8D0007: ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER (zend_vm_execute.h:690) ==20559== by 0x8D0007: execute_ex (zend_vm_execute.h:55462) ==20559== by 0x8466F5: zend_call_function (zend_execute_API.c:756) ==20559== by 0x86DCBC: zend_call_method (zend_interfaces.c:103) ==20559== by 0x7549D1: spl_filter_it_fetch (spl_iterators.c:1833) ==20559== by 0x7549D1: spl_filter_it_rewind (spl_iterators.c:1852) ==20559== by 0x7549D1: zim_spl_FilterIterator_rewind (spl_iterators.c:1872) ==20559== by 0x8465B1: zend_call_function (zend_execute_API.c:770) ==20559== by 0x86DCBC: zend_call_method (zend_interfaces.c:103) ==20559== by 0x86E1AA: zend_user_it_rewind (zend_interfaces.c:224) ==20559== by 0x755CD6: spl_dual_it_rewind (spl_iterators.c:1671) ==20559== by 0x755CD6: spl_append_it_next_iterator (spl_iterators.c:3319) ==20559== by 0x7560ED: zim_spl_AppendIterator_rewind (spl_iterators.c:3417) ==20559== by 0x8465B1: zend_call_function (zend_execute_API.c:770) ==20559== by 0x86DCBC: zend_call_method (zend_interfaces.c:103) ==20559== by 0x86E1AA: zend_user_it_rewind (zend_interfaces.c:224) ==20559== by 0x8902E1: zend_fe_reset_iterator (zend_execute.c:3256) ==20559== by 0x8B4D72: ZEND_FE_RESET_R_SPEC_CV_HANDLER (zend_vm_execute.h:37768) ==20559== by 0x8CD993: execute_ex (zend_vm_execute.h:59386) ==20559== by 0x8D5F41: zend_execute (zend_vm_execute.h:60882) ==20559== by 0x853963: zend_execute_scripts (zend.c:1562) ==20559== by 0x7F89FF: php_execute_script (main.c:2630) ==20559== by 0x8D83A5: do_cli (php_cli.c:997) ==20559== by 0x47AB55: main (php_cli.c:1390) ==20559== ==20559== Invalid read of size 1 ==20559== at 0x848DF7: zend_string_release_ex (zend_string.h:284) ==20559== by 0x848DF7: destroy_zend_class (zend_opcode.c:241) ==20559== by 0x8459F3: shutdown_executor (zend_execute_API.c:345) ==20559== by 0x853677: zend_deactivate (zend.c:1104) ==20559== by 0x7F761A: php_request_shutdown (main.c:1926) ==20559== by 0x8D77D5: do_cli (php_cli.c:1164) ==20559== by 0x47AB55: main (php_cli.c:1390) ==20559== Address 0x1ba482f4 is 4 bytes inside a block of size 56 free'd ==20559== at 0x4C2FDAC: free (vg_replace_malloc.c:530) ==20559== by 0x848E05: zend_string_release_ex (zend_string.h:291) ==20559== by 0x848E05: destroy_zend_class (zend_opcode.c:241) ==20559== by 0x8459F3: shutdown_executor (zend_execute_API.c:345) ==20559== by 0x853677: zend_deactivate (zend.c:1104) ==20559== by 0x7F761A: php_request_shutdown (main.c:1926) ==20559== by 0x8D77D5: do_cli (php_cli.c:1164) ==20559== by 0x47AB55: main (php_cli.c:1390) ==20559== Block was alloc'd at ==20559== at 0x4C2EBAB: malloc (vg_replace_malloc.c:299) ==20559== by 0x82D278: __zend_malloc (zend_alloc.c:2896) ==20559== by 0x822E2A: zend_string_alloc (zend_string.h:133) ==20559== by 0x822E2A: zend_string_init (zend_string.h:155) ==20559== by 0x822E2A: lex_scan (zend_language_scanner.l:2109) ==20559== by 0x836668: zendlex (zend_compile.c:1693) ==20559== by 0x81C3DD: zendparse (zend_language_parser.c:4211) ==20559== by 0x81E7C2: zend_compile (zend_language_scanner.l:586) ==20559== by 0x81FEE1: compile_file (zend_language_scanner.l:636) ==20559== by 0x6E85F1: phar_compile_file (phar.c:3335) ==20559== by 0x81FF68: compile_filename (zend_language_scanner.l:661) ==20559== by 0x893864: zend_include_or_eval (zend_execute.c:3182) ==20559== by 0x8C8AA9: ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER (zend_vm_execute.h:37674) ==20559== by 0x8CD99E: execute_ex (zend_vm_execute.h:59382) ==20559== by 0x8466F5: zend_call_function (zend_execute_API.c:756) ==20559== by 0x74B54D: zif_spl_autoload_call (php_spl.c:448) ==20559== by 0x8465B1: zend_call_function (zend_execute_API.c:770) ==20559== by 0x846A57: zend_lookup_class_ex (zend_execute_API.c:926) ==20559== by 0x847397: zend_fetch_class_by_name (zend_execute_API.c:1361) ==20559== by 0x89BA8A: ZEND_DECLARE_INHERITED_CLASS_SPEC_CONST_CONST_HANDLER (zend_vm_execute.h:5837) ==20559== by 0x8CF616: execute_ex (zend_vm_execute.h:56000) ==20559== by 0x8466F5: zend_call_function (zend_execute_API.c:756) ==20559== by 0x74B54D: zif_spl_autoload_call (php_spl.c:448) ==20559== by 0x8465B1: zend_call_function (zend_execute_API.c:770) ==20559== by 0x846A57: zend_lookup_class_ex (zend_execute_API.c:926) ==20559== by 0x847397: zend_fetch_class_by_name (zend_execute_API.c:1361) ==20559== by 0x89BA8A: ZEND_DECLARE_INHERITED_CLASS_SPEC_CONST_CONST_HANDLER (zend_vm_execute.h:5837) ==20559== by 0x8CF616: execute_ex (zend_vm_execute.h:56000) ==20559== by 0x8D5F41: zend_execute (zend_vm_execute.h:60882) ==20559== by 0x853963: zend_execute_scripts (zend.c:1562) ==20559== by 0x7F89FF: php_execute_script (main.c:2630) ==20559== by 0x8D83A5: do_cli (php_cli.c:997) ==20559== ==20559== Invalid read of size 4 ==20559== at 0x848DFD: zend_gc_delref (zend_types.h:988) ==20559== by 0x848DFD: zend_string_release_ex (zend_string.h:285) ==20559== by 0x848DFD: destroy_zend_class (zend_opcode.c:241) ==20559== by 0x8459F3: shutdown_executor (zend_execute_API.c:345) ==20559== by 0x853677: zend_deactivate (zend.c:1104) ==20559== by 0x7F761A: php_request_shutdown (main.c:1926) ==20559== by 0x8D77D5: do_cli (php_cli.c:1164) ==20559== by 0x47AB55: main (php_cli.c:1390) ==20559== Address 0x1ba482f0 is 0 bytes inside a block of size 56 free'd ==20559== at 0x4C2FDAC: free (vg_replace_malloc.c:530) ==20559== by 0x848E05: zend_string_release_ex (zend_string.h:291) ==20559== by 0x848E05: destroy_zend_class (zend_opcode.c:241) ==20559== by 0x8459F3: shutdown_executor (zend_execute_API.c:345) ==20559== by 0x853677: zend_deactivate (zend.c:1104) ==20559== by 0x7F761A: php_request_shutdown (main.c:1926) ==20559== by 0x8D77D5: do_cli (php_cli.c:1164) ==20559== by 0x47AB55: main (php_cli.c:1390) ==20559== Block was alloc'd at ==20559== at 0x4C2EBAB: malloc (vg_replace_malloc.c:299) ==20559== by 0x82D278: __zend_malloc (zend_alloc.c:2896) ==20559== by 0x822E2A: zend_string_alloc (zend_string.h:133) ==20559== by 0x822E2A: zend_string_init (zend_string.h:155) ==20559== by 0x822E2A: lex_scan (zend_language_scanner.l:2109) ==20559== by 0x836668: zendlex (zend_compile.c:1693) ==20559== by 0x81C3DD: zendparse (zend_language_parser.c:4211) ==20559== by 0x81E7C2: zend_compile (zend_language_scanner.l:586) ==20559== by 0x81FEE1: compile_file (zend_language_scanner.l:636) ==20559== by 0x6E85F1: phar_compile_file (phar.c:3335) ==20559== by 0x81FF68: compile_filename (zend_language_scanner.l:661) ==20559== by 0x893864: zend_include_or_eval (zend_execute.c:3182) ==20559== by 0x8C8AA9: ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER (zend_vm_execute.h:37674) ==20559== by 0x8CD99E: execute_ex (zend_vm_execute.h:59382) ==20559== by 0x8466F5: zend_call_function (zend_execute_API.c:756) ==20559== by 0x74B54D: zif_spl_autoload_call (php_spl.c:448) ==20559== by 0x8465B1: zend_call_function (zend_execute_API.c:770) ==20559== by 0x846A57: zend_lookup_class_ex (zend_execute_API.c:926) ==20559== by 0x847397: zend_fetch_class_by_name (zend_execute_API.c:1361) ==20559== by 0x89BA8A: ZEND_DECLARE_INHERITED_CLASS_SPEC_CONST_CONST_HANDLER (zend_vm_execute.h:5837) ==20559== by 0x8CF616: execute_ex (zend_vm_execute.h:56000) ==20559== by 0x8466F5: zend_call_function (zend_execute_API.c:756) ==20559== by 0x74B54D: zif_spl_autoload_call (php_spl.c:448) ==20559== by 0x8465B1: zend_call_function (zend_execute_API.c:770) ==20559== by 0x846A57: zend_lookup_class_ex (zend_execute_API.c:926) ==20559== by 0x847397: zend_fetch_class_by_name (zend_execute_API.c:1361) ==20559== by 0x89BA8A: ZEND_DECLARE_INHERITED_CLASS_SPEC_CONST_CONST_HANDLER (zend_vm_execute.h:5837) ==20559== by 0x8CF616: execute_ex (zend_vm_execute.h:56000) ==20559== by 0x8D5F41: zend_execute (zend_vm_execute.h:60882) ==20559== by 0x853963: zend_execute_scripts (zend.c:1562) ==20559== by 0x7F89FF: php_execute_script (main.c:2630) ==20559== by 0x8D83A5: do_cli (php_cli.c:997) ==20559== ==20559== ==20559== HEAP SUMMARY: ==20559== in use at exit: 9,484 bytes in 70 blocks ==20559== total heap usage: 57,170 allocs, 57,100 frees, 10,884,542 bytes allocated ==20559== ==20559== LEAK SUMMARY: ==20559== definitely lost: 2,648 bytes in 21 blocks ==20559== indirectly lost: 5,142 bytes in 26 blocks ==20559== possibly lost: 640 bytes in 1 blocks ==20559== still reachable: 1,054 bytes in 22 blocks ==20559== suppressed: 0 bytes in 0 blocks ==20559== Rerun with --leak-check=full to see details of leaked memory ==20559== ==20559== For counts of detected and suppressed errors, rerun with: -v ==20559== ERROR SUMMARY: 10 errors from 6 contexts (suppressed: 0 from 0) ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=76510 -- Edit this bug report at https://bugs.php.net/bug.php?id=76510&edit=1

« previous php.bugs (#216785) next »