View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002329 | Xdebug | Step Debugging | public | 2025-03-13 04:31 | 2025-04-25 05:31 |
Reporter | azhrei | Assigned To | derick | ||
Priority | high | Severity | block | Reproducibility | always |
Status | assigned | Resolution | open | ||
Platform | Apple M3 Max | OS | macOS Sequoia | OS Version | 15.3.1 |
Product Version | 3.4.2 | ||||
Summary | 0002329: Xdebug causes crash with SIGSEGV | ||||
Description | I've tracked the problem down to an incompletely initialized context object passed into xdebug_dbgp_init(). I specified the category as Step Debugging because that's what I'm after, but after looking at the rest of the report, you may decide it should be one of the DBGp types or even something else. | ||||
Steps To Reproduce | I enable Xdebug and the next time PHP is executed, it crashes. | ||||
Additional Information | I ran Apache in lldb and waited for xdebug to crash. When I found the instruction was "register+offset", I figured it was a structure member reference, and sure enough, the relevant line contained such a reference. I verified that it was the "program_name" field inside xdebug_con and then decided to file this bug report. Here's the area around the crash as reported by lldb (with symbol table source information). frame #0: 0x0000000102a193cc xdebug.so`xdebug_dbgp_init [inlined] zend_string_equals_cstr(s1=0x0000000000000000, s2=<unavailable>, s2_length=1) at zend_string.h:368:9 [opt] When I go up one stack frame, I find out where it was called from: frame #1: 0x0000000102a193cc xdebug.so`xdebug_dbgp_init(context=0x0000000102a3da30, mode=<unavailable>) at handler_dbgp.c:2379:6 [opt] In frame #1, immediately above, lldb has highlighted the first occurrence of "zend_string..." on line 2379 (it just doesn't show here). I'm going to try adding a not-NULL check for context->program_name to see if that solves the immediate issue, but that's likely not the correct the fix — the correct fix is to determine why it's not initialized as it should be. | ||||
Tags | crash, SIGSEGV | ||||
Operating System | macOS | ||||
PHP Version | 8.3.10-8.3.19 | ||||
|
As expected, adding the "context->program_name" check in the IF stmt simply pushed the error into xdebug_path_to_url() because the fileurl variable is NULL. While I've done a lot of C programming over the years, I'm not familiar with xdebug or php internals, so I'm done for now. But if you need any additional information, don't hesitate to ask — I'm motivated to get this working! |
|
Hm. Now I'm not having a problem — no crash. :( I scrolled back a few thousand lines in my terminal history (!) and found the full stack trace, since that might be useful: (lldb) bt
|
|
I have seen other rumours that looked the same, but I have never managed to be able to replicate this issue. If you can do this reliably, can you provide more information? |
|
Could you please provide the requested feedback? |
|
I have attempted to retrieve all commits to my project around the timeframe of the original report (Mar 9th through Mar 14th) and have been unable to recreate the issue. This is running PHP 8.3.19; it's possible that I was running a slightly earlier version of PHP at the time of this report. I do remember that it was at the very beginning of the debug session, because it would crash while processing the Since I can't replicate it, I suppose this should be closed. I will repost if/when I'm able to create it again. |
Date Modified | Username | Field | Change |
---|---|---|---|
2025-03-13 04:31 | azhrei | New Issue | |
2025-03-13 04:31 | azhrei | Tag Attached: crash | |
2025-03-13 04:31 | azhrei | Tag Attached: SIGSEGV | |
2025-03-13 04:39 | azhrei | Note Added: 0007212 | |
2025-03-14 00:32 | azhrei | Note Added: 0007215 | |
2025-04-08 12:57 | derick | Assigned To | => derick |
2025-04-08 12:57 | derick | Status | new => feedback |
2025-04-08 12:57 | derick | Note Added: 0007242 | |
2025-04-24 16:33 | derick | Note Added: 0007257 | |
2025-04-25 05:31 | azhrei | Note Added: 0007261 | |
2025-04-25 05:31 | azhrei | Status | feedback => assigned |