Skip to content

Commit

Permalink
Merged pull request xdebug#985
Browse files Browse the repository at this point in the history
  • Loading branch information
derickr committed Nov 27, 2024
2 parents 207b957 + d599f6b commit 6972691
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/debugger/com.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,11 @@ bool xdebug_should_ignore(void)
const char *ignore_value;
const char *found_in_global;

/* If we are in engine shutdown, don't try to read a global */
if (EG(flags) & EG_FLAGS_IN_SHUTDOWN) {
return true;
}

ignore_value = xdebug_lib_find_in_globals("XDEBUG_IGNORE", &found_in_global);

if (!ignore_value) {
Expand Down
12 changes: 12 additions & 0 deletions tests/debugger/bug02305.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--TEST--
Test for bug #2305: Segfault when checking whether to ignore creating a debug connection during shutdown functions
--INI--
xdebug.discover_client_host=true
xdebug.mode=debug
xdebug.start_with_request=trigger
--FILE--
<?php
register_shutdown_function(function () {});
parse_str("", $_POST);
?>
--EXPECTF--

0 comments on commit 6972691

Please sign in to comment.