php / php/php-src

`sapi/phpdbg/tests/watch_006.phpt` fails on ppc64le

Đang mở
#14,879 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Bug SAPI: phpdbg Status: Needs Triage
Ngôn ngữ chính
C
Star
40.4k
Fork
8.2k
Merge trung bình
2 ngày 13 giờ
Pull request đã merge (30 ngày)
96

Mô tả

Description

The test is failing on ppc64le Linux (at least, I can't repro on arm64 macOS) like so:

$ cat sapi/phpdbg/tests/watch_006.diff
--
     prompt> [Breaking on watchpoint $b]
     Old value: 
     New value (reference): Array ([0] => 1)
018+ 
019+ [Element 0 has been added to watchpoint]
     >00006: $a[0] = 2;
      00007: $a[1] = 3;
      00008: $c = [1];
--

Essentially, a (spurious?) message about a watchpoint being added occurs, that doesn't seem to happen on other platforms.

GDB stack trace:

(gdb) b phpdbg_watch.c:1038
Breakpoint 1 at 0x7a434c: file /home/cb/php-src/sapi/phpdbg/phpdbg_watch.c, line 1038.
(gdb) handle SIGSEGV nostop noprint
Signal        Stop	Print	Pass to program	Description
SIGSEGV       No	No	Yes		Segmentation fault
(gdb) run -qIb  -n sapi/phpdbg/tests/watch_006.php < ~/phpdbg.cmd
Starting program: /home/cb/php-src/sapi/phpdbg/phpdbg -qIb  -n sapi/phpdbg/tests/watch_006.php < ~/phpdbg.cmd
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[Successful compilation of /home/cb/php-src/sapi/phpdbg/tests/watch_006.php]
prompt> [Breakpoint #0 added at /home/cb/php-src/sapi/phpdbg/tests/watch_006.php:4]
prompt> [Breakpoint #0 at /home/cb/php-src/sapi/phpdbg/tests/watch_006.php:4, hits: 1]
>00004: $a[0] = 1;
 00005: $b = &$a;
 00006: $a[0] = 2;
prompt> [Added watchpoint #0 for $a[0]]
prompt> [Added recursive watchpoint #1 for $b]
prompt> [Breaking on watchpoint $a[0]]
Old value: 0
New value: 1
>00005: $b = &$a;
 00006: $a[0] = 2;
 00007: $a[1] = 3;
prompt> [Breaking on watchpoint $b]
Old value: 
New value (reference): Array ([0] => 1)

Breakpoint 1, phpdbg_check_watchpoint (watch=0x7ffff7860840) at /home/cb/php-src/sapi/phpdbg/phpdbg_watch.c:1038
1038						phpdbg_notice("Element %.*s has been added to watchpoint", (int) ZSTR_LEN(str), ZSTR_VAL(str));
(gdb) bt
#0  phpdbg_check_watchpoint (watch=0x7ffff7860840) at /home/cb/php-src/sapi/phpdbg/phpdbg_watch.c:1038
#1  0x00000001007a4c24 in phpdbg_print_changed_zvals () at /home/cb/php-src/sapi/phpdbg/phpdbg_watch.c:1176
#2  0x000000010078515c in phpdbg_execute_ex (execute_data=0x7ffff7817020) at /home/cb/php-src/sapi/phpdbg/phpdbg_prompt.c:1781
#3  0x00000001006aa75c in zend_execute (op_array=0x7ffff786d000, return_value=0x100a307d8 <phpdbg_globals+1360>)
    at /home/cb/php-src/Zend/zend_vm_execute.h:63001
#4  0x0000000100781524 in phpdbg_do_run (param=0x0) at /home/cb/php-src/sapi/phpdbg/phpdbg_prompt.c:884
#5  0x000000010079c1e0 in phpdbg_internal_stack_execute (stack=0x7fffffffcc28, allow_async_unsafe=true) at /home/cb/php-src/sapi/phpdbg/phpdbg_cmd.c:702
#6  0x000000010079c334 in phpdbg_stack_execute (stack=0x7fffffffcc28, allow_async_unsafe=true) at /home/cb/php-src/sapi/phpdbg/phpdbg_cmd.c:732
#7  0x000000010078434c in phpdbg_interactive (allow_async_unsafe=true, input=0x7ffff78050f0 "r\n") at /home/cb/php-src/sapi/phpdbg/phpdbg_prompt.c:1547
#8  0x000000010077595c in main (argc=4, argv=0x7ffffffff078) at /home/cb/php-src/sapi/phpdbg/phpdbg.c:1610

Very interestingly, it does not reproduce with USE_ZEND_ALLOC=0 set.

Valgrind memcheck output: https://gist.github.com/NattyNarwhal/19a11906157ff459e9592041293d6312

PHP Version

PHP 8.4.0-DEV

Operating System

Gentoo

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.

Hướng nghiên cứu

Bắt đầu với sapi/phpdbg/tests/watch_006.phpt và tái hiện lỗi trên ppc64le Linux, so sánh hành vi với USE_ZEND_ALLOC=0. Đọc sapi/phpdbg/phpdbg_watch.c quanh phpdbg_check_watchpoint() và xem lại đầu ra Valgrind cùng trace GDB được liên kết. Hoàn tất khi bài kiểm thử không còn báo cáo phần tử watchpoint không có thật và vượt qua mà không gặp vấn đề bộ nhớ đã được báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
c, php
Lĩnh vực
cli, devtools, testing-qa
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

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.