View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000661 | Xdebug | Uncategorized | public | 2011-02-03 02:16 | 2011-02-09 22:19 |
Reporter | mday | Assigned To | derick | ||
Priority | normal | Severity | crash | Reproducibility | sometimes |
Status | resolved | Resolution | no change required | ||
Platform | linux | OS | ubuntu | OS Version | 10.10 |
Product Version | 2.1.0 | ||||
Summary | 0000661: 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) run phpunit --coverage-html ../public/tests/ (gdb) run /usr/bin/phpunit --coverage-html ../public/tests/ ....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 (gdb) bt | ||||
Tags | No tags attached. | ||||
Attached Files | segfaults.txt (8,593 bytes)
FIRST TEST ------------------- root@matthewbox:/pool/www/www.example.com/tests# USE_ZEND_ALLOC=0 gdb 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/local/bin/php...done. (gdb) run -dzend.enable_gc=0 /usr/local/bin/phpunit --coverage-html ../public/tests/ Starting program: /usr/local/bin/php -dzend.enable_gc=0 /usr/local/bin/phpunit --coverage-html ../public/tests/ [Thread debugging using libthread_db enabled] PHPUnit 3.5.10 by Sebastian Bergmann. [New Thread 0x7ffff24a6700 (LWP 17827)] [Thread 0x7ffff24a6700 (LWP 17827) exited] .................... Time: 26 seconds, Memory: 0.25Mb OK (20 tests, 20 assertions) Generating code coverage report, this may take a moment. Program received signal SIGSEGV, Segmentation fault. gc_remove_zval_from_buffer (zv=<value optimized out>) at /home/matthew/src/php-5.3.5/Zend/zend_gc.c:265 265 GC_REMOVE_FROM_BUFFER(root_buffer); (gdb) run -dzend.enable_gc=0 /usr/local/bin/phpunit --coverage-html ../public/tests/ The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /usr/local/bin/php -dzend.enable_gc=0 /usr/local/bin/phpunit --coverage-html ../public/tests/ [Thread debugging using libthread_db enabled] PHPUnit 3.5.10 by Sebastian Bergmann. [New Thread 0x7ffff24a6700 (LWP 17839)] [Thread 0x7ffff24a6700 (LWP 17839) exited] .................... Time: 25 seconds, Memory: 0.25Mb OK (20 tests, 20 assertions) Generating code coverage report, this may take a moment. Program received signal SIGSEGV, Segmentation fault. 0x000000000075a571 in gc_zval_possible_root (zv=0x37dadf0) at /home/matthew/src/php-5.3.5/Zend/zend_gc.c:143 143 GC_ZOBJ_CHECK_POSSIBLE_ROOT(zv); (gdb) bt #0 0x000000000075a571 in gc_zval_possible_root (zv=0x37dadf0) at /home/matthew/src/php-5.3.5/Zend/zend_gc.c:143 #1 0x000000000074912b in zend_hash_destroy (ht=0x37daf50) at /home/matthew/src/php-5.3.5/Zend/zend_hash.c:529 #2 0x000000000075bb89 in zend_object_std_dtor (object=0x37edb00) at /home/matthew/src/php-5.3.5/Zend/zend_objects.c:45 #3 0x000000000075bba9 in zend_objects_free_object_storage (object=0x37dadf0) at /home/matthew/src/php-5.3.5/Zend/zend_objects.c:126 #4 0x000000000075f888 in zend_objects_store_del_ref_by_handle_ex (handle=<value optimized out>, handlers=<value optimized out>) at /home/matthew/src/php-5.3.5/Zend/zend_objects_API.c:220 #5 0x000000000075f8a3 in zend_objects_store_del_ref (zobject=0x37dee20) at /home/matthew/src/php-5.3.5/Zend/zend_objects_API.c:172 #6 0x000000000073072d in _zval_dtor (zval_ptr=0x3814058) at /home/matthew/src/php-5.3.5/Zend/zend_variables.h:35 #7 _zval_ptr_dtor (zval_ptr=0x3814058) at /home/matthew/src/php-5.3.5/Zend/zend_execute_API.c:443 #8 0x000000000074912b in zend_hash_destroy (ht=0x3814160) at /home/matthew/src/php-5.3.5/Zend/zend_hash.c:529 #9 0x000000000073c2cf in _zval_dtor_func (zvalue=0x37decb0) at /home/matthew/src/php-5.3.5/Zend/zend_variables.c:43 #10 0x000000000073072d in _zval_dtor (zval_ptr=0x3779148) at /home/matthew/src/php-5.3.5/Zend/zend_variables.h:35 #11 _zval_ptr_dtor (zval_ptr=0x3779148) at /home/matthew/src/php-5.3.5/Zend/zend_execute_API.c:443 #12 0x000000000074912b in zend_hash_destroy (ht=0x36ff340) at /home/matthew/src/php-5.3.5/Zend/zend_hash.c:529 #13 0x000000000075bb89 in zend_object_std_dtor (object=0x367e300) at /home/matthew/src/php-5.3.5/Zend/zend_objects.c:45 #14 0x000000000075bba9 in zend_objects_free_object_storage (object=0x37dadf0) at /home/matthew/src/php-5.3.5/Zend/zend_objects.c:126 #15 0x000000000075f3a8 in zend_objects_store_free_object_storage (objects=0xef86b8) at /home/matthew/src/php-5.3.5/Zend/zend_objects_API.c:92 #16 0x0000000000730b25 in shutdown_executor () at /home/matthew/src/php-5.3.5/Zend/zend_execute_API.c:302 #17 0x000000000073d042 in zend_deactivate () at /home/matthew/src/php-5.3.5/Zend/zend.c:890 #18 0x00000000006ea665 in php_request_shutdown (dummy=<value optimized out>) at /home/matthew/src/php-5.3.5/main/main.c:1633 #19 0x00000000007c60cc in main (argc=<value optimized out>, argv=<value optimized out>) at /home/matthew/src/php-5.3.5/sapi/cli/php_cli.c:1374 (gdb) THIRD TEST --------------------- (gdb) run -dzend.enable_gc=0 /usr/local/bin/phpunit --coverage-html ../public/tests/ The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /usr/local/bin/php -dzend.enable_gc=0 /usr/local/bin/phpunit --coverage-html ../public/tests/ [Thread debugging using libthread_db enabled] PHPUnit 3.5.10 by Sebastian Bergmann. [New Thread 0x7ffff24a6700 (LWP 17857)] [Thread 0x7ffff24a6700 (LWP 17857) exited] .................... Time: 25 seconds, Memory: 0.25Mb OK (20 tests, 20 assertions) Generating code coverage report, this may take a moment. Program exited normally. (gdb) bt No stack. (gdb) FOURTH TEST -------------------------- (gdb) run -dzend.enable_gc=0 /usr/local/bin/phpunit --coverage-html ../public/tests/ Starting program: /usr/local/bin/php -dzend.enable_gc=0 /usr/local/bin/phpunit --coverage-html ../public/tests/ [Thread debugging using libthread_db enabled] PHPUnit 3.5.10 by Sebastian Bergmann. [New Thread 0x7ffff24a6700 (LWP 17864)] [Thread 0x7ffff24a6700 (LWP 17864) exited] .................... Time: 25 seconds, Memory: 0.25Mb OK (20 tests, 20 assertions) Generating code coverage report, this may take a moment. Program received signal SIGSEGV, Segmentation fault. gc_remove_zval_from_buffer (zv=<value optimized out>) at /home/matthew/src/php-5.3.5/Zend/zend_gc.c:265 265 GC_REMOVE_FROM_BUFFER(root_buffer); (gdb) bt #0 gc_remove_zval_from_buffer (zv=<value optimized out>) at /home/matthew/src/php-5.3.5/Zend/zend_gc.c:265 #1 0x0000000000730775 in _zval_ptr_dtor (zval_ptr=0x38da7e8) at /home/matthew/src/php-5.3.5/Zend/zend_execute_API.c:442 #2 0x000000000074912b in zend_hash_destroy (ht=0x38dd850) at /home/matthew/src/php-5.3.5/Zend/zend_hash.c:529 #3 0x000000000075bb89 in zend_object_std_dtor (object=0x388ee90) at /home/matthew/src/php-5.3.5/Zend/zend_objects.c:45 #4 0x000000000075bba9 in zend_objects_free_object_storage (object=0x38d4a00) at /home/matthew/src/php-5.3.5/Zend/zend_objects.c:126 #5 0x000000000075f888 in zend_objects_store_del_ref_by_handle_ex (handle=<value optimized out>, handlers=<value optimized out>) at /home/matthew/src/php-5.3.5/Zend/zend_objects_API.c:220 #6 0x000000000075f8a3 in zend_objects_store_del_ref (zobject=0x38dc630) at /home/matthew/src/php-5.3.5/Zend/zend_objects_API.c:172 #7 0x000000000073072d in _zval_dtor (zval_ptr=0x38dbcf8) at /home/matthew/src/php-5.3.5/Zend/zend_variables.h:35 #8 _zval_ptr_dtor (zval_ptr=0x38dbcf8) at /home/matthew/src/php-5.3.5/Zend/zend_execute_API.c:443 #9 0x000000000074912b in zend_hash_destroy (ht=0x38dbb00) at /home/matthew/src/php-5.3.5/Zend/zend_hash.c:529 #10 0x000000000073c2cf in _zval_dtor_func (zvalue=0x388f1f0) at /home/matthew/src/php-5.3.5/Zend/zend_variables.c:43 #11 0x000000000073072d in _zval_dtor (zval_ptr=0x3867fb8) at /home/matthew/src/php-5.3.5/Zend/zend_variables.h:35 #12 _zval_ptr_dtor (zval_ptr=0x3867fb8) at /home/matthew/src/php-5.3.5/Zend/zend_execute_API.c:443 #13 0x000000000074912b in zend_hash_destroy (ht=0x37ca770) at /home/matthew/src/php-5.3.5/Zend/zend_hash.c:529 #14 0x000000000075bb89 in zend_object_std_dtor (object=0x37ca7e0) at /home/matthew/src/php-5.3.5/Zend/zend_objects.c:45 #15 0x000000000075bba9 in zend_objects_free_object_storage (object=0x38d4a00) at /home/matthew/src/php-5.3.5/Zend/zend_objects.c:126 #16 0x000000000075f3a8 in zend_objects_store_free_object_storage (objects=0xef86b8) at /home/matthew/src/php-5.3.5/Zend/zend_objects_API.c:92 #17 0x0000000000730b25 in shutdown_executor () at /home/matthew/src/php-5.3.5/Zend/zend_execute_API.c:302 #18 0x000000000073d042 in zend_deactivate () at /home/matthew/src/php-5.3.5/Zend/zend.c:890 #19 0x00000000006ea665 in php_request_shutdown (dummy=<value optimized out>) at /home/matthew/src/php-5.3.5/main/main.c:1633 #20 0x00000000007c60cc in main (argc=<value optimized out>, argv=<value optimized out>) at /home/matthew/src/php-5.3.5/sapi/cli/php_cli.c:1374 (gdb) | ||||
Operating System | ubuntu 10.10 | ||||
PHP Version | 5.3.3 | ||||
|
here's another gdb output: root@matthewbox:/pool/www/www.hiding_my_domain.com/tests# gdb /usr/bin/php .................. Time: 21 seconds, Memory: 46.00Mb OK (18 tests, 21 assertions) Generating code coverage report, this may take a moment. #0 0x00000000006a5967 in zend_hash_destroy () hope these help : / without using --code-coverage (which phpunit uses xdebug for) it works just fine |
|
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. |
|
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: cheers, |
|
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)! |
|
I'll mark it as "resolved" then. Good luck! |
|
reopening issue due to this issue: has duplicate 0000663 |
|
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: gdb: Then instead of pasting the backtrace in a comment, please use the "attach file" functionality. |
|
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. |
|
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. |
Date Modified | Username | Field | Change |
---|---|---|---|
2011-02-03 02:16 | mday | New Issue | |
2011-02-03 02:32 | mday | Note Added: 0001658 | |
2011-02-03 02:41 | mday | Note Added: 0001659 | |
2011-02-03 09:33 | derick | Note Added: 0001660 | |
2011-02-03 09:33 | derick | Assigned To | => derick |
2011-02-03 09:33 | derick | Status | new => feedback |
2011-02-03 17:52 | mday | Note Edited: 0001658 | |
2011-02-03 22:28 | mday | Note Added: 0001661 | |
2011-02-03 22:28 | mday | Status | feedback => assigned |
2011-02-03 23:26 | derick | Note Added: 0001662 | |
2011-02-03 23:26 | derick | Status | assigned => resolved |
2011-02-03 23:26 | derick | Resolution | open => unable to reproduce |
2011-02-09 09:34 | derick | Relationship added | has duplicate 0000663 |
2011-02-09 21:30 | mday | Note Added: 0001665 | |
2011-02-09 21:30 | mday | Status | resolved => feedback |
2011-02-09 21:30 | mday | Resolution | unable to reproduce => reopened |
2011-02-09 21:39 | derick | Note Added: 0001666 | |
2011-02-09 22:11 | mday | File Added: segfaults.txt | |
2011-02-09 22:12 | mday | Note Added: 0001667 | |
2011-02-09 22:12 | mday | Status | feedback => assigned |
2011-02-09 22:19 | derick | Note Added: 0001668 | |
2011-02-09 22:19 | derick | Status | assigned => resolved |
2011-02-09 22:19 | derick | Resolution | reopened => no change required |
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 |