View Issue Details

IDProjectCategoryView StatusLast Update
0002246XdebugStep Debuggingpublic2024-04-15 13:47
Reportervlad.babayan Assigned Toderick  
PriorityurgentSeverityblockReproducibilityalways
Status feedbackResolutionopen 
PlatformAMD64OSWindows 11OS Version22H2
Product Version3.3.1 
Summary0002246: Nginx + PHP-FPM 8.1.27 with Xdebug 3.3.1 502 Bad Gateway Error
Description

I have an Ubuntu 22.04 VirtualBox VM, with Docker installed on it with 2 containers - nginx:latest configured for fastcgi_pass and php-fpm:8.1.27-fpm. There is a simple 'Hello World' index.php. When I make a GET request with Postman to Nginx container, it gives 502 bad gateway error (with Xdebug 3.3.1). When I downgrade to Xdebug 3.2.2, it gives 200 OK.

Steps To Reproduce

Provision an Ubuntu 22.04 VM, Install Docker on it, run Nginx and PHP-FPM containers, configure them, install Xdebug on PHP-FPM container, make GET requests with Postman or even via browser.

Additional Information

php -v
PHP 8.1.27 (cli) (built: Feb 1 2024 03:02:44) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.27, Copyright (c) Zend Technologies
with Xdebug v3.3.1, Copyright (c) 2002-2023, by Derick Rethans

########

php.ini # (Xdebug Part)

########

[xsl]
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20210902/xdebug.so
extension=timezonedb.so
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=5
opcache.fast_shutdown=1
opcache.enable_cli=1

[XDebug]
xdebug.mode=debug
xdebug.discover_client_host=On
xdebug.client_port=9000
xdebug.var_display_max_data=-1
xdebug.var_display_max_children=-1

###########

Nginx Conf

###########

server {
listen 0.0.0.0:80;
root /var/www/html;
location / {
index index.php index.html;
}
location ~ .php$ {
include fastcgi_params;
fastcgi_pass php-fpm:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}
}

Tagsphp8.1, xdebug
Operating SystemWindows 11 22H2
PHP Version8.1.10-8.1.19

Activities

incon

2024-02-23 06:10

reporter   ~0006851

I had the same issue with PHP 8.1 and Xdebug 3.3.1 on an M2 Macbook Pro. Downgrading to 3.2.2 has worked for me also.
More information on my issue and be found here https://github.com/nicoverbruggen/phpmon/discussions/280

RiseAndCry

2024-02-23 09:30

reporter   ~0006852

same issue as well (PHP 8.1, Xdebug 3.3.2, M2 Macbook Pro), only when listening to xdebug connections (PhpStorm), downgrading to 3.2.2 worked.

RiseAndCry

2024-02-23 09:40

reporter   ~0006853

Xdebug 3.3.1* :)

vlad.babayan

2024-02-23 12:09

reporter   ~0006854

The latest working version is 3.3.0alpha2, starting from 3.3.0alpha3 there is this problem.

pilif

2024-02-29 12:25

reporter   ~0006857

I have the same crash. the backtrace points at Xdebug:

