View Issue Details

IDProjectCategoryView StatusLast Update
0002340XdebugStep Debuggingpublic2025-05-02 11:55
Reporterdannyguest Assigned Toderick  
PriorityurgentSeveritymajorReproducibilitysometimes
Status closedResolutionfixed 
PlatformWindowsOSWindowsOS Version11
Product Version3.4.2 
Fixed in Version3.4dev 
Summary0002340: Xdebug case sensitivity issues on some files introduced since 3.3.0
Description

Environment Information:
Running on Windows 11 with WSL2. The source code resides on the Windows file system, while PHP and Nginx are installed on an Ubuntu 22.04 image within WSL2.

Issue: After upgrading Xdebug from version 3.2.1 to 3.4.2, certain files no longer hit breakpoints as expected. This problem did not occur in earlier versions of Xdebug—specifically, everything up to and including 3.3.0alpha2 functioned correctly. However, this behaviour changed starting with version 3.3.0. As we're preparing to upgrade to PHP 8.4, resolving this issue is critical to moving forward.

For example, I have a file named dashboard.php that contains a class called Dashboard with a method named index(). In newer versions of Xdebug, if I set a breakpoint inside the index() method, it doesn't get hit. However, if I rename the file to Dashboard.php (matching the class name), the breakpoint works as expected. What change occurred in Xdebug that caused this behaviour to break and why does it work fine without having to rename the file in older versions?

I've attached logs demonstrating the issue: one from Xdebug 3.3.0alpha2 where the breakpoint is hit as expected, and another from Xdebug 3.4.2 where the same breakpoint fails to trigger.

While my simple example can easily be rectified we have a very large project and renaming all the files is not practical at this stage.

Tagsbreakpoint
Attached Files
xdebug3.3.0Alpha2.log (264,722 bytes)
xdebug3.4.2.log (112,446 bytes)
Operating System
PHP Version8.2.20-8.2.29

Activities

derick

2025-04-24 16:27

administrator   ~0007252

Hi,

This is odd. I had a look at the code difference between 3.3.0alpha2 and 3.3.0, to see if there could have been a change here, but I can't find a possible commit that could have caused this.

Would you be able to run your test again, but this time with xdebug.log_level=11 configured as well? That adds a load more information that could provide an insight.

cheers,
Derick

dannyguest

2025-04-24 18:35

reporter   ~0007259

Hi Derick,

Thanks for picking this up and taking a look for me. Due to the size of one of the files, I’ve uploaded both versions to a shared OneDrive folder:

https://ompensions-my.sharepoint.com/:f:/g/personal/danny_guest_fincalc_co_uk/EhCa6b3yNbVBrVnx4WrYRdEBXHk-gct--bJJ-aKiVAJYLA?e=YjKlLr

I’ve tested the same scenario using version 3.3.0, where the breakpoint does not trigger, and 3.3.0 Alpha 2, where it does work as expected.

Really appreciate your help looking into this.

Best regards,
Danny

dannyguest

2025-04-24 18:44

reporter   ~0007260

I don’t have full context, but the only change that seems like it could have caused this is in version 3.3.0Alpha3, where it mentions: 'Fixed bug 0002206: Optimize debugger breakpoints checking.' That might be related?"

derick

2025-05-02 10:57

administrator   ~0007274

You're absolutely right. After readying through the patch for that again, I found (https://github.com/xdebug/xdebug/commit/68342a73330c1c3ce13e054a1964fc56fb94c9e7#diff-d4b049f95775849818cf2c0c6dbcaf0569810a7e7030cdd237073634abcb497eL2737):

-   if (strncasecmp(ZSTR_VAL(brk->filename), tmp_file, ZSTR_LEN(brk->filename)) == 0) {
+   if (zend_string_equals(brk->filename, resolved_filename)) {

The old one uses case-sensitive comparison (strncasecmp) and the new version uses an equality check (zend_string_equals).

Now let's see if I can create a reproducible case (should be easy), and then fix it.

derick

2025-05-02 11:32

administrator   ~0007275

https://github.com/xdebug/xdebug/pull/1018

dannyguest

2025-05-02 11:41

reporter   ~0007276

Derick that is great news and thank you for investigating and fixing the issue. When can we expect it to make it's way into a full release?

derick

2025-05-02 11:55

administrator   ~0007278

I'm hoping to fix 0002332 and 0002339 today, and then in the next few days make a release.

Issue History

Date Modified Username Field Change
2025-04-23 12:08 dannyguest New Issue
2025-04-23 12:08 dannyguest Tag Attached: breakpoint
2025-04-23 12:08 dannyguest File Added: xdebug3.3.0Alpha2.log
2025-04-23 12:08 dannyguest File Added: xdebug3.4.2.log
2025-04-24 16:27 derick Assigned To => derick
2025-04-24 16:27 derick Status new => feedback
2025-04-24 16:27 derick Note Added: 0007252
2025-04-24 18:35 dannyguest Note Added: 0007259
2025-04-24 18:35 dannyguest Status feedback => assigned
2025-04-24 18:44 dannyguest Note Added: 0007260
2025-05-02 10:57 derick Note Added: 0007274
2025-05-02 11:32 derick Status assigned => closed
2025-05-02 11:32 derick Resolution open => fixed
2025-05-02 11:32 derick Fixed in Version => 3.4dev
2025-05-02 11:32 derick Note Added: 0007275
2025-05-02 11:41 dannyguest Note Added: 0007276
2025-05-02 11:55 derick Note Added: 0007278