View Issue Details

IDProjectCategoryView StatusLast Update
0001534XdebugUncategorizedpublic2019-10-31 10:44
Reporterstherrien Assigned Toderick  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionfixed 
Product Version2.6.0 
Target Version2.8.0devFixed in Version2.8.0 
Summary0001534: Segfault when exception thrown in a closure bound to class scope
Description

When an exception is thrown in a closure and that closure is bound to another object (bindTo()), the process fails with a segfault instead of the exception being thrown, but only if xdebug.collect_params > 0

Steps To Reproduce

$ php -d xdebug.collect_params=1 segfault.php
Segmentation fault

Disabling xdebug.collect_params=0 throws the exception as expected.

$ php -d xdebug.collect_params=0 segfault.php

PHP Fatal error: Uncaught Exception: Exception thrown successfully in /home/steve/segfault.php:13
Stack trace:
#0 /home/steve/segfault.php(7): Closure->{closure}()
#1 /home/steve/segfault.php(14): bug->on(Object(Closure))
0000002 {main}
thrown in /home/steve/segfault.php on line 13

The exception also is successfully thrown if line 6 (->bindTo($this)) is commented out.

Additional Information

PHP 7.2.3 (cli) (built: Mar 2 2018 12:41:10) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

(remi)

Replicated in an clean VM using the default settings and config.

TagsNo tags attached.
Attached Files
segfault.php (232 bytes)
Operating SystemCentOS Linux 7.4
PHP Version7.2.0-7.2.4

Activities

derick

2018-03-15 11:11

administrator   ~0004618

This is very likely the same issue as 0001535, just a different symptom.

Xenos

2019-05-15 16:32

reporter   ~0005023

This is the same cause than 0001665 see pull request https://github.com/xdebug/xdebug/pull/473

derick

2019-09-06 11:10

administrator   ~0005133

This has been fixed for Xdebug 2.8-dev (likely to become 2.8.0RC1).

Issue History

Date Modified Username Field Change
2018-03-07 20:16 stherrien New Issue
2018-03-07 20:16 stherrien File Added: segfault.php
2018-03-15 11:11 derick Note Added: 0004618
2018-03-15 11:11 derick Target Version => 2.6.1
2018-03-15 11:11 derick Assigned To => derick
2018-03-15 11:11 derick Status new => confirmed
2019-05-15 16:32 Xenos Note Added: 0005023
2019-06-28 11:14 derick Severity crash => block
2019-06-28 11:14 derick Target Version 2.6.1 => 2.8.0dev
2019-09-06 11:10 derick Status confirmed => resolved
2019-09-06 11:10 derick Resolution open => fixed
2019-09-06 11:10 derick Fixed in Version => 2.8.0dev
2019-09-06 11:10 derick Note Added: 0005133
2019-10-31 10:42 derick Status resolved => closed
2019-10-31 10:44 derick Fixed in Version 2.8.0dev => 2.8.0
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized