View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002329 | Xdebug | Step Debugging | public | 2025-03-13 04:31 | 2025-03-14 00:32 |
Reporter | azhrei | Assigned To | |||
Priority | high | Severity | block | Reproducibility | always |
Status | new | 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
|