View Issue Details

IDProjectCategoryView StatusLast Update
0002306XdebugUncategorizedpublic2025-01-06 15:35
Reportermtassinari Assigned Toderick  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionduplicate 
PlatformWSLOSUbuntuOS Version22.04
Product Version3.4.0 
Fixed in Version3.4.1 
Summary0002306: Segmentation fault on each HTTP request when not listening to debugging connections
Description

After upgrading to PHP 8.4.1 with xDebug 3.4.0, I noticed that if I disable listening to incoming connections in PHPStorm, or if I disable step debugging using xDebug helper extension, I get an apache segmentation fault.

If I re-enable listening to connections, even if I set no breakpoints, it seems to work correctly.

Apache error logs just says:

[Tue Dec 03 08:45:28.909764 2024] [core:notice] [pid 19961] AH00052: child pid 20192 exit signal Segmentation fault (11)

while xDebug error log says:

[28175] Log opened at 2024-12-03 07:51:48.886735
[28175] [Config] WARN: Not setting up control socket with default value due to unavailable 'tsc' clock
[28175] [Step Debug] ERR: Time-out connecting to debugging client, waited: 200 ms. Tried: 172.18.192.1:9000 (through xdebug.client_host/xdebug.client_port).

NOTE: I picked php8.4-dev in the selector as there is no option for PHP 8.4.1

Additional Information

Here is some system info

$ php -v
PHP 8.4.1 (cli) (built: Nov 25 2024 18:03:47) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.1, Copyright (c) Zend Technologies
with Xdebug v3.4.0, Copyright (c) 2002-2024, by Derick Rethans

$ httpd -v
Server version: Apache/2.4.52 (Ubuntu)
Server built: 2024-07-17T18:57:26

$ php -m
[PHP Modules]
apcu
ast
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
intl
json
ldap
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
random
Reflection
session
SimpleXML
soap
sockets
sodium
SPL
sqlite3
ssh2
standard
tokenizer
xdebug
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib
[Zend Modules]
Xdebug

xDebug config:
[xdebug]
xdebug.max_nesting_level = 256
xdebug.dump.GET =
xdebug.dump.POST =

xdebug.dump_undefined = 1
xdebug.show_local_vars = 0
xdebug.dump_globals = 1
xdebug.collect_return = 1
xdebug.collect_assignments = 1
xdebug.var_display_max_depth = -1
xdebug.var_display_max_children = -1
xdebug.var_display_max_data = -1
xdebug.output_dir = "/opt/agews64/temp"
xdebug.profiler_output_name = "callgrind.%u.out"
xdebug.trace_format = 1
xdebug.trace_options = 0
xdebug.trace_output_name = "trace.%u"
xdebug.idekey = PHPSTORM
xdebug.mode = develop,debug
xdebug.discover_client_host = 0
xdebug.client_host = "${XDEBUG_REMOTE_HOST}"
xdebug.client_port = 9000
xdebug.log = "/opt/agews64/logs/xdebug.log"
xdebug.log_level = 3

Here, XDEBUG_REMOTE_HOST is an environment variable I set in the WSL by getting the output of the command

ip route list | grep default | awk '{ print $3 }'

In my setup, PHP is run as an apache module:

$ httpd -DPHP -M
Loaded Modules:
core_module (static)
so_module (static)
watchdog_module (static)
http_module (static)
log_config_module (static)
logio_module (static)
version_module (static)
unixd_module (static)
mpm_prefork_module (shared)
authn_file_module (shared)
authn_core_module (shared)
authz_host_module (shared)
authz_groupfile_module (shared)
authz_user_module (shared)
authz_core_module (shared)
access_compat_module (shared)
auth_basic_module (shared)
allowmethods_module (shared)
cache_module (shared)
socache_shmcb_module (shared)
buffer_module (shared)
ext_filter_module (shared)
request_module (shared)
include_module (shared)
filter_module (shared)
charset_lite_module (shared)
deflate_module (shared)
mime_module (shared)
log_debug_module (shared)
env_module (shared)
mime_magic_module (shared)
expires_module (shared)
headers_module (shared)
setenvif_module (shared)
session_module (shared)
session_cookie_module (shared)
slotmem_shm_module (shared)
status_module (shared)
cgi_module (shared)
vhost_alias_module (shared)
negotiation_module (shared)
dir_module (shared)
alias_module (shared)
php_module (shared)

Tagsphp8.4, segfault
Operating SystemWindows Subsystem for Linux
PHP Version8.4-dev

Relationships

duplicate of 0002307 closedderick Segmentation fault due to a superglobal being a reference while checking for triggers 

Activities

mtassinari

2024-12-03 10:38

reporter   ~0007111

I wanted to add that, I thought it might be a PHP issue, but even reverting to PHP 8.3 doesn't fix the issue.

Also, I cannot revert to 3.3.2 as it seems not available anymore on the repository from which I installed it using apt, or at least apt doesn't find version 3.3.2

So, for the time being, I need to disable the extension.

derick

2024-12-13 17:40

administrator   ~0007117

This turned out to be a similar issue than 0002305 and 0002307 — at least it has the same cause.

I have made a PR: https://github.com/xdebug/xdebug/pull/986

Would you be able to check the xdebug_3_4 branch from Xdebug's Github (once it's merged)?

mtassinari

2024-12-16 07:13

reporter   ~0007121

I do not think I have ever compiled a PHP extension manually, but I can try.

I'll let you know.

mtassinari

2024-12-16 07:35

reporter   ~0007122

Ok, so, I compiled it and I think I did all correctly, as now I see I am using xdebug 3.4.1-dev

$ php -v
PHP 8.4.1 (cli) (built: Nov 25 2024 18:03:47) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.1, Copyright (c) Zend Technologies
with Xdebug v3.4.1-dev, Copyright (c) 2002-2024, by Derick Rethans

However, I still get the segmentation fault when I do not listen for connections in my IDE.

mtassinari

2025-01-02 08:14

reporter   ~0007135

I tested this again using the updated branch 3.4, and now it seems fixed.

derick

2025-01-06 15:34

administrator   ~0007142

Fixed for 3.4.1.

Issue History

Date Modified Username Field Change
2024-12-03 07:57 mtassinari New Issue
2024-12-03 07:57 mtassinari Tag Attached: php8.4
2024-12-03 07:57 mtassinari Tag Attached: segfault
2024-12-03 10:38 mtassinari Note Added: 0007111
2024-12-13 17:40 derick Assigned To => derick
2024-12-13 17:40 derick Status new => resolved
2024-12-13 17:40 derick Resolution open => duplicate
2024-12-13 17:40 derick Note Added: 0007117
2024-12-13 17:40 derick Relationship added duplicate of 0002307
2024-12-16 07:13 mtassinari Note Added: 0007121
2024-12-16 07:35 mtassinari Note Added: 0007122
2025-01-02 08:14 mtassinari Note Added: 0007135
2025-01-06 15:34 derick Status resolved => closed
2025-01-06 15:34 derick Fixed in Version => 3.4dev
2025-01-06 15:34 derick Note Added: 0007142
2025-01-06 15:35 derick Fixed in Version 3.4dev => 3.4.1