Skip to content

Commit e12402b

Browse files
committed
Merged pull request xdebug#1005
2 parents 26c4b92 + 4fe83e3 commit e12402b

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

src/base/base.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ static void xdebug_execute_user_code_begin(zend_execute_data *execute_data)
733733
EX(opline) = EX(func)->op_array.opcodes;
734734
}
735735

736-
if (XG_BASE(in_execution) && XDEBUG_VECTOR_COUNT(XG_BASE(stack)) == 0) {
736+
if (XG_BASE(in_execution) && XDEBUG_VECTOR_COUNT(XG_BASE(stack)) == 0 && ((EG(flags) & EG_FLAGS_IN_SHUTDOWN) == 0)) {
737737
if (XDEBUG_MODE_IS(XDEBUG_MODE_STEP_DEBUG)) {
738738
xdebug_debugger_set_program_name(op_array->filename);
739739
xdebug_debug_init_if_requested_at_startup();

tests/debugger/bug02322.phpt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
--TEST--
2+
Test for bug #2322: Xdebug tries to open debugging connection in destructors during shutdown
3+
--SKIPIF--
4+
<?php
5+
require __DIR__ . '/../utils.inc';
6+
check_reqs('dbgp');
7+
?>
8+
--INI--
9+
xdebug.mode=debug
10+
xdebug.start_with_request=yes
11+
xdebug.log=
12+
--FILE--
13+
<?php
14+
class Testing
15+
{
16+
function __destruct() {
17+
echo "Destruct\n";
18+
}
19+
}
20+
21+
$t = array();
22+
for ($i=0; $i<5; $i++) {
23+
$t[] = new Testing();
24+
}
25+
?>
26+
--EXPECTF--
27+
Xdebug: [Step Debug] %sdebugging client%s
28+
Destruct
29+
Destruct
30+
Destruct
31+
Destruct
32+
Destruct

0 commit comments

Comments
 (0)