View Issue Details

IDProjectCategoryView StatusLast Update
0000875XdebugUncategorizedpublic2012-12-18 13:08
Reportertploch Assigned Toderick  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionnot fixable 
PlatformLinuxOSUbuntu 64OS Version12.04 LTS
Product Version2.2.1 
Summary0000875: xdebug causes segfault when using mocked SoapClient in PHPUnit
Description

When using PHPUnit 3.6.12 and Soap extension 0.13.0, using a mocked abstract class together with a mocked soap client causes xdebug (actually I am not sure about this, but the backtrace indicates that xdebug is in there) to crash with a segfault. Unfortunately I havn't been able to reproduce that in a small piece of code, so I added a gist that provides all the things I have done.

Steps To Reproduce

https://gist.github.com/cc37549c71f51c5968b0

Additional Information

GDB backtrace:

#0 _zval_ptr_dtor (zval_ptr=0x7fffffff8c08) at /build/buildd/php5-5.3.15/Zend/zend.h:385
#1 0x0000000000690d6e in zend_call_function (fci=0x7ffff7ecc237, fci_cache=0x7ffff7ecc240)
at /build/buildd/php5-5.3.15/Zend/zend_execute.h:318
0000002 0x00000000005cd768 in zif_array_map (ht=-29688, return_value=0x15ae100, return_value_ptr=0x7f,
this_ptr=0x7ffff5f03728, return_value_used=8)
at /build/buildd/php5-5.3.15/ext/standard/array.c:4326
0000003 0x00007ffff4e94cf5 in xdebug_execute_internal (current_execute_data=0x7ffff7ecc058,
return_value_used=1) at /tmp/pear/temp/xdebug/xdebug.c:1483
0000004 0x0000000000712834 in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7ecc058)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:322
0000005 0x00000000006c39bb in execute (op_array=0x17faf40)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:107
0000006 0x00007ffff4e96a73 in xdebug_execute (op_array=0x17faf40) at /tmp/pear/temp/xdebug/xdebug.c:1391
0000007 0x000000000071251c in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7ecba30)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:344
0000008 0x00000000006c39bb in execute (op_array=0x17fd6e0)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:107
0000009 0x00007ffff4e96a73 in xdebug_execute (op_array=0x17fd6e0) at /tmp/pear/temp/xdebug/xdebug.c:1391
0000010 0x000000000071251c in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7ecb3d0)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:344
0000011 0x00000000006c39bb in execute (op_array=0x17d1ea8)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:107
0000012 0x00007ffff4e96a73 in xdebug_execute (op_array=0x17d1ea8) at /tmp/pear/temp/xdebug/xdebug.c:1391
0000013 0x000000000071251c in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7ecb230)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:344
0000014 0x00000000006c39bb in execute (op_array=0x1767738)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:107
0000015 0x00007ffff4e96a73 in xdebug_execute (op_array=0x1767738) at /tmp/pear/temp/xdebug/xdebug.c:1391
0000016 0x000000000071251c in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7ecb050)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:344
0000017 0x00000000006c39bb in execute (op_array=0x174c7e0)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:107
0000018 0x00007ffff4e96a73 in xdebug_execute (op_array=0x174c7e0) at /tmp/pear/temp/xdebug/xdebug.c:1391
0000019 0x000000000071251c in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7ecad70)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:344
0000020 0x00000000006c39bb in execute (op_array=0x1592210)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:107
0000021 0x00007ffff4e96a73 in xdebug_execute (op_array=0x1592210) at /tmp/pear/temp/xdebug/xdebug.c:1391
0000022 0x000000000071251c in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7ec96b8)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:344
0000023 0x00000000006c39bb in execute (op_array=0x1591ed0)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:107
0000024 0x00007ffff4e96a73 in xdebug_execute (op_array=0x1591ed0) at /tmp/pear/temp/xdebug/xdebug.c:1391
0000025 0x000000000071251c in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7ec7d08)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:344
0000026 0x00000000006c39bb in execute (op_array=0x166b8c0)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:107
0000027 0x00007ffff4e96a73 in xdebug_execute (op_array=0x166b8c0) at /tmp/pear/temp/xdebug/xdebug.c:1391
0000028 0x000000000071251c in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7ec6b68)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:344
0000029 0x00000000006c39bb in execute (op_array=0x1591d38)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:107
0000030 0x00007ffff4e96a73 in xdebug_execute (op_array=0x1591d38) at /tmp/pear/temp/xdebug/xdebug.c:1391
0000031 0x000000000071251c in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7ec6a50)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:344
0000032 0x00000000006c39bb in execute (op_array=0x15f5258)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:107
0000033 0x00007ffff4e96a73 in xdebug_execute (op_array=0x15f5258) at /tmp/pear/temp/xdebug/xdebug.c:1391
0000034 0x000000000071251c in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7ec52e0)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:344
#35 0x00000000006c39bb in execute (op_array=0x15d0de8)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:107
0000036 0x00007ffff4e96a73 in xdebug_execute (op_array=0x15d0de8) at /tmp/pear/temp/xdebug/xdebug.c:1391
0000037 0x000000000071251c in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7ec24f8)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:344
0000038 0x00000000006c39bb in execute (op_array=0x12ba548)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:107
0000039 0x00007ffff4e96a73 in xdebug_execute (op_array=0x12ba548) at /tmp/pear/temp/xdebug/xdebug.c:1391
0000040 0x000000000071251c in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7ec1570)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:344
0000041 0x00000000006c39bb in execute (op_array=0x11fcd70)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:107
0000042 0x00007ffff4e96a73 in xdebug_execute (op_array=0x11fcd70) at /tmp/pear/temp/xdebug/xdebug.c:1391
0000043 0x000000000071251c in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7ec1360)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:344
0000044 0x00000000006c39bb in execute (op_array=0x11a8220)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:107
0000045 0x00007ffff4e96a73 in xdebug_execute (op_array=0x11a8220) at /tmp/pear/temp/xdebug/xdebug.c:1391
0000046 0x000000000071251c in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7ec1068)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:344
0000047 0x00000000006c39bb in execute (op_array=0x1198758)
at /build/buildd/php5-5.3.15/Zend/zend_vm_execute.h:107
0000048 0x00007ffff4e96a73 in xdebug_execute (op_array=0x1198758) at /tmp/pear/temp/xdebug/xdebug.c:1391
#49 0x000000000069ef30 in zend_execute_scripts (type=0, retval=0x800160002, file_count=3)
at /build/buildd/php5-5.3.15/Zend/zend.c:1308
0000050 0x000000000064ace3 in php_execute_script (primary_file=0x7ffff7ecad70)
at /build/buildd/php5-5.3.15/main/main.c:2323
#51 0x000000000042cc2e in main (argc=32767, argv=0x7fffffffe0c0)
at /build/buildd/php5-5.3.15/sapi/cli/php_cli.c:1193

