View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000931 | Xdebug | public | 2013-03-04 00:37 | 2013-05-22 03:51 | |
Reporter | payden | Assigned To | derick | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 2.2.1 | ||||
Target Version | 2.2.3 | Fixed in Version | 2.2.3 | ||
Summary | 0000931: xdebug_str_add does not check for NULL str before calling strlen on it. | ||||
Description | I suppose it may just be assumed that calling code should never call xdebug_str_add with a NULL str, but the case is definitely not checked and it has happened in the wild. Serialization of a closure is definitely not allowed in PHP and throws an exception (PHP Bug #64168). When this happens xdebug_str_add gets called with NULL str. I haven't studied xdebug code extensively, but it looks like XG(last_exception_trace) is null in xdebug_error_cb which is called from zend_error_va in zend_exceptions.c. Let me just shut up and post the backtrace: #0 __strlen_sse2_bsf () at ../sysdeps/i386/i686/multiarch/strlen-sse2-bsf.S:51 I dunno, it seems awfully trivial, but should there just be a: if (!str) { at the beginning of xdebug_add_str? | ||||
Steps To Reproduce | Tested with PHP-5.4.12 and Xdebug 2.2.1 and 2.2.0 <?php | ||||
Tags | No tags attached. | ||||
Operating System | Ubuntu 12.10 32-bit | ||||
PHP Version | 5.4.10-5.4.14 | ||||
|
I've looked into this a bit and I'm unsure whether this would be classified as an xdebug problem or PHP problem, but essentially this segfault Fatal error: Uncaught exception 'Exception' with message 'Serialization of 'Closure' is not allowed' in [no active file] on line 0 Exception: Serialization of 'Closure' is not allowed in [no active file] on line 0 This is similar to what I get when I have a script just throw an uncaught exception except there is no stack trace from xdebug. (Obviously) I'm still a PHP internals newbie though, so I'm not sure if that is the "right" thing to do. Backtrace: PHP-5.4.12/xdebug-2.2.1 (gdb) bt |
|
Your fix hides the symptom, but I've made sure that your code example now works. |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-03-04 00:37 | payden | New Issue | |
2013-03-04 03:28 | payden | Note Added: 0002435 | |
2013-05-19 18:32 | derick | Note Added: 0002476 | |
2013-05-19 18:32 | derick | Status | new => closed |
2013-05-19 18:32 | derick | Assigned To | => derick |
2013-05-19 18:32 | derick | Resolution | open => fixed |
2013-05-19 18:32 | derick | Fixed in Version | => 2.2.3 |
2013-05-22 03:51 | derick | Target Version | => 2.2.3 |
2016-07-31 12:35 | derick | Category | Debug client (console) => debugclient (debugging tool) |
2016-07-31 12:35 | derick | Category | debugclient (debugging tool) => (No Category) |