View Issue Details

IDProjectCategoryView StatusLast Update
0002144XdebugUncategorizedpublic2023-01-27 14:25
Reporterphysikbuddha Assigned Toderick  
PriorityurgentSeveritycrashReproducibilityalways
Status feedbackResolutionopen 
Target Version3.2dev 
Summary0002144: Xdebug 3.2.0 ignores xdebug.mode and enables all features
Description

Affected enviroment: Windows (haven't tried with *nix)
Affected Xdebug version: 3.2.0
Affected PHP version: All (I tried with PHP 8.1.0, 8.1.12, as well as the new 8.2.0)

I wanted to try out the new Xdebug 3.2.0 and installed it on my local machine.
I noticed that debugging got way slower after the update, so I did some testing:

At first some numbers: Executing a certain command (that is flushing the cache on a TYPO3 instance) took:

  • Without Xdebug: 7 seconds
  • With Xdebug 3.1.6: 20 seconds
  • With Xdebug 3.2.0: 1 minute, 15 seconds

I then noticed that my tmp directory was growing pretty fast, because every request I made caused Xdebug to output a profiling cachegrind file.
However, I didn't enable profiling in the first place. My xdebug.mode setting just contains "debug".

After some more testing, I came to the conclusion that Xdebug 3.2.0 almost completly ignores my xdebug.mode setting.
Setting it to "off" disables Xdebug like it should. However, setting it to any other value (including multiple values by comma separating them) enables every single feature.
This is what causes the great performance hit.

I attached two screenshots showing the output of xdebug_info(). Both versions were set to the same xdebug.mode value "debug".
But the enabled feature set is quite different.

Steps To Reproduce

Install Xdebug 3.2.0 with any PHP version you like (tried with 8.1.0, 8.1.12, 8.2.0) on Windows.
In php.ini, set xdebug.mode to debug.
Run xdebug_info() and take a look at the enabled features.

Additional Information

Minimal Xdebug configuration in php.ini to reproduce:

[XDebug]
zend_extension = path\to\php_xdebug-3.2.0-8.2-vs16-x86_64.dll
xdebug.mode = debug

TagsNo tags attached.
Operating SystemWindows 10 Pro 22H2
PHP Version8.1.10-8.1.19

Relationships

has duplicate 0002149 resolvedderick Stack Traces are shown even when xdebug is running in mode 'debug' 

Activities

physikbuddha

2022-12-11 14:41

reporter  

derick

2022-12-12 09:37

administrator   ~0006474

Hi,

I can't seem to reproduce this with Linux and PHP's built-in web server.

What is your set up? Do you use Apache, or IIS, or something else? Could you try with PHP's built-in web server?

I ran my test as follows, on a command prompt:

php -n -d xdebug.mode=debug -d zend_extension=xdebug -S localhost:9242

You might have to change paths. The -n disables all ini settings

And then opened http://localhost:9242/info.php in my browser, which contained only a call to xdebug_info().

I will have a look later on Windows, but it would help me if you let me know more about your setup.

cheers,
Derick

physikbuddha

2022-12-12 10:21

reporter   ~0006477

Okay, so I can confirm that it's working just fine with the PHP integrated webserver (like it should).

The error occurred on a standard XAMPP installation (that I was using as a quick development server).

These are the minimal steps to reproduce it:

  • Download the current (8.1.12) version at https://www.apachefriends.org/de/index.html

  • Install it to the default directory C:\xampp and uncheck every feature you can (we just need Apache and PHP; you can't uncheck them)

  • Copy php_xdebug-3.1.6-8.1-vs16-x86_64.dll and php_xdebug-3.2.0-8.1-vs16-x86_64.dll to C:\xampp\php\ext

  • Edit C:\xampp\php\php.ini and add:
    [XDebug]
    zend_extension = C:\xampp\php\ext\php_xdebug-3.2.0-8.1-vs16-x86_64.dll
    xdebug.mode = debug

  • Remove everything in C:\xampp\php\htdocs and add a xdebug.php containing:
    <?php
    xdebug_info();

  • Run Apache from the Control Panel or by executing C:\xampp\apache_start.bat

  • Open http://localhost/xdebug.php

  • All Xdebug features are enabled (but they shouldn't)

  • Optional: Stop Apache, change the xdebug extension to 3.1.6 in php.ini - the Xdebug feature list will only show the Step Debugger now

physikbuddha

2022-12-12 10:22

reporter   ~0006478

So maybe I should report this to the Apache foundation then?

But I wonder why this error didn't occur before. I was able to use Xdebug with a standard XAMPP installation for years just fine.

physikbuddha

2022-12-12 10:23

reporter   ~0006479

Apache Friends, not Apache foundation.

(Sorry, I can't seem to edit my comments here).

derick

2022-12-18 15:50

administrator   ~0006493

Hi,

I have tried this now, and I can indeed reproduce this. I think I also have a vague idea where and why this happens. The problem is is that I don't know how to debug this properly on Windows, so I am going to have to see if I can reproduce this on Linux. But now I know what the issue could be, that is easier.

You don't need to report this to the Apache Friends people.

cheers,
Derick

AnrDaemon

2022-12-20 21:02

reporter   ~0006495

I've stumbled upon it on CentOS 7.9.2009 with latest PHP and XDebug from remi-php80.
Comparing my older VM with a newly deployed one,

[code]
-<tr><td class="e">Development Helpers</td><td class="v">[x] disabled</td><td class="d">https://xdebug.org/docs/develop&lt;/td>&lt;/tr>
+<tr><td class="e">Development Helpers</td><td class="v">[v] enabled</td><td class="d">https://xdebug.org/docs/develop&lt;/td>&lt;/tr>
-<tr><td class="e">Step Debugger</td><td class="v">[v] enabled</td><td class="d">https://xdebug.org/docs/remote&lt;/td>&lt;/tr>
+<tr><td class="e">Step Debugger</td><td class="v">[x] disabled</td><td class="d">https://xdebug.org/docs/remote&lt;/td>&lt;/tr>
+<tr><td class="e">'xdebug://gateway' pseudo-host support </td><td class="v">yes </td></tr>
+<tr><td class="e">'xdebug://nameserver' pseudo-host support </td><td class="v">yes </td></tr>
-<tr><td class="e">xdebug.client_discovery_header</td><td class="v"><i>no value</i></td><td class="v"><i>no value</i></td></tr>
+<tr><td class="e">xdebug.client_discovery_header</td><td class="v">HTTP_X_FORWARDED_FOR,REMOTE_ADDR</td><td class="v">HTTP_X_FORWARDED_FOR,REMOTE_ADDR</td></tr>
[/code]

P.S.
Please fix collation on database tables.
Database query failed. Error received from database was 0001366: Incorrect string value: '\xE2\x9C\x98 di...' for column bugs.mantis_bugnote_text_table.note at row 1 for the query: INSERT INTO mantis_bugnote_text_table ( note ) VALUES ( ? ).

derick

2022-12-21 10:46

administrator   ~0006496

@AnrDaemon — I'd love to fix the collation, but the last time I tried I ended up messing everything up. Don't really want to do that again.

In any case, what is the web server setup that you use? Apache? Which MPM? Something else?

AnrDaemon

2022-12-21 20:34

reporter   ~0006498

nginx, php-fpm, socket.
Trivial by-the-books setup with

        location ~ ^/.+\.php$ {
                include fastcgi.conf;
                fastcgi_index index.php;
                fastcgi_pass unix:/var/run/xxx.sock;
                fastcgi_read_timeout 180s;
        }

AnrDaemon

2023-01-27 14:17

reporter   ~0006507

Any update on the issue? Sorry to bother, but manually installing 3.1 from PECL is very inconvenient on package managed systems.

derick

2023-01-27 14:25

administrator   ~0006508

No update, I can't reproduce this.

Issue History

Date Modified Username Field Change
2022-12-11 14:41 physikbuddha New Issue
2022-12-11 14:41 physikbuddha File Added: 2022-12-11 15_22_11-Xdebug 3.1.6.png
2022-12-11 14:41 physikbuddha File Added: 2022-12-11 15_23_13-Xdebug 3.2.0.png
2022-12-12 09:37 derick Assigned To => derick
2022-12-12 09:37 derick Status new => feedback
2022-12-12 09:37 derick Note Added: 0006474
2022-12-12 10:21 physikbuddha Note Added: 0006477
2022-12-12 10:21 physikbuddha Status feedback => assigned
2022-12-12 10:22 physikbuddha Note Added: 0006478
2022-12-12 10:23 physikbuddha Note Added: 0006479
2022-12-18 15:50 derick Note Added: 0006493
2022-12-18 15:50 derick Priority normal => urgent
2022-12-18 15:50 derick Severity major => crash
2022-12-18 15:50 derick Status assigned => confirmed
2022-12-18 15:50 derick Target Version => 3.2dev
2022-12-20 21:02 AnrDaemon Note Added: 0006495
2022-12-21 10:46 derick Status confirmed => feedback
2022-12-21 10:46 derick Note Added: 0006496
2022-12-21 10:47 derick Relationship added has duplicate 0002149
2022-12-21 20:34 AnrDaemon Note Added: 0006498
2023-01-27 14:17 AnrDaemon Note Added: 0006507
2023-01-27 14:25 derick Note Added: 0006508