TagsNo tags attached.
Operating SystemUbuntu 64 12.04 LTS
PHP Version5.3-dev

Activities

tploch

2012-08-22 14:25

reporter   ~0002330

$ php -v
PHP 5.3.15-0ppa1p with Suhosin-Patch (cli) (built: Aug 4 2012 03:47:12)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans

derick

2012-08-24 09:09

administrator   ~0002331

I've tried to reproduce this with Xdebug 2.2.1 and PHP 5.3.16-dev:

derick@whisky:/tmp/gist-a06fea9f $ phpunit test_case.php
PHPUnit 3.6.12 by Sebastian Bergmann.

E

Time: 0 seconds, Memory: 0.25Mb

There was 1 error:

1) Testcase\SoapTypeAbstractTest::testTypemapCallsFromXml
PHPUnit_Framework_Exception: Class "SoapTypeAbstract" does not exist.

/tmp/gist-a06fea9f/test_case.php:40

FAILURES!
Tests: 1, Assertions: 0, Errors: 1.

But as you can see, it works fine. Could you please provide:

  • the xdebug section of php.ini
  • the exact commands you use to start phpunit with the test case

tploch

2012-08-27 06:35

reporter   ~0002333

Last edited: 2012-08-27 13:57

Hello,

I have updated the gist so it can be run without a bootstrap (which was there in my case, since the class not found error shouldn't have been there), so you should be able to just run it with '/usr/bin/phpunit test_case.php' from inside the gist directory:

https://gist.github.com/cc37549c71f51c5968b0

xdebug php.ini values:

xdebug

xdebug support => enabled
Version => 2.2.1
IDE Key => tploch

Supported protocols => Revision
DBGp - Common DeBuGger Protocol => $Revision: 1.145 $

Directive => Local Value => Master Value
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 => 100 => 100
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

tploch

2012-09-10 11:06

reporter   ~0002346

Hi Derick, could you tell me if this is a valid bug in xdebug or a bug in the SOAP extension?

You should be able to reproduce it with the updated GIST found here:
https://gist.github.com/cc37549c71f51c5968b0

Thanks in advance,
Thomas

derick

2012-12-18 13:08

administrator   ~0002399

I can reproduce this with:

derick@whisky:/tmp $ export USE_ZEND_ALLOC=0
derick@whisky:/tmp $ git clone https://gist.github.com/cc37549c71f51c5968b0.git
derick@whisky:/tmp $ cd cc37*
derick@whisky:/tmp/cc37549c71f51c5968b0 $ phpunit test_case.php
PHPUnit 3.6.12 by Sebastian Bergmann.

Segmentation fault
[GIT: master][PHP: 5.3.19-dev ]

But I can also reproduce this without Xdebug loaded (notice the -n):

derick@whisky:/tmp/cc37549c71f51c5968b0 $ valgrind --db-attach=yes php -n which phpunit test_case.php
==20922== Memcheck, a memory error detector
==20922== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==20922== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==20922== Command: php -n /usr/local/php/5.3dev/bin/phpunit test_case.php
==20922==
PHPUnit 3.6.12 by Sebastian Bergmann.

==20922== Invalid read of size 4
==20922== at 0x986907: zend_fetch_dimension_address_read (zend.h:381)
==20922== by 0x9EC5D2: ZEND_FETCH_DIM_FUNC_ARG_SPEC_VAR_CV_HANDLER (zend_vm_execute.h:16027)
==20922== by 0x9876CC: execute (zend_vm_execute.h:107)
==20922== by 0x95470E: zend_execute_scripts (zend.c:1259)
==20922== by 0x8DF6C4: php_execute_script (main.c:2316)
==20922== by 0xA3664D: main (php_cli.c:1189)
==20922== Address 0x7feffbcb0 is not stack'd, malloc'd or (recently) free'd

So please report this with the SOAP developers.

Issue History

Date Modified Username Field Change
2012-08-22 14:08 tploch New Issue
2012-08-22 14:25 tploch Note Added: 0002330
2012-08-24 09:09 derick Note Added: 0002331
2012-08-24 09:09 derick Assigned To => derick
2012-08-24 09:09 derick Status new => feedback
2012-08-27 06:35 tploch Note Added: 0002333
2012-08-27 06:35 tploch Status feedback => assigned
2012-08-27 13:57 tploch Note Edited: 0002333
2012-09-10 11:06 tploch Note Added: 0002346
2012-12-18 13:08 derick Note Added: 0002399
2012-12-18 13:08 derick Status assigned => resolved
2012-12-18 13:08 derick Resolution open => not fixable
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)
2020-03-12 16:35 derick Category Usage problems (Wrong Results) => Variable Display
2020-03-12 16:38 derick Category Variable Display => Uncategorized