View Issue Details

IDProjectCategoryView StatusLast Update
0000661XdebugUncategorizedpublic2011-02-09 22:19
Reportermday Assigned To 
PrioritynormalSeveritycrashReproducibilitysometimes
Status resolvedResolutionno change required 
PlatformlinuxOSubuntuOS Version10.10
Product Version2.1.0 
Summary0000661: code-coverage causes segmentation fault
Description

running my unit tests with zend framework and code-coverage causes segmentation fault

Steps To Reproduce

it's difficult to give the steps to reproduce this since it's using zend framework when the fail happens and there's a lot of code.

Additional Information

gdb output:

gdb /usr/bin/php

(gdb) run phpunit --coverage-html ../public/tests/

(gdb) run /usr/bin/phpunit --coverage-html ../public/tests/
Starting program: /usr/bin/php /usr/bin/phpunit --coverage-html ../public/tests/
[Thread debugging using libthread_db enabled]
[New Thread 0x7fffef348700 (LWP 15023)]
[Thread 0x7fffef348700 (LWP 15023) exited]
PHPUnit 3.5.10 by Sebastian Bergmann.

....PHP Warning: imagepng(): Unable to open './images/captcha/933a47cb6e8c2f1d70fbfd4d17dac4ce.png' for writing: No such file or directory in /pool/deployments/zendFramework/1.11.1/library/Zend/Captcha/Image.php on line 563
.........
Program received signal SIGSEGV, Segmentation fault.
0x00000000006b9213 in ?? ()

