View Issue Details

IDProjectCategoryView StatusLast Update
0000972XdebugUncategorizedpublic2016-11-28 23:34
Reportersebastian Assigned Toderick  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionno change required 
Platformx86_64OSLinuxOS Version3.10.9-200.fc19
Product Version2.2dev 
Summary0000972: Xdebug crashes on request to non-existing file with built-in webserver
Description

There is a segfault in Xdebug's code (likely an infinite recursion) when a non-existing file is requested from PHP's built-in webserver.

Steps To Reproduce

php -S localhost:8888 /tmp

wget http://localhost:8888/not_existing_file

Additional Information

? ~ gdb php
GNU gdb (GDB) Fedora (7.6-34.fc19)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /usr/local/php-5.5/bin/php...done.
(gdb) r -S localhost:8888 /tmp
Starting program: /usr/local/php-5.5/bin/php -S localhost:8888 /tmp
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
PHP 5.5.4-dev Development Server started at Tue Aug 27 11:10:39 2013
Listening on http://localhost:8888
Document root is /home/sb
Press Ctrl-C to quit.

Program received signal SIGSEGV, Segmentation fault.
0x0000000000903c63 in _zend_mm_alloc_int (heap=<error reading variable: Cannot access memory at address 0x7fffff7fef68>,
size=<error reading variable: Cannot access memory at address 0x7fffff7fef60>, zend_filename=<error reading variable: Cannot access memory at address 0x7fffff7fef58>,
__zend_lineno=<error reading variable: Cannot access memory at address 0x7fffff7fef54>,
zend_orig_filename=<error reading variable: Cannot access memory at address 0x7fffff7fef48>,
zend_orig_lineno=<error reading variable: Cannot access memory at address 0x7fffff7fef50>) at /usr/local/src/php/src/Zend/zend_alloc.c:1881
1881 {
Missing separate debuginfos, use: debuginfo-install pcre-8.32-7.fc19.x86_64 xz-libs-5.1.2-4alpha.fc19.x86_64
(gdb) bt
#0 0x0000000000903c63 in _zend_mm_alloc_int (heap=<error reading variable: Cannot access memory at address 0x7fffff7fef68>,
size=<error reading variable: Cannot access memory at address 0x7fffff7fef60>, __zend_filename=<error reading variable: Cannot access memory at address 0x7fffff7fef58>,
zend_lineno=<error reading variable: Cannot access memory at address 0x7fffff7fef54>,
zend_orig_filename=<error reading variable: Cannot access memory at address 0x7fffff7fef48>,
zend_orig_lineno=<error reading variable: Cannot access memory at address 0x7fffff7fef50>) at /usr/local/src/php/src/Zend/zend_alloc.c:1881
#1 0x00000000009048e7 in _zend_mm_realloc_int (heap=0x11e4970, p=0x0, size=506, zend_filename=0xe68f08 "/usr/local/src/php/src/main/spprintf.c", __zend_lineno=777,
zend_orig_filename=0x0, zend_orig_lineno=0) at /usr/local/src/php/src/Zend/zend_alloc.c:2134
0000002 0x0000000000905a73 in _erealloc (ptr=0x0, size=506, allow_failure=0, __zend_filename=0xe68f08 "/usr/local/src/php/src/main/spprintf.c",
zend_lineno=777,
zend_orig_filename=0x0, zend_orig_lineno=0) at /usr/local/src/php/src/Zend/zend_alloc.c:2450
0000003 0x00000000008b15b9 in xbuf_format_converter (xbuf=0x7fffff7ffac0, fmt=0x7ffff10496f2 "s", ap=0x7fffff7ffb10) at /usr/local/src/php/src/main/spprintf.c:777
0000004 0x00000000008b18c6 in vspprintf (pbuf=0x7fffff7ffb08, max_len=0, format=0x7ffff10496f1 "%s", ap=0x7fffff7ffb10) at /usr/local/src/php/src/main/spprintf.c:799
0000005 0x00000000008a841f in php_printf (format=0x7ffff10496f1 "%s") at /usr/local/src/php/src/main/main.c:686
0000006 0x00007ffff1036c1a in php_output_error () from /usr/local/php-5.5/lib/php/extensions/debug-non-zts-20121212/xdebug.so
0000007 0x00007ffff1037166 in xdebug_error_cb () from /usr/local/php-5.5/lib/php/extensions/debug-non-zts-20121212/xdebug.so
0000008 0x00007ffff1037575 in xdebug_error_cb () from /usr/local/php-5.5/lib/php/extensions/debug-non-zts-20121212/xdebug.so
0000009 0x00007ffff1037575 in xdebug_error_cb () from /usr/local/php-5.5/lib/php/extensions/debug-non-zts-20121212/xdebug.so
.
.
.

