Skip to content

Instantly share code, notes, and snippets.

@edorian
Created September 10, 2012 11:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edorian/3690351 to your computer and use it in GitHub Desktop.
Save edorian/3690351 to your computer and use it in GitHub Desktop.
PHP Segfault PHPUnit 3.7RC3, sf2 master, php master & 5.4.6
PHP:
master & 5.4.6
Configure Command => './configure' '--prefix=/opt/php-master' '--without-pear' '--with-zlib' '--with-xsl' '--enable-debug'
Repro:
------
git clone https://github.com/symfony/symfony.git
curl -s http://getcomposer.org/installer | php
COMPOSER_ROOT_VERSION=dev-master php composer.phar --dev install
php src/Symfony/Component/Locale/Resources/data/build-data.php
export USE_INTL_ICU_DATA_VERSION=1
pear config-set auto_discover 1
pear install --force --alldeps pear.phpunit.de/phpunit-3.7.0RC3
pear install --force --alldeps pear.phpunit.de/php_codecoverage-1.2.0RC3
pear install --force --alldeps pear.phpunit.de/phpunit_mockobject-1.2.0RC4
phpunit
[...]
..............................S...............SSSSSSSSSSSSSSS 5124 / 7761 ( 66%)
.........SSSSSSSSSFFFSSS..........SSSSSSSSSS......Segfault (Core dumped)
CORE master:
-----
gdb /opt/php-master/bin/php /tmp/cores/core-php.22349
This GDB was configured as "x86_64-redhat-linux-gnu".
Reading symbols from /opt/php-master/bin/php...done.
BFD: Warning: /tmp/cores/core-php.22349 is truncated: expected core file size >= 194351104, found: 122478592.
[New LWP 22349]
Cannot access memory at address 0x3053823268
Failed to read a valid object file image from memory.
Core was generated by `/opt/php-master/bin/php -c /etc/php.ini /usr/bin/phpunit'.
Program terminated with signal 11, Segmentation fault.
#0 zval_mark_grey (pz=0xb9ca2a8) at /opt/php-src/Zend/zend_gc.c:421
(gdb) bt
#0 zval_mark_grey (pz=0xb9ca2a8) at /opt/php-src/Zend/zend_gc.c:421
Cannot access memory at address 0x7fff7174b4a8
(gdb)
CORE 5.4.6:
-----------
gdb /opt/php-5.4.6/bin/php /tmp/cores/core-php.17245
This GDB was configured as "x86_64-redhat-linux-gnu".
Reading symbols from /opt/php-5.4.6/bin/php...done.
[New LWP 17245]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/opt/php-5.4.6/bin/php /usr/bin/phpunit'.
Program terminated with signal 11, Segmentation fault.
#0 0x00000000007e493f in zval_mark_grey (pz=0x12adf328) at /opt/php-5.4.6/Zend/zend_gc.c:425
425 pz = *(zval**)p->pData;
(gdb) bt
#0 0x00000000007e493f in zval_mark_grey (pz=0x12adf328) at /opt/php-5.4.6/Zend/zend_gc.c:425
#1 0x00000000007e4c6e in gc_mark_roots () at /opt/php-5.4.6/Zend/zend_gc.c:501
#2 0x00000000007e57cd in gc_collect_cycles () at /opt/php-5.4.6/Zend/zend_gc.c:793
#3 0x00000000007e3e96 in gc_zval_possible_root (zv=0x12adf9e8) at /opt/php-5.4.6/Zend/zend_gc.c:166
#4 0x00000000007a689e in gc_zval_check_possible_root (z=0x12adf9e8) at /opt/php-5.4.6/Zend/zend_gc.h:183
#5 _zval_ptr_dtor (zval_ptr=0x12adff00, __zend_filename=0xca8750 "/opt/php-5.4.6/Zend/zend_variables.c", __zend_lineno=180) at /opt/php-5.4.6/Zend/zend_execute_API.c:448
#6 0x00000000007b9354 in _zval_ptr_dtor_wrapper (zval_ptr=0x12adff00) at /opt/php-5.4.6/Zend/zend_variables.c:180
#7 0x00000000007cd5da in zend_hash_destroy (ht=0x12adf6a0) at /opt/php-5.4.6/Zend/zend_hash.c:560
#8 0x00000000007b8f19 in _zval_dtor_func (zvalue=0x12adf328, __zend_filename=0x97e728 "/opt/php-5.4.6/ext/pcre/php_pcre.c", __zend_lineno=550) at /opt/php-5.4.6/Zend/zend_variables.c:43
#9 0x000000000049daee in _zval_dtor (__zend_lineno=<optimized out>, __zend_filename=0x97e728 "/opt/php-5.4.6/ext/pcre/php_pcre.c", zvalue=0x12adf328)
at /opt/php-5.4.6/Zend/zend_variables.h:35
#10 php_pcre_match_impl (pce=0x5a32e10,
subject=0x12adf4f0 "/**\n * Note that there are some values written like -2147483647 - 1. This is the lower 32bit int max and is a known\n * behavior of PHP.\n */\n/**\n * @dataProvider formatCurrencyWithCurrencyStyleSwis"..., subject_len=225, return_value=0x12adf740, subpats=0x12adf328, global=1, use_flags=0, flags=0, start_offset=0)
at /opt/php-5.4.6/ext/pcre/php_pcre.c:550
#11 0x000000000049da3b in php_do_pcre_match (ht=3, return_value=0x12adf740, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1, global=1) at /opt/php-5.4.6/ext/pcre/php_pcre.c:520
#12 0x000000000049e850 in zif_preg_match_all (ht=3, return_value=0x12adf740, return_value_ptr=0x0, this_ptr=0x0, return_value_used=1) at /opt/php-5.4.6/ext/pcre/php_pcre.c:780
#13 0x00000000007fa7cc in zend_do_fcall_common_helper_SPEC (execute_data=0x7fc29eb16ea8) at /opt/php-5.4.6/Zend/zend_vm_execute.h:642
#14 0x0000000000801854 in ZEND_DO_FCALL_SPEC_CONST_HANDLER (execute_data=0x7fc29eb16ea8) at /opt/php-5.4.6/Zend/zend_vm_execute.h:2219
#15 0x00000000007f91ab in execute (op_array=0x13b37c8) at /opt/php-5.4.6/Zend/zend_vm_execute.h:410
#16 0x00000000007bc486 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /opt/php-5.4.6/Zend/zend.c:1289
#17 0x0000000000731340 in php_execute_script (primary_file=0x7fff1493dfb0) at /opt/php-5.4.6/main/main.c:2473
#18 0x00000000009020e2 in do_cli (argc=2, argv=0x7fff1493e368) at /opt/php-5.4.6/sapi/cli/php_cli.c:988
#19 0x000000000090318a in main (argc=2, argv=0x7fff1493e368) at /opt/php-5.4.6/sapi/cli/php_cli.c:1364
@hashar
Copy link

hashar commented Jan 16, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment