### Description Given the following phpt: ``` --TEST-- phpdbg_watch null pointer access --SKIPIF-- <?php if (getenv('SKIP_ASAN')) { die("skip intentionally causes segfaults"); } ?> --FILE-- <?php echo "*** Testing array_multisort() : Testing with anonymous arguments ***\n"; var_dump(array_multisort(array(1,3,2,4))); $xconnect=$GLOBALS[array_rand($GLOBALS)]; echo "Done\n"; $a = []; $a[0] = 1; $a[0] = 2; $a = [0 => 3, 1 => 4]; ?> --PHPDBG-- b 6 r w a $a c q --EXPECTF-- *** Testing array_multisort() : Testing with anonymous arguments *** bool(true) [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[]] prompt> [Breaking on watchpoint $a[]] 1 elements were added to the array >00009: prompt> [$a[] has been removed, removing watchpoint] [Script ended normally] prompt> ``` Resulted in this output: ``` [Successful compilation of /php-src/tests/test.php] prompt> [Breakpoint #0 added at /php-src/tests/test.php:6] prompt> *** Testing array_multisort() : Testing with anonymous arguments *** bool(true) Done [Breakpoint #0 at /php-src/tests/test.php:6, hits: 1] >00006: $a = []; 00007: $a[0] = 1; 00008: $a[0] = 2; prompt> /php-src/sapi/phpdbg/phpdbg_watch.c:969:41: runtime error: member access within null pointer of type 'phpdbg_watchpoint_t' (aka 'struct _phpdbg_watchpoint_t') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /php-src/sapi/phpdbg/phpdbg_watch.c:969:41 in ---- FAILED ``` ### PHP Version PHP 8.4.0-dev ### Operating System ubuntu 22.04
Activity
iluuu1994 commentedon Mar 12, 2024
Hi @YuanchengJiang. Same as GH-13671. ASAN/LSAN failures on tests with
SKIP_ASANin theirSKIPIFsection don't need to be reported.iluuu1994 commentedon Mar 12, 2024
Oh wait, it seems I was misunderstanding. This is a new test. Sorry.
YuanchengJiang commentedon Mar 12, 2024
Thanks. I have double-checked the case is not duplicated with existing test cases. (i.e., the crash site is new: sapi/phpdbg/phpdbg_watch.c:969:41).
YuanchengJiang commentedon Apr 8, 2024
I continuously detect the same issue in recent commits. Wondering any plan to fix it?
ndossche commentedon Apr 8, 2024
Cc @bwoebi
Fix GH-13681: segfault when adding watchpoint fails.
Fix phpGH-13230: phpdbg use-after-free at shutdown