php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81408 watchpoints don't work on powerpc64le-linux
Submitted: 2021-09-02 04:45 UTC Modified: 2021-09-02 05:16 UTC
From: bauermann at kolabnow dot com Assigned:
Status: Open Package: phpdbg
PHP Version: 7.4.23 OS: Guix Linux
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: bauermann at kolabnow dot com
New email:
PHP Version: OS:

 

 [2021-09-02 04:45 UTC] bauermann at kolabnow dot com
Description:
------------
As part of building the php package, Guix runs the testsuite.

The following tests fail on powerpc64le-linux:

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Test simple recursive watchpoint [sapi/phpdbg/tests/watch_001.phpt]
Test simple watchpoint with replace [sapi/phpdbg/tests/watch_003.phpt]
Test detection of inline string manipulations on zval watch [sapi/phpdbg/tests/watch_004.phpt]
Test proper watch comparisons when having multiple levels of indirection from a zval to its value [sapi/phpdbg/tests/watch_005.phpt]
Test multiple watch elements pointing to the same watchpoint [sapi/phpdbg/tests/watch_006.phpt]
=====================================================================

I'll see if I can upload the test report and individual test logs for more information.

From looking at the logs, it looks like watchpoints don't work on this platform.
From a very cursory look at phpdbg_watch.c, it seems that it is sensitive to the page size, which on powerpc64le-linux is 64KB. This may be a shot in the dark, but perhaps the problem is related to this?

The kernel version is 5.10.0-0.bpo.8-powerpc64le (Debian's buster kernel).

Expected result:
----------------
All watchpoint tests pass.

Actual result:
--------------
The tests mentioned in the description are failing.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-09-02 05:16 UTC] bauermann at kolabnow dot com
Apparently I can only attach patches to bug reports, so I'll just concatenate the watch_*.log files here instead:

watch_001.log
----------

---- EXPECTED OUTPUT
[Successful compilation of %s]
prompt> [Breakpoint #0 added at %s:3]
prompt> [Breakpoint #0 at %s:3, hits: 1]
>00003: $a = 1;
 00004: $b = [$a];
 00005: 
prompt> [Added recursive watchpoint #0 for $b]
prompt> [Breaking on watchpoint $b]
Old value: 
New value: Array ([0] => 1)
>00006: unset($b);
 00007: $b = 2;
 00008: 
prompt> [Breaking on watchpoint $b]
Old value inaccessible or destroyed
New value: 
>00007: $b = 2;
 00008: 
prompt> [Breaking on watchpoint $b]
Old value: 
New value: 2
>00008: 
prompt> [$b has been removed, removing watchpoint recursively]
[Script ended normally]
prompt>
---- ACTUAL OUTPUT
[Successful compilation of /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_001.php]
prompt> [Breakpoint #0 added at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_001.php:3]
prompt> [Breakpoint #0 at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_001.php:3, hits: 1]
>00003: $a = 1;
 00004: $b = [$a];
 00005: 
prompt> [Added recursive watchpoint #0 for $b]
prompt> [$b has been removed, removing watchpoint recursively]
[Script ended normally]
prompt> [Breakpoint at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_001.php:3 exists]
prompt> [Breakpoint at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_001.php:3 exists]
prompt> [Breakpoint at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_001.php:3 exists]
prompt>
---- FAILED

watch_003.log
----------

---- EXPECTED OUTPUT
[Successful compilation of %s]
prompt> [Breakpoint #0 added at %s:6]
prompt> [Breakpoint #0 at %s:6, hits: 1]
>00006: $a[0] = 2;
 00007: 
 00008: $a = [0 => 3, 1 => 4];
prompt> [Added watchpoint #0 for $a[0]]
prompt> [Breaking on watchpoint $a[0]]
Old value: 1
New value: 2
>00008: $a = [0 => 3, 1 => 4];
 00009: 
prompt> [Breaking on watchpoint $a[0]]
Old value: 2
New value: 3
>00009: 
prompt> [$a[0] has been removed, removing watchpoint]
[Script ended normally]
prompt>
---- ACTUAL OUTPUT
[Successful compilation of /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_003.php]
prompt> [Breakpoint #0 added at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_003.php:6]
prompt> [Breakpoint #0 at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_003.php:6, hits: 1]
>00006: $a[0] = 2;
 00007: 
 00008: $a = [0 => 3, 1 => 4];
prompt> [Added watchpoint #0 for $a[0]]
prompt> [Breaking on watchpoint $a[0]]
Old value: 1
New value: 3
>00009: 
prompt> [$a[0] has been removed, removing watchpoint]
[Script ended normally]
prompt> [Breakpoint at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_003.php:6 exists]
prompt>
---- FAILED

watch_004.log
----------

---- EXPECTED OUTPUT
[Successful compilation of %s]
prompt> [Breakpoint #0 added at %s:3]
prompt> [Breakpoint #0 at %s:3, hits: 1]
>00003: $b = "a";
 00004: $a = $b.$b;
 00005: $a[1] = "b";
prompt> [Added watchpoint #0 for $a]
prompt> [Breaking on watchpoint $a]
Old value: 
New value: aa
>00005: $a[1] = "b";
 00006: 
prompt> [Breaking on watchpoint $a]
Old value: aa
New value: ab
>00006: 
prompt> [$a has been removed, removing watchpoint]
[Script ended normally]
prompt>
---- ACTUAL OUTPUT
[Successful compilation of /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_004.php]
prompt> [Breakpoint #0 added at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_004.php:3]
prompt> [Breakpoint #0 at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_004.php:3, hits: 1]
>00003: $b = "a";
 00004: $a = $b.$b;
 00005: $a[1] = "b";
prompt> [Added watchpoint #0 for $a]
prompt> [$a has been removed, removing watchpoint]
[Script ended normally]
prompt> [Breakpoint at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_004.php:3 exists]
prompt> [Breakpoint at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_004.php:3 exists]
prompt>
---- FAILED

watch_005.log
----------

---- EXPECTED OUTPUT
[Successful compilation of %s]
prompt> [Breakpoint #0 added at %s:3]
prompt> [Breakpoint #0 at %s:3, hits: 1]
>00003: $b = "a";
 00004: $a = $b.$b;
 00005: $c = &$a;
prompt> [Added recursive watchpoint #0 for $a]
prompt> [Breaking on watchpoint $a]
Old value: 
New value: aa
>00005: $c = &$a;
 00006: $a[1] = "b";
 00007: 
prompt> [Breaking on watchpoint $a]
Old value inaccessible or destroyed
New value (reference): aa
>00006: $a[1] = "b";
 00007: 
 00008: exit;
prompt> [Breaking on watchpoint $a]
Old value: aa
New value: ab
>00008: exit;
 00009: 
prompt> [$a has been removed, removing watchpoint recursively]
[Script ended normally]
prompt>
---- ACTUAL OUTPUT
[Successful compilation of /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_005.php]
prompt> [Breakpoint #0 added at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_005.php:3]
prompt> [Breakpoint #0 at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_005.php:3, hits: 1]
>00003: $b = "a";
 00004: $a = $b.$b;
 00005: $c = &$a;
prompt> [Added recursive watchpoint #0 for $a]
prompt> [$a has been removed, removing watchpoint recursively]
[Script ended normally]
prompt> [Breakpoint at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_005.php:3 exists]
prompt> [Breakpoint at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_005.php:3 exists]
prompt> [Breakpoint at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_005.php:3 exists]
prompt>
---- FAILED

watch_006.log
----------

---- EXPECTED OUTPUT
[Successful compilation of %s]
prompt> [Breakpoint #0 added at %s:4]
prompt> [Breakpoint #0 at %s: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)
>00006: $a[0] = 2;
 00007: $a[1] = 3;
 00008: $c = [1];
prompt> [Breaking on watchpoint $a[0]]
Old value: 1
New value: 2
>00007: $a[1] = 3;
 00008: $c = [1];
 00009: $b = &$c;
prompt> [Element 1 has been added to watchpoint]
[Breaking on watchpoint $b[]]
1 elements were added to the array
>00008: $c = [1];
 00009: $b = &$c;
 00010: 
prompt> [Breaking on watchpoint $b]
Old value inaccessible or destroyed
New value (reference): Array ([0] => 2,[1] => 3)
>00009: $b = &$c;
 00010: 
prompt> [Breaking on watchpoint $b]
Old value inaccessible or destroyed
New value (reference): Array ([0] => 1)
>00010: 
prompt> [$b has been removed, removing watchpoint recursively]
[$a[0] has been removed, removing watchpoint]
[Script ended normally]
prompt>
---- ACTUAL OUTPUT
[Successful compilation of /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_006.php]
prompt> [Breakpoint #0 added at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_006.php:4]
prompt> [Breakpoint #0 at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/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> [$a[0] has been removed, removing watchpoint]
[$b has been removed, removing watchpoint recursively]
[Script ended normally]
prompt> [Breakpoint at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_006.php:4 exists]
prompt> [Breakpoint at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_006.php:4 exists]
prompt> [Breakpoint at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_006.php:4 exists]
prompt> [Breakpoint at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_006.php:4 exists]
prompt> [Breakpoint at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_006.php:4 exists]
prompt> [Breakpoint at /tmp/guix-build-php-7.4.23.drv-0/php-7.4.23/sapi/phpdbg/tests/watch_006.php:4 exists]
prompt>
---- FAILED
 [2021-09-02 16:35 UTC] bauermann at kolabnow dot com
I just noticed this: watch_002.phpt passes.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 04:01:28 2024 UTC