alexeyrybak/blitz

Assertion failed with php 7.2 in debug mode

Opened this issue · 0 comments

Summary

blitz fails on assertion when php 7.2 is compliled in debug mode.

php versions tested

  • 7.2.16 - reproduced
  • 7.2.17 - reproduced
  • 7.1.28 - NOT reproduced

Operating systems tested

  • debian stretch 64 (9.6) under virtual box (linux)
  • debian stretch 64 9.6 under WSL windows 10 (wow)

How to reproduce

  • configure and build php 7.2 sources with --enable-debug
wget https://www.php.net/distributions/php-7.2.17.tar.gz
tar -xzf php-7.2.17.tar.gz
cd php-7.2.17/
./configure --disable-all --enable-debug --prefix=/usr/local/php-7.2.17-debug
make
sudo make install
  • configure and build blitz (git hash: 2353a6b)
cd blitz
/usr/local/php-7.2.17-debug/bin/phpize
./configure --with-php-config=/usr/local/php-7.2.17-debug/bin/php-config
make
make test
  • results
Number of tests :  104               103
Tests skipped   :    1 (  1.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :   60 ( 57.7%) ( 58.3%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :   43 ( 41.3%) ( 41.7%)
  • Fail reason in all tests
php: /home/vagrant/build/php-7.2.17/Zend/zend_hash.c:2052: zend_hash_internal_pointer_reset_ex: Assertion `(&ht->nInternalPointer != pos || (ht)->gc
.refcount == 1) || ((ht)->u.flags & (1<<6))' failed.

Example gdb trace

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff6cf742a in __GI_abort () at abort.c:89
#2  0x00007ffff6ceee67 in __assert_fail_base (fmt=<optimized out>,
    assertion=assertion@entry=0x555555ad8180 "(&ht->nInternalPointer != pos || (ht)->gc.refcount == 1) || ((ht)->u.flags & (1<<6))",
    file=file@entry=0x555555ad7fa0 "/home/vagrant/build/php-7.2.17/Zend/zend_hash.c", line=line@entry=2052,
    function=function@entry=0x555555ad8680 <__PRETTY_FUNCTION__.9456> "zend_hash_internal_pointer_reset_ex") at assert.c:92
#3  0x00007ffff6ceef12 in __GI___assert_fail (
    assertion=0x555555ad8180 "(&ht->nInternalPointer != pos || (ht)->gc.refcount == 1) || ((ht)->u.flags & (1<<6))",
    file=0x555555ad7fa0 "/home/vagrant/build/php-7.2.17/Zend/zend_hash.c", line=2052,
    function=0x555555ad8680 <__PRETTY_FUNCTION__.9456> "zend_hash_internal_pointer_reset_ex") at assert.c:101
#4  0x00005555558e841d in zend_hash_internal_pointer_reset_ex (ht=0x7ffff6863420, pos=0x7ffff6863444)
    at /home/vagrant/build/php-7.2.17/Zend/zend_hash.c:2052
#5  0x00007ffff65f67b4 in blitz_merge_iterations_set (tpl=0x7ffff6882000, input_arr=0x7ffff681f1a0) at /home/vagrant/build/blitz/blitz.c:5063
#6  0x00007ffff65f8d0e in zif_blitz_set (execute_data=0x7ffff681f150, return_value=0x7fffffffa6f0) at /home/vagrant/build/blitz/blitz.c:5562
#7  0x0000555555930da5 in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER () at /home/vagrant/build/php-7.2.17/Zend/zend_vm_execute.h:907
#8  0x00005555559b0114 in execute_ex (ex=0x7ffff681f030) at /home/vagrant/build/php-7.2.17/Zend/zend_vm_execute.h:59765
#9  0x00005555559b54a5 in zend_execute (op_array=0x7ffff687e300, return_value=0x0) at /home/vagrant/build/php-7.2.17/Zend/zend_vm_execute.h:63776
#10 0x00005555558d1461 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/vagrant/build/php-7.2.17/Zend/zend.c:1498
#11 0x000055555584520b in php_execute_script (primary_file=0x7fffffffdd90) at /home/vagrant/build/php-7.2.17/main/main.c:2594
#12 0x00005555559b7d1d in do_cli (argc=60, argv=0x555555e2cab0) at /home/vagrant/build/php-7.2.17/sapi/cli/php_cli.c:1011
#13 0x00005555559b8c1a in main (argc=60, argv=0x555555e2cab0) at /home/vagrant/build/php-7.2.17/sapi/cli/php_cli.c:1403
Aborted