(gdb) bt
#0 0x00000000006b9213 in ?? ()
#1 0x000000000069850d in _zval_dtor_func ()
0000002 0x00000000006bd4cf in ?? ()
0000003 0x000000000070caea in ?? ()
0000004 0x000000000070d47d in ?? ()
0000005 0x00000000006c0e90 in execute ()
0000006 0x00007ffff41e1d15 in xdebug_execute (op_array=0x2d49740) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000007 0x00000000006e9706 in ?? ()
0000008 0x00000000006c0e90 in execute ()
0000009 0x00007ffff41e1d15 in xdebug_execute (op_array=0x3cad4a8) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000010 0x00000000006e9706 in ?? ()
0000011 0x00000000006c0e90 in execute ()
0000012 0x00007ffff41e1d15 in xdebug_execute (op_array=0x28b7ea8) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000013 0x000000000068ea14 in zend_call_function ()
0000014 0x00000000006afb67 in zend_call_method ()
0000015 0x00000000006bc7f3 in zend_std_cast_object_tostring ()
0000016 0x0000000000699a1f in zend_make_printable_zval ()
0000017 0x00000000006924d1 in concat_function ()
0000018 0x00000000006c3e62 in ?? ()
0000019 0x00000000006c0e90 in execute ()
0000020 0x00007ffff41e1d15 in xdebug_execute (op_array=0x3f3b628) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000021 0x00000000006d51fc in ?? ()
0000022 0x00000000006c0e90 in execute ()
0000023 0x00007ffff41e1d15 in xdebug_execute (op_array=0x2042ca8) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000024 0x00000000006e9706 in ?? ()
0000025 0x00000000006c0e90 in execute ()
0000026 0x00007ffff41e1d15 in xdebug_execute (op_array=0x20ae318) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000027 0x00000000006e9706 in ?? ()
0000028 0x00000000006c0e90 in execute ()
0000029 0x00007ffff41e1d15 in xdebug_execute (op_array=0x2e4bb80) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000030 0x000000000068ea14 in zend_call_function ()
0000031 0x00000000005ceb87 in ?? ()
0000032 0x00007ffff41e20bd in xdebug_execute_internal (current_execute_data=0x7ffff7ece808, return_value_used=1) at /tmp/pear/temp/xdebug/xdebug.c:1339
0000033 0x00000000006e9a16 in ?? ()
0000034 0x00000000006c0e90 in execute ()
#35 0x00007ffff41e1d15 in xdebug_execute (op_array=0x2053c48) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000036 0x000000000068ea14 in zend_call_function ()
0000037 0x00000000006afb67 in zend_call_method ()
0000038 0x00000000006bbafe in zend_std_call_user_call ()
0000039 0x00007ffff41e20bd in xdebug_execute_internal (current_execute_data=0x7ffff7ecd020, return_value_used=1) at /tmp/pear/temp/xdebug/xdebug.c:1339
0000040 0x00000000006e9a16 in ?? ()
0000041 0x00000000006c0e90 in execute ()
0000042 0x00007ffff41e1d15 in xdebug_execute (op_array=0x2d02838) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000043 0x00000000006d51fc in ?? ()
0000044 0x00000000006c0e90 in execute ()
0000045 0x00007ffff41e1d15 in xdebug_execute (op_array=0x2042ca8) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000046 0x00000000006e9706 in ?? ()
0000047 0x00000000006c0e90 in execute ()
0000048 0x00007ffff41e1d15 in xdebug_execute (op_array=0x20ae318) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000049 0x00000000006e9706 in ?? ()
0000050 0x00000000006c0e90 in execute ()
0000051 0x00007ffff41e1d15 in xdebug_execute (op_array=0x139dc48) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000052 0x00000000006e9706 in ?? ()
0000053 0x00000000006c0e90 in execute ()
0000054 0x00007ffff41e1d15 in xdebug_execute (op_array=0x1f994a8) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000055 0x00000000006e9706 in ?? ()
0000056 0x00000000006c0e90 in execute ()
0000057 0x00007ffff41e1d15 in xdebug_execute (op_array=0x1369d40) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000058 0x00000000006e9706 in ?? ()
0000059 0x00000000006c0e90 in execute ()
0000060 0x00007ffff41e1d15 in xdebug_execute (op_array=0x12fca28) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000061 0x00000000006e9706 in ?? ()
0000062 0x00000000006c0e90 in execute ()
0000063 0x00007ffff41e1d15 in xdebug_execute (op_array=0x1624720) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000064 0x00000000006e9706 in ?? ()
0000065 0x00000000006c0e90 in execute ()
0000066 0x00007ffff41e1d15 in xdebug_execute (op_array=0x1676100) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000067 0x000000000068ea14 in zend_call_function ()
0000068 0x0000000000541db4 in ?? ()
0000069 0x00007ffff41e20bd in xdebug_execute_internal (current_execute_data=0x7ffff7ec8770, return_value_used=1) at /tmp/pear/temp/xdebug/xdebug.c:1339
0000070 0x00000000006e9a16 in ?? ()
0000071 0x00000000006c0e90 in execute ()
0000072 0x00007ffff41e1d15 in xdebug_execute (op_array=0x16e8748) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000073 0x00000000006e9706 in ?? ()
0000074 0x00000000006c0e90 in execute ()
0000075 0x00007ffff41e1d15 in xdebug_execute (op_array=0x16e8630) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000076 0x00000000006e9706 in ?? ()
0000077 0x00000000006c0e90 in execute ()
0000078 0x00007ffff41e1d15 in xdebug_execute (op_array=0x17b0e08) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000079 0x00000000006e9706 in ?? ()
0000080 0x00000000006c0e90 in execute ()
0000081 0x00007ffff41e1d15 in xdebug_execute (op_array=0x16e8518) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000082 0x00000000006e9706 in ?? ()
0000083 0x00000000006c0e90 in execute ()
0000084 0x00007ffff41e1d15 in xdebug_execute (op_array=0x1498850) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000085 0x00000000006e9706 in ?? ()
0000086 0x00000000006c0e90 in execute ()
0000087 0x00007ffff41e1d15 in xdebug_execute (op_array=0x148c820) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000088 0x00000000006e9706 in ?? ()
0000089 0x00000000006c0e90 in execute ()
0000090 0x00007ffff41e1d15 in xdebug_execute (op_array=0x148c820) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000091 0x00000000006e9706 in ?? ()
0000092 0x00000000006c0e90 in execute ()
0000093 0x00007ffff41e1d15 in xdebug_execute (op_array=0x17534c8) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000094 0x00000000006e9706 in ?? ()
0000095 0x00000000006c0e90 in execute ()
0000096 0x00007ffff41e1d15 in xdebug_execute (op_array=0x1065e30) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000097 0x00000000006e9706 in ?? ()
0000098 0x00000000006c0e90 in execute ()
0000099 0x00007ffff41e1d15 in xdebug_execute (op_array=0x103eac8) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000100 0x00000000006e9706 in ?? ()
0000101 0x00000000006c0e90 in execute ()
0000102 0x00007ffff41e1d15 in xdebug_execute (op_array=0x1028df0) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000103 0x000000000069885d in zend_execute_scripts ()
0000104 0x00000000006441a8 in php_execute_script ()
0000105 0x0000000000729f26 in ?? ()
0000106 0x00007ffff54a9d8e in __libc_start_main () from /lib/libc.so.6
0000107 0x00000000004281e9 in _start ()

