View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002216 | Xdebug | Uncategorized | public | 2023-11-28 09:17 | 2024-04-15 12:49 |
Reporter | kieranfj | Assigned To | derick | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | Windows | OS | Windows | OS Version | 11/10 |
Product Version | 3.3.0alpha3 | ||||
Fixed in Version | 3.3.2 | ||||
Summary | 0002216: With PHP8.3 and Apache 2.4.58 error_reporting() causing Apache process to hang | ||||
Description | Whe running the script multiple times in quick succession, the Apache process hangs and increases CPU usage every time the script is run Happens regardless of php.ini error_reporting setting (whether its changed from the default or not) | ||||
Steps To Reproduce | Run script once via browser request - Apache responds as normal Disable xdebug (comment out the .dll or just turn it off) Apache responds as normal | ||||
Additional Information | Tried on two windows machines, a 10 and 11 Wampserver package (3.3.2, Apahce 2.4.58, PHP 8.3.0) being used | ||||
Tags | No tags attached. | ||||
Attached Files | phpinisettings.txt (156 bytes)
xdebug.mode = develop,debug ;xdebug.mode = off ;xdebug.log_level=0 expose_php = Off ;error_reporting E_ALL ^ E_WARNING ^ E_NOTICE ^ E_DEPRECATED xdebug.log (5,516 bytes)
--- File cleaned up by Wampserver --- --- on 2023-11-28 09:06 [29608] Log closed at 2023-11-28 09:06:59.957190 [14176] Log opened at 2023-11-28 09:07:00.009805 [14176] [Config] INFO: Trigger value for 'XDEBUG_TRIGGER' not found, falling back to 'XDEBUG_SESSION' [14176] [Config] INFO: Trigger value for 'XDEBUG_SESSION' not found, so not activating [14176] Log closed at 2023-11-28 09:07:01.334464 [476] Log opened at 2023-11-28 09:07:18.151201 [476] [Config] INFO: Trigger value for 'XDEBUG_TRIGGER' not found, falling back to 'XDEBUG_SESSION' [476] [Config] INFO: No shared secret: Activating [476] [Step Debug] INFO: Connecting to configured address/port: localhost:9003. [30748] Log opened at 2023-11-28 09:07:18.422583 [30748] [Config] INFO: Trigger value for 'XDEBUG_TRIGGER' not found, falling back to 'XDEBUG_SESSION' [30748] [Config] INFO: No shared secret: Activating [30748] [Step Debug] INFO: Connecting to configured address/port: localhost:9003. [476] [Step Debug] ERR: Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port). [476] Log closed at 2023-11-28 09:07:18.556349 [476] Log opened at 2023-11-28 09:07:18.674514 [476] [Config] INFO: Trigger value for 'XDEBUG_TRIGGER' not found, falling back to 'XDEBUG_SESSION' [476] [Config] INFO: No shared secret: Activating [476] [Step Debug] INFO: Connecting to configured address/port: localhost:9003. [30748] [Step Debug] ERR: Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port). [30904] Log opened at 2023-11-28 09:07:18.945141 [30904] [Config] INFO: Trigger value for 'XDEBUG_TRIGGER' not found, falling back to 'XDEBUG_SESSION' [30904] [Config] INFO: No shared secret: Activating [30904] [Step Debug] INFO: Connecting to configured address/port: localhost:9003. [476] [Step Debug] ERR: Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port). [476] Log closed at 2023-11-28 09:07:19.086892 [476] Log opened at 2023-11-28 09:07:19.217513 [476] [Config] INFO: Trigger value for 'XDEBUG_TRIGGER' not found, falling back to 'XDEBUG_SESSION' [476] [Config] INFO: No shared secret: Activating [476] [Step Debug] INFO: Connecting to configured address/port: localhost:9003. [30904] [Step Debug] ERR: Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port). [6064] Log opened at 2023-11-28 09:07:19.502093 [6064] [Config] INFO: Trigger value for 'XDEBUG_TRIGGER' not found, falling back to 'XDEBUG_SESSION' [6064] [Config] INFO: No shared secret: Activating [6064] [Step Debug] INFO: Connecting to configured address/port: localhost:9003. [476] [Step Debug] ERR: Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port). [476] Log closed at 2023-11-28 09:07:19.632989 [476] Log opened at 2023-11-28 09:07:19.780898 [476] [Config] INFO: Trigger value for 'XDEBUG_TRIGGER' not found, falling back to 'XDEBUG_SESSION' [476] [Config] INFO: No shared secret: Activating [476] [Step Debug] INFO: Connecting to configured address/port: localhost:9003. [6064] [Step Debug] ERR: Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port). [13068] Log opened at 2023-11-28 09:07:20.071560 [13068] [Config] INFO: Trigger value for 'XDEBUG_TRIGGER' not found, falling back to 'XDEBUG_SESSION' [13068] [Config] INFO: No shared secret: Activating [13068] [Step Debug] INFO: Connecting to configured address/port: localhost:9003. [476] [Step Debug] ERR: Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port). [476] Log closed at 2023-11-28 09:07:20.200531 [476] Log opened at 2023-11-28 09:07:20.352985 [476] [Config] INFO: Trigger value for 'XDEBUG_TRIGGER' not found, falling back to 'XDEBUG_SESSION' [476] [Config] INFO: No shared secret: Activating [476] [Step Debug] INFO: Connecting to configured address/port: localhost:9003. [13068] [Step Debug] ERR: Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port). [1084] Log opened at 2023-11-28 09:07:20.635260 [1084] [Config] INFO: Trigger value for 'XDEBUG_TRIGGER' not found, falling back to 'XDEBUG_SESSION' [1084] [Config] INFO: No shared secret: Activating [1084] [Step Debug] INFO: Connecting to configured address/port: localhost:9003. [476] [Step Debug] ERR: Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port). [476] Log closed at 2023-11-28 09:07:20.758954 [476] Log opened at 2023-11-28 09:07:20.917618 [476] [Config] INFO: Trigger value for 'XDEBUG_TRIGGER' not found, falling back to 'XDEBUG_SESSION' [476] [Config] INFO: No shared secret: Activating [476] [Step Debug] INFO: Connecting to configured address/port: localhost:9003. [1084] [Step Debug] ERR: Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port). [476] [Step Debug] ERR: Time-out connecting to debugging client, waited: 200 ms. Tried: localhost:9003 (through xdebug.client_host/xdebug.client_port). [476] Log closed at 2023-11-28 09:07:21.328974 xdebugtest.php (96 bytes)
<?php error_reporting ( E_ALL ^ E_WARNING ^ E_NOTICE ^ E_DEPRECATED); echo "test"; die(); | ||||
Operating System | Windows | ||||
PHP Version | 8.2.0-8.2.9 | ||||
|
Nearly identical problem on my system when using Apache 2.4.58 + php 8.3 + xdebug 3.3.0_8.3 does freeze my Apache process. In my case, the CPU usage does not go up, it just freezes. Running Apache 2.4.58 + php 8.2 + xdebug 3.3.0_8.2 works without any problems. Are there any logs I can provide to help diagnose this problem? |
|
I'm having the same issue with php hanging when running Wampserver 3.3.3 with Apache 2.4.58 + php 8.3 + php_xdebug-3.3.0-8.3-vs16-x86_64.dll while php_xdebug-3.3.0-8.2-vs16-x86_64.dll is working fine on php 8.2 Setting xdebug.mode=off fixes the handing issue. Happy to provide any relevant logs. |
|
I have released Xdebug 3.3.1, in which I believe these issues are fixed. Could you all please try that version? |
|
Unfortunately Xdebug 3.3.1 didn’t fix the issue for me when using xdebug.mode = develop,debug I also checked the following modes individually and get the same issue xdebug.mode = develop When browsing the site normally everything seems fine however when running Playwright tests once specific set of pages handled by one php file consistently triggers the hanging behaviour normally on page 5 of the tested pages. It seems the speed the pages are accessed is a factor. I will investigate further and try and put together a php file that triggers the issue that I can share. If there are any xdebug configurations I can use to log what’s going on please let me know. |
|
Installed xdebug 3.3.1 and can also confirm the hanging behaviour is still present Apache 2.4.58 |
|
Ok, I’ve attached the smallest amount of code that causes the page to hang normally on the second refresh, if you don’t see the issue try refreshing with chrome dev tools open (F12) with the “Disable cache” setting ticked on the “Network tab” The issues goes away if I comment out error_reporting(0); or disable to RewriteRule in the .htaccess file or there is only one image on the page. Let me know if you are not able to reproduce the issue I’m seeing with the attached code, and I can send php.ini and httpd.conf in case there is some that is different from your test environment. See this video of the page loading normally with error_reporting(0); commented out and then hanging once error_reporting(0); is uncommented. |
|
The video link I post was modified by the form, to view it you will need to replace & with & at the end of the url |
|
I'll have a look after the break. |
|
I can confirm this issue. |
|
Can any of you report this on Linux? |
|
I checked my test case in a docker container (based on debian 12) with the following config and there was no issues so I’m assuming the issue is specific to PHP on windows. ========= Dockerfile_custom start =========
========= Dockerfile_custom end ========= ========= docker-compose.yml start =========
========= docker-compose.yml end ========= ========= xdebug.ini start =========
========= xdebug.ini end ========= xdebug_info(); was used to confirm xdebug was active and the version was 3.3.1 |
|
I can also not reproduce it on macOS. test.php:
call in terminal: |
|
I doubt this would reproduce on the CLI with concurrent requests, there is something that happens in a threaded environment I suspect. This is probably also why your Apache/Linux run didn't work. By default it still uses FWIW, I have no Windows to test this on. |
|
I checked and the docker container I used above and it uses mpm_prefork with mod_php (Server API: Apache 2.0 Handler) I did some further testing on windows and the following code only hangs when using mod_php (Server API: Apache 2.0 Handler) but works fine when using mod_fcgid (Server API: CGI/FastCGI) |
|
Something not mentioned before: |
|
same thing here with FrankenPHP (Caddy) |
|
i can report this happening also on Slackware current. DescriptionThe following code:
Seems to randomly hang when called from the line BasicErrorHandler.php:23 of Symfony. I'm running it on a Apache web server. When checking the server status, the process linked to the request is hanged in "W" status (sending response) and the browser received no byte from the server. I run pstack on the process that is handling the request, obtaining the following trace: https://pastebin.com/iNxBiEtn. The part that seems interesting is:
The hang happens not for all the call to the same file, but always at the same line. With XDebug disabled it seems to not happen I'll monitor this thread if you need any more informations PHP Version8.3.3 Operating SystemSlackware-current |
|
Adding to the one before: downgrading to 8.2.13 without changing any configuration or downgrading Xdebug, makes the problem not happen |
|
For the record, I created a minimal reproducer that isn't using Docker: https://github.com/dunglas/frankenphp/issues/563#issuecomment-2009244388 |
|
|
|
Is there a compiled windows version of the dll for PHP 8.3 VS16 TS (64 bit) with the patch to check if the crash has been fixed on windows. |
|
Just to report back, I compiled the 3.3.2-dev release from dunglas:fix/overloaded_functions_zts and the issues I reported in this thread seem to be fixed now. |
|
You can use the artefacts from https://github.com/xdebug/xdebug/actions/runs/8470808863#artifacts I'll remove your attached dlls, as I can't verify where they came from. |
|
Just downloaded php_xdebug-3.3.2-dev-8.2-vs16-x86_64.dll and noticed that phpinfo displays "with Xdebug v3.3.2-dev, Copyright (c) 2002-2023, by Derick Rethans". |
|
No worries Vincent, I'll update that when I make a release. |
Date Modified | Username | Field | Change |
---|---|---|---|
2023-11-28 09:17 | kieranfj | New Issue | |
2023-11-28 09:17 | kieranfj | File Added: phpinisettings.txt | |
2023-11-28 09:17 | kieranfj | File Added: Screenshot 2023-11-28 085400.png | |
2023-11-28 09:17 | kieranfj | File Added: xdebug.log | |
2023-11-28 09:17 | kieranfj | File Added: xdebugtest.php | |
2023-12-04 15:55 | soulflyman | Note Added: 0006701 | |
2023-12-12 23:05 | Neil | Note Added: 0006726 | |
2023-12-15 12:26 | derick | Note Added: 0006730 | |
2023-12-15 20:37 | Neil | Note Added: 0006732 | |
2023-12-15 20:49 | kieranfj | Note Added: 0006733 | |
2023-12-16 10:52 | Neil | Note Added: 0006734 | |
2023-12-16 10:52 | Neil | File Added: xdebug_hang_test.zip | |
2023-12-16 10:58 | Neil | Note Added: 0006735 | |
2023-12-21 10:22 | derick | Assigned To | => derick |
2023-12-21 10:22 | derick | Status | new => acknowledged |
2023-12-21 10:22 | derick | Note Added: 0006738 | |
2024-01-02 17:31 | macgritsch | Note Added: 0006745 | |
2024-01-09 12:05 | derick | Note Added: 0006757 | |
2024-01-09 13:18 | Neil | Note Added: 0006759 | |
2024-01-09 14:18 | macgritsch | Note Added: 0006760 | |
2024-01-10 18:26 | derick | Note Edited: 0006759 | |
2024-01-10 18:27 | derick | Note Edited: 0006760 | |
2024-01-10 18:28 | derick | Note Added: 0006762 | |
2024-01-12 02:35 | Neil | Note Added: 0006771 | |
2024-02-11 10:01 | hiroko | Note Added: 0006846 | |
2024-02-21 09:52 | gponty | Note Added: 0006850 | |
2024-02-25 11:16 | Francexi | Note Added: 0006855 | |
2024-02-25 16:26 | Francexi | Note Added: 0006856 | |
2024-03-20 10:41 | dunglas | Note Added: 0006863 | |
2024-03-28 16:53 | derick | Status | acknowledged => closed |
2024-03-28 16:53 | derick | Resolution | open => fixed |
2024-03-28 16:53 | derick | Fixed in Version | => 3.3dev |
2024-03-28 16:53 | derick | Note Added: 0006870 | |
2024-03-28 16:55 | derick | Relationship added | has duplicate 0002233 |
2024-03-29 01:04 | Neil | Note Added: 0006875 | |
2024-03-29 04:55 | Neil | Note Added: 0006876 | |
2024-03-29 08:02 | derick | Note Added: 0006878 | |
2024-03-29 08:02 | derick | File Deleted: php_xdebug-3.3.2-dev-8.3-vs16-x86_64.dll | |
2024-03-29 09:20 | Vincent T | Note Added: 0006879 | |
2024-03-29 09:45 | derick | Note Added: 0006880 | |
2024-04-15 12:49 | derick | Fixed in Version | 3.3dev => 3.3.2 |