GI___memmove_falkor () at ../sysdeps/aarch64/multiarch/memcpy_falkor.S:310
310 ../sysdeps/aarch64/multiarch/memcpy_falkor.S: No such file or directory.
(gdb) bt
#0
GI___memmove_falkor () at ../sysdeps/aarch64/multiarch/memcpy_falkor.S:310
#1 0x0000ffff7c2afd5c in xdebug_str_internal_addl (f=0, le=18, str=0xffff7c2d7fd0 "<tr><td class=\"i\">",
xs=0xaaaac3bd2ca0) at /build/downloads/xdebug/src/lib/str.c:44
0000002 xdebug_str_addl (xs=0xaaaac3bd2ca0, str=str@entry=0xffff7c2d7fd0 "<tr><td class=\"i\">", le=le@entry=18,
f=f@entry=0) at /build/downloads/xdebug/src/lib/str.c:60
0000003 0x0000ffff7c2ae258 in xdebug_diagnostic_log (
message=0xaaaac3cfbe30 "Select failed: Bad file descriptor", error_code=0xffff7c2d6b50 "CTRL-SELECT",
log_level=<optimized out>, channel=0) at /build/downloads/xdebug/src/lib/log.c:106
0000004 xdebug_log_ex (channel=channel@entry=0, log_level=log_level@entry=3,
error_code=error_code@entry=0xffff7c2d6b50 "CTRL-SELECT",
fmt=fmt@entry=0xffff7c2d6b38 "Select failed: %s") at /build/downloads/xdebug/src/lib/log.c:170
0000005 0x0000ffff7c2a86c8 in xdebug_control_socket_handle ()
at /build/downloads/xdebug/src/base/ctrl_socket.c:256
0000006 0x0000aaaab0855f6c in zend_llist_apply_with_argument (l=<optimized out>,
func=func@entry=0xaaaab0883194 <zend_extension_statement_handler>, arg=0xffff7c813020)
at /build/downloads/php-8.3.2/Zend/zend_llist.c:236
0000007 0x0000aaaab04a385c in ZEND_EXT_STMT_SPEC_HANDLER ()
at /build/downloads/php-8.3.2/Zend/zend_vm_execute.h:3035
0000008 0x0000aaaab08e5d14 in execute_ex (ex=0x1555587823dc0)
at /build/downloads/php-8.3.2/Zend/zend_vm_execute.h:57296
0000009 0x0000ffff79458440 in ?? () from /opt/php/8.3/lib/php/extensions/no-debug-non-zts-20230831/blackfire.so
0000010 0x0000aaaab08e5f8c in zend_execute (op_array=0xffff7c8fe000, return_value=<optimized out>)
at /build/downloads/php-8.3.2/Zend/zend_vm_execute.h:61604
0000011 0x0000ffff79476480 in bf_load_embedded_code ()
from /opt/php/8.3/lib/php/extensions/no-debug-non-zts-20230831/blackfire.so
0000012 0x0000ffff7945da28 in zm_activate_blackfire ()
from /opt/php/8.3/lib/php/extensions/no-debug-non-zts-20230831/blackfire.so
0000013 0x0000aaaab086a8b0 in zend_activate_modules () at /build/downloads/php-8.3.2/Zend/zend_API.c:3202
0000014 0x0000aaaab07f95b8 in php_request_startup () at /build/downloads/php-8.3.2/main/main.c:1805
0000015 0x0000aaaab04b0fe0 in main (argc=<optimized out>, argv=<optimized out>)
at /build/downloads/php-8.3.2/sapi/fpm/fpm/fpm_main.c:1859

pilif

2024-02-29 12:31

reporter   ~0006858

seeing that the backtrace points at the control socket, I have set

xdebug.control_socket=off

in my php.ini as I don't need this feature. This has solved the crash for me.

incon

2024-03-01 01:40

reporter   ~0006859

xdebug.control_socket=off did not work for me with PHP 8.1

derick

2024-04-15 13:47

administrator   ~0006911

I have released Xdebug 3.3.1, which could have fixed this issue. Can you please try it? (I don't think it will, but it would be good to test. And it does fix some other bugs too)

Issue History

Date Modified Username Field Change
2024-02-12 18:08 vlad.babayan New Issue
2024-02-12 18:08 vlad.babayan Tag Attached: php8.1
2024-02-12 18:08 vlad.babayan Tag Attached: xdebug
2024-02-23 06:10 incon Note Added: 0006851
2024-02-23 09:30 RiseAndCry Note Added: 0006852
2024-02-23 09:40 RiseAndCry Note Added: 0006853
2024-02-23 12:09 vlad.babayan Note Added: 0006854
2024-02-29 12:25 pilif Note Added: 0006857
2024-02-29 12:31 pilif Note Added: 0006858
2024-03-01 01:40 incon Note Added: 0006859
2024-04-15 13:47 derick Assigned To => derick
2024-04-15 13:47 derick Status new => feedback
2024-04-15 13:47 derick Note Added: 0006911