TagsNo tags attached.
Operating Systemubuntu 10.10
PHP Version5.3.3

Relationships

has duplicate 0000663 resolvedderick phpunit with code coverage seg fault 

Activities

mday

2011-02-03 02:32

reporter   ~0001658

Last edited: 2011-02-03 17:52

here's another gdb output:

root@matthewbox:/pool/www/www.hiding_my_domain.com/tests# gdb /usr/bin/php
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 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-linux-gnu".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /usr/bin/php...(no debugging symbols found)...done.
(gdb) run /usr/bin/phpunit --coverage-html ../public/tests/
Starting program: /usr/bin/php /usr/bin/phpunit --coverage-html ../public/tests/
[Thread debugging using libthread_db enabled]
[New Thread 0x7fffef348700 (LWP 15242)]
[Thread 0x7fffef348700 (LWP 15242) exited]
PHPUnit 3.5.10 by Sebastian Bergmann.

..................

Time: 21 seconds, Memory: 46.00Mb

OK (18 tests, 21 assertions)

Generating code coverage report, this may take a moment.
Program received signal SIGSEGV, Segmentation fault.
0x00000000006a5967 in zend_hash_destroy ()

#0 0x00000000006a5967 in zend_hash_destroy ()
#1 0x00000000006ba7d2 in zend_object_std_dtor ()
0000002 0x00000000006ba809 in zend_objects_free_object_storage ()
0000003 0x00000000006be1fc in zend_objects_store_del_ref_by_handle_ex ()
0000004 0x00000000006b6bf8 in gc_collect_cycles ()
0000005 0x00000000006b6fc2 in gc_zobj_possible_root ()
0000006 0x00000000006e9513 in ?? ()
0000007 0x00000000006c0e90 in execute ()
0000008 0x00007ffff41e1d15 in xdebug_execute (op_array=0x15089c8) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000009 0x00000000006e9706 in ?? ()
0000010 0x00000000006c0e90 in execute ()
0000011 0x00007ffff41e1d15 in xdebug_execute (op_array=0x1508228) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000012 0x00000000006e9706 in ?? ()
0000013 0x00000000006c0e90 in execute ()
0000014 0x00007ffff41e1d15 in xdebug_execute (op_array=0x14e3968) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000015 0x00000000006e9706 in ?? ()
0000016 0x00000000006c0e90 in execute ()
0000017 0x00007ffff41e1d15 in xdebug_execute (op_array=0x14e1170) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000018 0x00000000006e9706 in ?? ()
0000019 0x00000000006c0e90 in execute ()
0000020 0x00007ffff41e1d15 in xdebug_execute (op_array=0x3f283d8) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000021 0x00000000006e9706 in ?? ()
0000022 0x00000000006c0e90 in execute ()
0000023 0x00007ffff41e1d15 in xdebug_execute (op_array=0x403b320) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000024 0x00000000006e9706 in ?? ()
0000025 0x00000000006c0e90 in execute ()
0000026 0x00007ffff41e1d15 in xdebug_execute (op_array=0x3f2fea8) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000027 0x00000000006e9706 in ?? ()
0000028 0x00000000006c0e90 in execute ()
0000029 0x00007ffff41e1d15 in xdebug_execute (op_array=0x3f2fea8) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000030 0x00000000006e9706 in ?? ()
0000031 0x00000000006c0e90 in execute ()
0000032 0x00007ffff41e1d15 in xdebug_execute (op_array=0x3f2fea8) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000033 0x00000000006e9706 in ?? ()
0000034 0x00000000006c0e90 in execute ()
#35 0x00007ffff41e1d15 in xdebug_execute (op_array=0x3f9c0e8) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000036 0x00000000006e9706 in ?? ()
0000037 0x00000000006c0e90 in execute ()
0000038 0x00007ffff41e1d15 in xdebug_execute (op_array=0x144c7b8) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000039 0x00000000006e9706 in ?? ()
0000040 0x00000000006c0e90 in execute ()
0000041 0x00007ffff41e1d15 in xdebug_execute (op_array=0x1065e30) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000042 0x00000000006e9706 in ?? ()
0000043 0x00000000006c0e90 in execute ()
0000044 0x00007ffff41e1d15 in xdebug_execute (op_array=0x103eac8) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000045 0x00000000006e9706 in ?? ()
0000046 0x00000000006c0e90 in execute ()
0000047 0x00007ffff41e1d15 in xdebug_execute (op_array=0x1028df0) at /tmp/pear/temp/xdebug/xdebug.c:1272
0000048 0x000000000069885d in zend_execute_scripts ()
0000049 0x00000000006441a8 in php_execute_script ()
0000050 0x0000000000729f26 in ?? ()
0000051 0x00007ffff54a9d8e in __libc_start_main () from /lib/libc.so.6
0000052 0x00000000004281e9 in _start ()

