View Issue Details

IDProjectCategoryView StatusLast Update
0002216XdebugUncategorizedpublic2024-02-21 09:52
Reporterkieranfj Assigned Toderick  
PrioritynormalSeveritycrashReproducibilityalways
Status acknowledgedResolutionopen 
PlatformWindowsOSWindowsOS Version11/10
Product Version3.3.0alpha3 
Summary0002216: 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
Process doesnt end and subsequent requests never returned
Turning off xdebug an Apache/PHP works as normal.

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
Run script multiple times in quick succession (Hammer refresh 4/5 times quickly) CPU usage of apache process rises and subsequent requests dont return.

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
xdebug 3.3.0alpha3

TagsNo 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
phpinisettings.txt (156 bytes)   
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

xdebug.log (5,516 bytes)   
xdebugtest.php (96 bytes)   
<?php

error_reporting ( E_ALL ^ E_WARNING ^ E_NOTICE ^ E_DEPRECATED);

echo "test";
die();
xdebugtest.php (96 bytes)   
Operating SystemWindows
PHP Version8.2.0-8.2.9

Activities

soulflyman

2023-12-04 15:55

reporter   ~0006701

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?

Neil

2023-12-12 23:05

reporter   ~0006726

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.

derick

2023-12-15 12:26

administrator   ~0006730

I have released Xdebug 3.3.1, in which I believe these issues are fixed. Could you all please try that version?

Neil

2023-12-15 20:37

reporter   ~0006732

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
xdebug.mode = debug
xdebug.mode = trace

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.

kieranfj

2023-12-15 20:49

reporter   ~0006733

Installed xdebug 3.3.1 and can also confirm the hanging behaviour is still present

Apache 2.4.58
PHP 8.3.0
xDebug 3.3.1 (also previously tried the full 3.3.0 non-alpha version)

Neil

2023-12-16 10:52

reporter   ~0006734

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.

https://www.dropbox.com/scl/fi/fzhythftrv04jybawdztj/xdebug_hang.mp4?rlkey=h6twyjhhyaf6h4tweyfndutdt&amp;dl=0

xdebug_hang_test.zip (7,471 bytes)

Neil

2023-12-16 10:58

reporter   ~0006735

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

derick

2023-12-21 10:22

administrator   ~0006738

I'll have a look after the break.

macgritsch

2024-01-02 17:31

reporter   ~0006745

I can confirm this issue.
Even with version 3.3.1

derick

2024-01-09 12:05

administrator   ~0006757

Can any of you report this on Linux?

Neil

2024-01-09 13:18

reporter   ~0006759

Last edited: 2024-01-10 18:26

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 =========

FROM php:8.3-apache

# Install system dependencies
RUN apt-get update && apt-get install -y \
    git \
    libzip-dev \
    zip \
    && docker-php-ext-install zip

# Enable Apache mod_rewrite
RUN a2enmod rewrite

# Install Xdebug
RUN pecl install xdebug \
    && docker-php-ext-enable xdebug

EXPOSE 80

========= Dockerfile_custom end =========

========= docker-compose.yml start =========

version: '3.8'

services:
  web:
    build:
        context: .
        dockerfile: Dockerfile_custom
    ports:
        - &quot;80:80&quot;
    volumes:
        - C:\docker_www:/var/www/html
        - ./config/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
    stdin_open: true
    tty: true
    restart: &quot;no&quot;

========= docker-compose.yml end =========

========= xdebug.ini start =========

zend_extension=xdebug
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.mode = debug,develop

========= xdebug.ini end =========

xdebug_info(); was used to confirm xdebug was active and the version was 3.3.1

macgritsch

2024-01-09 14:18

reporter   ~0006760

Last edited: 2024-01-10 18:27

I can also not reproduce it on macOS.

test.php:

&lt;?
    error_reporting(0);

    sleep(1);

    echo &quot;SUCCESS\n&quot;;
?>

call in terminal:

for i in {1..100}; do curl &quot;http://host/test.php&quot; &; done

derick

2024-01-10 18:28

administrator   ~0006762

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 mpm_prefork, and not mpm_worker, I believe.

FWIW, I have no Windows to test this on.

Neil

2024-01-12 02:35

reporter   ~0006771

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)

error_reporting(0);
sleep(1);
echo &quot;SUCCESS&quot;;

hiroko

2024-02-11 10:01

reporter   ~0006846

Something not mentioned before:
The issue doesn't happen if the error reporting level is set with the ini_set function.
ini_set('error_reporting', 0);
(Doesn't matter what the value of the second argument is.)

gponty

2024-02-21 09:52

reporter   ~0006850

same thing here with FrankenPHP (Caddy)

Issue History

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