View Issue Details

IDProjectCategoryView StatusLast Update
0001897XdebugStep Debuggingpublic2020-11-27 20:39
Reporterwebflo Assigned Toderick  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
OS*OS Version11.0.1 
Product Version3.0.0RC1 
Target Version3.0.1Fixed in Version3.0.1 
Summary0001897: Crash when removing a breakpoint
Description

Hello,

xdebug 3.0.0, PHP 7.4 on macOS. Step debugging works great, but if I remove a breakpoint during the debugging-session the php process dies. It does not depend on the script. It breaks on every script, even very simple ones. See the attachment. I use PhpStorm 2020.2.4 as IDE/Client.

Error message

php ./web/test.php
php(28254,0x112819e00) malloc: error for object 0x6000000000000000: pointer being freed was not allocated
php(28254,0x112819e00) malloc:
set a breakpoint in malloc_error_break to debug
[1] 28254 abort php ./web/test.php

Steps To Reproduce
  • Enable xdebug in PHPStorm
  • Set breakpoint on Line 2 ($a)
  • php test.php
  • Breakpoint is triggered
  • Step one line further
  • Remove breakpoint in PhpStorm
  • php dies
Additional Information

Xdebug Config

xdebug.mode=debug
xdebug.start_with_request=yes


PHP 7.4.13 (cli) (built: Nov 26 2020 05:06:10) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.13, Copyright (c), by Zend Technologies
with Xdebug v3.0.0, Copyright (c) 2002-2020, by Derick Rethans


TagsNo tags attached.
Attached Files
test.php (38 bytes)   
<?php

$a = 1;
$b = 2;

echo $a + $b;
test.php (38 bytes)   
Operating System
PHP Version7.4.0-7.4.4

Relationships

has duplicate 0001899 resolvedderick Segmentation faul when disabling a breaking while session is active 

Activities

webflo

2020-11-26 19:29

reporter   ~0005545

I did a test with Xdebug for VSCode https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug. Same problem.

Thanks!

derick

2020-11-26 19:55

administrator   ~0005546

Would you mind adding a log file through the xdebug.log setting? See https://xdebug.org/docs/all_settings#log

webflo

2020-11-26 20:07

reporter   ~0005547

Sure. Here is the log.

xdebug.log (7,101 bytes)   
[33554] Log opened at 2020-11-26 20:06:00.962674
[33554] [Step Debug] INFO: Connecting to configured address/port: localhost:9003.
[33554] [Step Debug] WARN: Creating socket for 'localhost:9003', poll success, but error: Operation now in progress (19).
[33554] [Step Debug] WARN: Creating socket for 'localhost:9003', poll success, but error: Operation now in progress (19).
[33554] [Step Debug] WARN: Creating socket for 'localhost:9003', poll success, but error: Operation now in progress (19).
[33554] [Step Debug] ERR: Could not connect to debugging client. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port) :-(
[33554] Log closed at 2020-11-26 20:06:00.969880

[33632] Log opened at 2020-11-26 20:06:31.629325
[33632] [Step Debug] INFO: Connecting to configured address/port: localhost:9003.
[33632] [Step Debug] INFO: Connected to debugging client: localhost:9003 (through xdebug.client_host/xdebug.client_port). :-)
[33632] [Step Debug] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///Users/fweber/Projects/xdebug-test/test.php" language="PHP" xdebug:language_version="7.2.33" protocol_version="1.0" appid="33632"><engine version="3.0.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2020 by Derick Rethans]]></copyright></init>

[33632] [Step Debug] <- breakpoint_list -i 1
[33632] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="1"></response>

[33632] [Step Debug] <- breakpoint_set -i 2 -t line -f file:///Users/fweber/Projects/xdebug-test/test.php -n 3
[33632] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="2" id="336320001"></response>

[33632] [Step Debug] <- breakpoint_list -i 3
[33632] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="3"><breakpoint type="line" filename="file:///Users/fweber/Projects/xdebug-test/test.php" lineno="3" state="enabled" hit_count="0" hit_value="0" id="336320001"></breakpoint></response>

[33632] [Step Debug] <- breakpoint_list -i 4
[33632] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="4"><breakpoint type="line" filename="file:///Users/fweber/Projects/xdebug-test/test.php" lineno="3" state="enabled" hit_count="0" hit_value="0" id="336320001"></breakpoint></response>

[33632] [Step Debug] <- breakpoint_set -i 5 -t exception -x *
[33632] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="5" id="336320002"></response>

[33632] [Step Debug] <- run -i 6
[33632] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="6" status="break" reason="ok"><xdebug:message filename="file:///Users/fweber/Projects/xdebug-test/test.php" lineno="3"></xdebug:message></response>

