View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001790 | Xdebug | Step Debugging | public | 2020-05-26 15:03 | 2020-05-28 14:38 |
| Reporter | dustinmailc | Assigned To | |||
| Priority | high | Severity | crash | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| OS | Linux | OS Version | Debian | ||
| Product Version | 2.9.5 | ||||
| Fixed in Version | 2.9.6 | ||||
| Summary | 0001790: Segfault in var_dump() or while debugging with protobuf extension | ||||
| Description | While debugging scripts with classes that use the protobuf extension, the php interpreter segfaults reliably when xdebug inspects instances of classes from the extension. The crash also occurs when calling var_dump() with xdebug's var_dump() override enabled. This crash prevents us from using step debugging when the protobuf extension is enabled. | ||||
| Steps To Reproduce | Since this requires a separate extension to reproduce, I put together a containerized demonstration of this here: https://github.com/dcloues/xdebug-protobuf-segfault I used the protobuf extension for this, but I believe the crash will occur with any internal class that has a get_properties() handler that returns null. | ||||
| Additional Information | I tested adding a null check here: https://github.com/xdebug/xdebug/blob/00a928eb760833a07e01a7b17cc040e4f3a8a077/src/lib/var_export_text.c#L250 which seems to resolve the issue. I'd be happy to open a pull request for this change. | ||||
| Tags | SIGSEGV | ||||
| Operating System | Debian Linux | ||||
| PHP Version | 7.4.0-7.4.4 | ||||
|
|
I forgot to include a gdb backtrace from this - sorry about that! I attached it here. |
|
|
Hi Dustin, thanks for the report. It was quite easy to reproduce, even without Docker. However, the fix (https://github.com/xdebug/xdebug/commit/009c26f723ab7680084b90401de17aaeee35c386) wasn't as easy as just adding the test for null on the line that you indicated. In the end, it needed to be done in different places making sure that it wouldn't also ignore the whole class. The fix for this report has just been merged into xdebug_2_9 for the 2.9.6 release, as well as into master. thanks! cheers, |
|
|
Thanks so much! I (and my coworkers) really appreciate it. |