TagsNo tags attached.
Operating SystemLinux 3.10.9-200.fc19.x86_64
PHP Version5.1.0

Activities

derick

2013-09-28 12:50

administrator   ~0002560

I can't seem to reproduce this. Could you list your settings for xdebug from phpinfo()?

sebastian

2013-09-29 11:00

reporter   ~0002568

xdebug support => enabled
xdebug.auto_trace => Off => Off
xdebug.cli_color => 0 => 0
xdebug.collect_assignments => Off => Off
xdebug.collect_includes => On => On
xdebug.collect_params => 0 => 0
xdebug.collect_return => Off => Off
xdebug.collect_vars => Off => Off
xdebug.coverage_enable => On => On
xdebug.default_enable => On => On
xdebug.dump.COOKIE => no value => no value
xdebug.dump.ENV => no value => no value
xdebug.dump.FILES => no value => no value
xdebug.dump.GET => no value => no value
xdebug.dump.POST => no value => no value
xdebug.dump.REQUEST => no value => no value
xdebug.dump.SERVER => no value => no value
xdebug.dump.SESSION => no value => no value
xdebug.dump_globals => On => On
xdebug.dump_once => On => On
xdebug.dump_undefined => Off => Off
xdebug.extended_info => On => On
xdebug.file_link_format => no value => no value
xdebug.idekey => no value => no value
xdebug.max_nesting_level => 0 => 0
xdebug.overload_var_dump => On => On
xdebug.profiler_aggregate => Off => Off
xdebug.profiler_append => Off => Off
xdebug.profiler_enable => Off => Off
xdebug.profiler_enable_trigger => Off => Off
xdebug.profiler_output_dir => /tmp => /tmp
xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p
xdebug.remote_autostart => Off => Off
xdebug.remote_connect_back => Off => Off
xdebug.remote_cookie_expire_time => 3600 => 3600
xdebug.remote_enable => Off => Off
xdebug.remote_handler => dbgp => dbgp
xdebug.remote_host => localhost => localhost
xdebug.remote_log => no value => no value
xdebug.remote_mode => req => req
xdebug.remote_port => 9000 => 9000
xdebug.scream => Off => Off
xdebug.show_exception_trace => Off => Off
xdebug.show_local_vars => Off => Off
xdebug.show_mem_delta => Off => Off
xdebug.trace_enable_trigger => Off => Off
xdebug.trace_format => 0 => 0
xdebug.trace_options => 0 => 0
xdebug.trace_output_dir => /tmp => /tmp
xdebug.trace_output_name => trace.%c => trace.%c
xdebug.var_display_max_children => 128 => 128
xdebug.var_display_max_data => 512 => 512
xdebug.var_display_max_depth => 3 => 3

sebastian

2013-09-29 11:01

reporter   ~0002569

The segfault happens on the second request, ie. "wget http://localhost:8888/not_existing_file" needs to be invoked twice.

derick

2013-10-14 00:45

administrator   ~0002584

Okay, I can reproduce this now. But only with PHP 5.5 and not PHP 5.4.

derick

2016-11-28 21:03

administrator   ~0003817

I can no longer reproduce this. Can you?

sebastian

2016-11-28 21:36

reporter   ~0003832

No.

derick

2016-11-28 23:34

administrator   ~0003837

Okay - marking it as closed then.

Issue History

Date Modified Username Field Change
2013-08-27 09:16 sebastian New Issue
2013-09-28 12:50 derick Note Added: 0002560
2013-09-28 12:50 derick Assigned To => derick
2013-09-28 12:50 derick Status new => feedback
2013-09-29 11:00 sebastian Note Added: 0002568
2013-09-29 11:00 sebastian Status feedback => assigned
2013-09-29 11:01 sebastian Note Added: 0002569
2013-10-14 00:45 derick Note Added: 0002584
2016-07-31 12:36 derick Category Usage problems => Usage problems (Crashes)
2016-07-31 12:38 derick Category Usage problems (Crashes) => Usage problems (Wrong Results)
2016-11-28 21:03 derick PHP Version 5.5-dev => 5.1.0
2016-11-28 21:03 derick Note Added: 0003817
2016-11-28 21:03 derick Status assigned => feedback
2016-11-28 21:36 sebastian Note Added: 0003832
2016-11-28 21:36 sebastian Status feedback => assigned
2016-11-28 23:34 derick Note Added: 0003837
2016-11-28 23:34 derick Status assigned => resolved
2016-11-28 23:34 derick Resolution open => no change required
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized