Bug #77800 [NEW]: phpdbg segfaults on listing some conditional breakpoints

From: Date: Tue, 26 Mar 2019 21:43:31 +0000
Subject: Bug #77800 [NEW]: phpdbg segfaults on listing some conditional breakpoints
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220212@lists.php.net to get a copy of this message
From:             lauter dot miriam at gmail dot com
Operating system: Linux
PHP version:      master-Git-2019-03-26 (Git)
Package:          phpdbg
Bug Type:         Bug
Bug description:phpdbg segfaults on listing some conditional breakpoints

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 bug report at https://bugs.php.net/bug.php?id=77800&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=77800&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=77800&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=77800&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=77800&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=77800&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=77800&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=77800&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=77800&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=77800&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=77800&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=77800&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=77800&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=77800&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77800&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=77800&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=77800&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=77800&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77800&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=77800&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=77800&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#220212) next »