hope these help : /

without using --code-coverage (which phpunit uses xdebug for) it works just fine

mday

2011-02-03 02:41

reporter   ~0001659

i'm running a valgrind on it right now, but one weird thing is that it doesn't happen all the time, sometimes it makes it all the way through and tells me that all tests passed and that it generates a code coverage report. i'll post the valgrind report probably tomorrow since it's taking a really long time to generate.

derick

2011-02-03 09:33

administrator   ~0001660

Hi,

those dumps don't help at all because you don't have full symbols. In order to fix it, I will need to be able to reproduce it. You can do that either by providing a short reproducable script, or by providing me with exact instructions, including a code dump, on how to reproduce it. I don't know which tests you're running at all now. From the 2nd trace however, a hint shows that this might not be Xdebug, but PHP's Garbage Collector. Try turning it off (zend.enable_gc=0) and see if that helps. Make also sure you set the following environment variable:
export USE_ZEND_ALLOC=0

cheers,
Derick

mday

2011-02-03 22:28

reporter   ~0001661

Hi Derick, thanks for the fast response and for the suggestions. I tried what you suggested and nothing seemed to work.

I ended up recompiling php to get the newest version (5.3.5) instead of using the one that I was using: PHP 5.3.3-1ubuntu9.3 and now my tests are running fine.

At some point I was able to get an actual error which I think was causing the segfault and that was it was trying to allocate like 70,000 petabytes of memory - and I really have no idea : / we're definitely not doing anything that crazy, so it could just be that specific version of php that I was running.

I wish I could keep trying to figure out what exactly was causing that but this is a work project and I don't have that luxury of time.

Thanks again for your help (and your excellent product)!

derick

2011-02-03 23:26

administrator   ~0001662

I'll mark it as "resolved" then. Good luck!

mday

2011-02-09 21:30

reporter   ~0001665

reopening issue due to this issue:

has duplicate 0000663

derick

2011-02-09 21:39

administrator   ~0001666

You wrote somewhere else that you used "export ZEND_ALLOC=0" and not "export USE_ZEND_ALLOC=0". What did you use? And your backtrace really points to an issue with PHP's Garbage Collector.

Can you run GDB like this:

shell:
$ USE_ZEND_ALLOC=0 gdb /usr/bin/php

gdb:
(gdb) run -dzend.enable_gc=0 /usr/bin/phpunit --coverage-html ../public/tests/

Then instead of pasting the backtrace in a comment, please use the "attach file" functionality.

mday

2011-02-09 22:12

reporter   ~0001667

I ran the test 4 times, it seg faulted 3 times, I ran a backtrace on it two times, I uploaded the results of all in a text file.

derick

2011-02-09 22:19

administrator   ~0001668

All those crashes happen in GC related cases. I don't know why it doesn't properly get turned off with -dzend.enable_gc=0 though. But none of them point to any crash in Xdebug, just in normal PHP.

Please add the segfaults.txt file to the PHP bug report that you filed. I'm going to have to mark this one as "no change required" as it's a PHP issue.