php / php/php-src

segfault in Zend/tests/assign_coalesce_001.phpt

Đang mở
#13,323 25 bình luận 0 reaction 1 người được giao Xem trên GitHub

@iluuu1994 đang làm issue này rồi.

Từ ngày 8/2/2024.

Bug Category: Engine Status: Verified
Ngôn ngữ chính
C
Star
40.4k
Fork
8.1k
Merge trung bình
2 ngày 13 giờ
Pull request đã merge (30 ngày)
96

Mô tả

Description

Doing the following:

hans@DESKTOP-EE15SLU:~/projects/php-src$ git log -1
commit da6a4e799aafdf33c8701fcdd632d646f61e612e (HEAD -> master, origin/master, origin/HEAD)
Merge: 1cc0a16752 ae44ab47a7
Author: Jakub Zelenka <bukka@php.net>
Date:   Sun Feb 4 12:01:09 2024 +0000

    Merge branch 'PHP-8.3'
hans@DESKTOP-EE15SLU:~/projects/php-src$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
hans@DESKTOP-EE15SLU:~/projects/php-src$ ./buildconf >/dev/null
hans@DESKTOP-EE15SLU:~/projects/php-src$ ./configure --disable-all --disable-cgi --enable-cli >/dev/null
hans@DESKTOP-EE15SLU:~/projects/php-src$ make clean >/dev/null;
hans@DESKTOP-EE15SLU:~/projects/php-src$ make -j$(nproc) >/dev/null
/home/hans/projects/php-src/ext/pcre/pcre2lib/pcre2_compile.c: In function ‘compile_regex’:
/home/hans/projects/php-src/ext/pcre/pcre2lib/pcre2_compile.c:8169:17: warning: storing the address of local variable ‘capitem’ in ‘*cb.open_caps’ [-Wdangling-pointer=]
 8169 |   cb->open_caps = &capitem;
      |   ~~~~~~~~~~~~~~^~~~~~~~~~
/home/hans/projects/php-src/ext/pcre/pcre2lib/pcre2_compile.c:8106:14: note: ‘capitem’ declared here
 8106 | open_capitem capitem;
      |              ^~~~~~~
/home/hans/projects/php-src/ext/pcre/pcre2lib/pcre2_compile.c:8100:39: note: ‘cb’ declared here
 8100 |   branch_chain *bcptr, compile_block *cb, PCRE2_SIZE *lengthptr)
In file included from /home/hans/projects/php-src/Zend/zend.h:32,
                 from /home/hans/projects/php-src/Zend/zend_API.c:22:
In function ‘zend_check_magic_method_implementation’,
    inlined from ‘zend_register_functions’ at /home/hans/projects/php-src/Zend/zend_API.c:3035:4:
/home/hans/projects/php-src/Zend/zend_API.c:2636:34: warning: array subscript ‘zend_function {aka const union _zend_function}[0]’ is partly outside array bounds of ‘unsigned char[136]’ [-Warray-bounds=]
 2636 |         if (ZSTR_VAL(fptr->common.function_name)[0] != '_'
/home/hans/projects/php-src/Zend/zend_string.h:68:26: note: in definition of macro ‘ZSTR_VAL’
   68 | #define ZSTR_VAL(zstr)  (zstr)->val
      |                          ^~~~
/home/hans/projects/php-src/Zend/zend_API.c: In function ‘zend_register_functions’:
/home/hans/projects/php-src/Zend/zend_API.c:2926:32: note: object of size 136 allocated by ‘malloc’
 2926 |                 reg_function = malloc(sizeof(zend_internal_function));
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hans@DESKTOP-EE15SLU:~/projects/php-src$ ./sapi/cli/php ./run-tests.php Zend/tests/assign_coalesce_001.phpt --show-diff

resulted in:

=====================================================================
PHP         : /home/hans/projects/php-src/sapi/cli/php
PHP_SAPI    : cli
PHP_VERSION : 8.4.0-dev
ZEND_VERSION: 4.4.0-dev
PHP_OS      : Linux - Linux DESKTOP-EE15SLU 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64
INI actual  : /home/hans/projects/php-src
More .INIs  :
---------------------------------------------------------------------
PHP         : /home/hans/projects/php-src/sapi/phpdbg/phpdbg
PHP_SAPI    : phpdbg
PHP_VERSION : 8.4.0-dev
ZEND_VERSION: 4.4.0-dev
PHP_OS      : Linux - Linux DESKTOP-EE15SLU 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64
INI actual  : /home/hans/projects/php-src
More .INIs  :
---------------------------------------------------------------------
CWD         : /home/hans/projects/php-src
Extra dirs  :
VALGRIND    : Not used
=====================================================================
Running selected tests.
TEST 1/1 [Zend/tests/assign_coalesce_001.phpt]
========DIFF========
--
     }

     Static props:
042- int(123)
043- string(3) "foo"
044- id(foo)
045- id(foo)
046- id(bar)
047- int(123)
048- string(3) "foo"
042+ Segmentation fault
043+
044+ Termsig=11
========DONE========
FAIL Coalesce assign (??=): Basic behavior [Zend/tests/assign_coalesce_001.phpt]
=====================================================================
Number of tests :     1                 1
Tests skipped   :     0 (  0.0%) --------
Tests warned    :     0 (  0.0%) (  0.0%)
Tests failed    :     1 (100.0%) (100.0%)
Tests passed    :     0 (  0.0%) (  0.0%)
---------------------------------------------------------------------
Time taken      : 0.003 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Coalesce assign (??=): Basic behavior [Zend/tests/assign_coalesce_001.phpt]
=====================================================================

but I expected the test to pass.

PHP Version

8.4.0-dev commit da6a4e799aafdf33c8701fcdd632d646f61e612e

Operating System

WSL2 Ubuntu 24.04-dev

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.