[33632] [Step Debug] <- stack_get -i 7
[33632] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="7"><stack where="{main}" level="0" type="file" filename="file:///Users/fweber/Projects/xdebug-test/test.php" lineno="3"></stack></response>

[33632] [Step Debug] <- context_names -i 8 -d 0
[33632] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_names" transaction_id="8"><context name="Locals" id="0"></context><context name="Superglobals" id="1"></context><context name="User defined constants" id="2"></context></response>

[33632] [Step Debug] <- context_get -i 9 -d 0 -c 0
[33632] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="9" context="0"><property name="$a" fullname="$a" type="uninitialized"></property><property name="$b" fullname="$b" type="uninitialized"></property></response>

[33632] [Step Debug] <- context_get -i 10 -d 0 -c 1
[33632] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="10" context="1"><property name="$_COOKIE" fullname="$_COOKIE" type="array" children="0" numchildren="0" page="0" pagesize="32"></property><property name="$_ENV" fullname="$_ENV" type="array" children="0" numchildren="0" page="0" pagesize="32"></property><property name="$_FILES" fullname="$_FILES" type="array" children="0" numchildren="0" page="0" pagesize="32"></property><proper
[33632] [Step Debug] <- context_get -i 11 -d 0 -c 2
[33632] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="11" context="2"></response>

[33632] [Step Debug] <- step_into -i 12
[33632] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="12" status="break" reason="ok"><xdebug:message filename="file:///Users/fweber/Projects/xdebug-test/test.php" lineno="4"></xdebug:message></response>

[33632] [Step Debug] <- stack_get -i 13
[33632] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="13"><stack where="{main}" level="0" type="file" filename="file:///Users/fweber/Projects/xdebug-test/test.php" lineno="4"></stack></response>

[33632] [Step Debug] <- context_names -i 14 -d 0
[33632] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_names" transaction_id="14"><context name="Locals" id="0"></context><context name="Superglobals" id="1"></context><context name="User defined constants" id="2"></context></response>

[33632] [Step Debug] <- context_get -i 15 -d 0 -c 0
[33632] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="context_get" transaction_id="15" context="0"><property name="$a" fullname="$a" type="int"><![CDATA[1]]></property><property name="$b" fullname="$b" type="uninitialized"></property></response>

[33632] [Step Debug] <- breakpoint_list -i 16
[33632] [Step Debug] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_list" transaction_id="16"><breakpoint type="exception" exception="*" state="enabled" hit_count="0" hit_value="0" id="336320002"></breakpoint><breakpoint type="line" filename="file:///Users/fweber/Projects/xdebug-test/test.php" lineno="3" state="enabled" hit_count="1" hit_value="0" id="336320001"></breakpoint></response>

[33632] [Step Debug] <- breakpoint_remove -i 17 -d 336320001
xdebug.log (7,101 bytes)   

derick

2020-11-27 13:01

administrator   ~0005550

https://github.com/xdebug/xdebug/pull/694

derick

2020-11-27 13:15

administrator   ~0005551

Fixed in GIT (xdebug_3_0 and master branches), for version 3.0.1.

webflo

2020-11-27 20:39

reporter   ~0005553

Works great. Thanks!

Issue History

Date Modified Username Field Change
2020-11-26 19:21 webflo New Issue
2020-11-26 19:21 webflo File Added: test.php
2020-11-26 19:29 webflo Note Added: 0005545
2020-11-26 19:55 derick Assigned To => derick
2020-11-26 19:55 derick Status new => feedback
2020-11-26 19:55 derick Note Added: 0005546
2020-11-26 20:07 webflo File Added: xdebug.log
2020-11-26 20:07 webflo Note Added: 0005547
2020-11-26 20:07 webflo Status feedback => assigned
2020-11-27 11:58 derick Relationship added has duplicate 0001899
2020-11-27 12:58 derick OS macOS => *
2020-11-27 12:58 derick Target Version => 3.0.1
2020-11-27 12:58 derick Summary xdebug dies when breakpoint is removed => Crash when removing a breakpoint
2020-11-27 12:58 derick Description Updated
2020-11-27 12:58 derick Steps to Reproduce Updated
2020-11-27 12:58 derick Additional Information Updated
2020-11-27 13:01 derick Note Added: 0005550
2020-11-27 13:15 derick Status assigned => closed
2020-11-27 13:15 derick Resolution open => fixed
2020-11-27 13:15 derick Fixed in Version => 3.0.1
2020-11-27 13:15 derick Note Added: 0005551
2020-11-27 20:39 webflo Note Added: 0005553