Bug #77800 [Opn->Csd]: phpdbg segfaults on listing some conditional breakpoints

From: Date: Tue, 26 Mar 2019 22:07:31 +0000
Subject: Bug #77800 [Opn->Csd]: phpdbg segfaults on listing some conditional breakpoints
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220213@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77800&edit=1 ID: 77800 Updated by: krakjoe@php.net Reported by: lauter dot miriam at gmail dot com Summary: phpdbg segfaults on listing some conditional breakpoints -Status: Open +Status: Closed Type: Bug Package: phpdbg Operating System: Linux PHP Version: master-Git-2019-03-26 (Git) Block user comment: N Private report: N New Comment: Automatic comment on behalf of krakjoe Revision: http://git.php.net/?p=php-src.git;a=commit;h=7df8e4fc0abc105cd5d7b933499bdd275459f7ee Log: Fix #77800 phpdbg segfaults on conditional breakpoints Previous Comments: ------------------------------------------------------------------------ [2019-03-26 21:55:56] petk@php.net The following pull request has been associated: Patch Name: Fix #77800: phpdbg segfaults on listing some conditional breakpoints On GitHub: https://github.com/php/php-src/pull/3992 Patch: https://github.com/php/php-src/pull/3992.patch ------------------------------------------------------------------------ [2019-03-26 21:43:31] lauter dot miriam at gmail dot com Description: ------------ phpdbg segfaults when attempting to run after setting a conditional breakpoint using the NUMERIC_PARAM (lineno only) format. # repro steps phpdbg -f script.php b @ 3 if $i > 1 r # further discussion phpdbg supports expressing non-conditional breakpoints in a number of different ways: file, method, opcode etc. The supported expression format for conditional breakpoints appears to be far less flexible. Currently, in order for a conditional breakpoint to work, the location param must be given as the absolute path to a file:lineno. Not doing so leads to surprising results (e.g. segfault or silent failure). Test script: --------------- <?php $i = 1; echo $i++; echo $i++; echo $i++; echo $i++; Expected result: ---------------- 1. phpdbg does not segfault even if breakpoint format input by the user is malformed or unsupported. 2. if a user attempts to set a breakpoint in a way that is unsupported, phpdbg immediately emits an error (as opposed to silently failing or failing later.) 3. to the extent that it's sensible, phpdbg should support expressing conditional breakpoints in all the same ways it is possible to express non-conditional breakpoints. Actual result: -------------- (gdb) bt #0 0x00007f0089d524c7 in kill () at ../sysdeps/unix/syscall-template.S:81 #1 0x0000000000841001 in zend_signal_handler (signo=signo@entry=11, siginfo=siginfo@entry=0x7fff3547edb0, context=context@entry=0x7fff3547ec80) at /usr/src/debug/php-src-php-7.1.18/Zend/zend_signal.c:209 #2 0x00000000008410db in zend_signal_handler_defer (signo=11, siginfo=0x7fff3547edb0, context=0x7fff3547ec80) at /usr/src/debug/php-src-php-7.1.18/Zend/zend_signal.c:106 #3 0x00007f008e06d5e0 in <signal handler called> () at /lib64/libpthread.so.0 #4 0x00000000008c0dae in phpdbg_export_breakpoints_to_string (str=str@entry=0x7fff3547f490) at /usr/src/debug/php-src-php-7.1.18/sapi/phpdbg/phpdbg_bp.c:235 #5 0x0000000000455fb1 in main (argc=3, argv=0x7fff3547f8e8) at /usr/src/debug/php-src-php-7.1.18/sapi/phpdbg/phpdbg.c:2010 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77800&edit=1

« previous php.bugs (#220213) next »