1.0.0RC1 segfaults in ZTS mode

Issue #16 resolved
Remi Collet
created an issue
TEST 16/16 [tests/bug64788.phpt]
========DIFF========
001+ Termsig=11
001- ok %d
========DONE========
FAIL Check for bug #64788 [tests/bug64788.phpt] 

I will try to provide a backtrace ...

Comments (10)

  1. Ruslan Osmanov repo owner
    ruslan@devbox ~/.../pecl/ev $ php --version
    PHP 7.0.0-pl0-gentoo (cli) (built: Nov 19 2015 23:16:35) ( ZTS DEBUG )
    Copyright (c) 1997-2015 The PHP Group
    Zend Engine v3.0.0-dev, Copyright (c) 1998-2015 Zend Technologies
    ruslan@devbox ~/.../pecl/ev $ php -n -c. -dextension_dir=.libs -dextension=ev.so tests/bug64788.phpt 
    --TEST--
    Check for bug #64788
    --FILE--
    ok 2--EXPECTF--
    ok %d
    ruslan@devbox ~/.../pecl/ev $ 
    
  2. Ruslan Osmanov repo owner

    Can't reproduce. It's Gentoo x86_64. php-config:

    Usage: /usr/bin/php-config [OPTION]
    Options:
      --prefix            [/usr/lib64/php7.0]
      --includes          [-I/usr/lib64/php7.0/include/php -I/usr/lib64/php7.0/include/php/main -I/usr/lib64/php7.0/include/php/TSRM -I/usr/lib64/php7.0/include/php/Zend -I/usr/lib64/php7.0/include/php/ext -I/usr/lib64/php7.0/include/php/ext/date/lib]
      --ldflags           []
      --libs              [-lcrypt   -lcrypto -lssl -lcrypto -lz -ltidy -lresolv -lcrypt -lreadline -lncurses -laspell -lpspell -lrt -lsqlite3 -lmcrypt -lltdl -lonig -lldap -llber -lstdc++ -lX11 -lXpm -lpng -lz -ljpeg -ldb-4.8 -lgdbm -lcurl -lbz2 -lz -lsqlite3 -lpcre -lcrypto -lssl -lcrypto -lrt -lm -ldl -lnsl  -lxml2 -lz -lm -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcurl -lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4 -llber -lldap -lz -lxml2 -lz -lm -ldl -lfreetype -licui18n -licuuc -licudata -licuio -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lcrypt -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lcrypt ]
      --extension-dir     [/usr/lib64/php7.0/lib/extensions/debug-zts-20151012]
      --include-dir       [/usr/lib64/php7.0/include/php]
      --man-dir           [/usr/lib64/php7.0/man]
      --php-binary        [/usr/lib64/php7.0/bin/php]
      --php-sapis         [cli fpm]
      --configure-options [--prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --prefix=/usr/lib64/php7.0 --mandir=/usr/lib64/php7.0/man --infodir=/usr/lib64/php7.0/info --libdir=/usr/lib64/php7.0/lib --with-libdir=lib64 --without-pear --enable-maintainer-zts --enable-bcmath --with-bz2=/usr --enable-calendar --enable-ctype --with-curl=/usr --enable-dom --without-enchant --enable-exif --enable-fileinfo --enable-filter --disable-ftp --with-gettext=/usr --without-gmp --enable-hash --without-mhash --with-iconv --enable-intl --enable-ipv6 --enable-json --with-kerberos=/usr --enable-libxml --with-libxml-dir=/usr --enable-mbstring --with-mcrypt=/usr --with-onig=/usr --with-openssl=/usr --with-openssl-dir=/usr --enable-pcntl --enable-phar --enable-pdo --disable-opcache --without-pgsql --enable-posix --with-pspell=/usr --without-recode --enable-simplexml --disable-shmop --without-snmp --enable-soap --enable-sockets --with-sqlite3=/usr --disable-sysvmsg --disable-sysvsem --disable-sysvshm --with-fpm-systemd --with-tidy=/usr --enable-tokenizer --disable-wddx --enable-xml --enable-xmlreader --disable-xmlwriter --without-xmlrpc --without-xsl --enable-zip --with-zlib=/usr --enable-debug --enable-dba --without-cdb --with-db4=/usr --disable-flatfile --with-gdbm=/usr --disable-inifile --without-qdbm --with-freetype-dir=/usr --disable-gd-jis-conv --with-jpeg-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr --without-vpx-dir --with-gd --with-ldap=/usr --without-ldap-sasl --with-mysqli=mysqlnd --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-pdo-mysql=mysqlnd --without-pdo-pgsql --with-pdo-sqlite=/usr --without-pdo-odbc --with-readline=/usr --without-libedit --without-mm --with-pic --with-pcre-regex=/usr --with-pcre-dir=/usr --with-config-file-path=/etc/php/cli-php7.0 --with-config-file-scan-dir=/etc/php/cli-php7.0/ext-active --disable-embed --enable-cli --disable-cgi --disable-fpm --without-apxs2 build_alias=x86_64-pc-linux-gnu host_alias=x86_64-pc-linux-gnu CFLAGS=-O2 -pipe -march=native LDFLAGS=-Wl,-O1 -Wl,--as-needed CPPFLAGS= CXXFLAGS=-O2 -pipe -march=native]
      --version           [7.0.0-pl0-gentoo]
      --vernum            [70000]
    
  3. Remi Collet reporter
    (gdb) bt
    #0  0x0000555555841f00 in ZEND_DO_FCALL_SPEC_HANDLER () at /usr/src/debug/php-7.0.0RC7/Zend/zend_vm_execute.h:854
    #1  0x00005555557fe14b in execute_ex (ex=<optimized out>) at /usr/src/debug/php-7.0.0RC7/Zend/zend_vm_execute.h:414
    #2  0x00005555557aa0c9 in dtrace_execute_ex (execute_data=<optimized out>) at /usr/src/debug/php-7.0.0RC7/Zend/zend_dtrace.c:83
    #3  0x000055555584fa69 in zend_execute (op_array=<optimized out>, return_value=<optimized out>) at /usr/src/debug/php-7.0.0RC7/Zend/zend_vm_execute.h:458
    #4  0x00005555557bc287 in zend_execute_scripts (type=type@entry=8, retval=retval@entry=0x0, file_count=file_count@entry=3) at /usr/src/debug/php-7.0.0RC7/Zend/zend.c:1428
    #5  0x000055555574d090 in php_execute_script (primary_file=primary_file@entry=0x7fffffffd020) at /usr/src/debug/php-7.0.0RC7/main/main.c:2471
    #6  0x0000555555851956 in do_cli (argc=4, argv=0x555555ba5cf0) at /usr/src/debug/php-7.0.0RC7/sapi/cli/php_cli.c:974
    #7  0x0000555555625960 in main (argc=4, argv=0x555555ba5cf0) at /usr/src/debug/php-7.0.0RC7/sapi/cli/php_cli.c:1345
    
  4. Ruslan Osmanov repo owner

    I still cannot reproduce even with php7.0.0rc7

    ruslan@devbox ~/.../pecl/ev $ php --version 
    PHP 7.0.0RC7 (cli) (built: Nov 20 2015 21:41:49) ( ZTS DEBUG )
    Copyright (c) 1997-2015 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
    ruslan@devbox ~/.../pecl/ev $ php -n -c. -dextension_dir=.libs -dextension=ev.so tests/bug64788.phpt 
    --TEST--
    Check for bug #64788
    --FILE--
    ok 2--EXPECTF--
    ok %d
    

    Maybe it's your specific build.

  5. Ruslan Osmanov repo owner

    Reproduced on Ubuntu:

    (gdb) r -n -c. -dextension_dir=.libs -dextension=ev.so t.php
    The program being debugged has been started already.
    Start it from the beginning? (y or n) y
    
    Starting program: /home/ruslan/usr/bin/php -n -c. -dextension_dir=.libs -dextension=ev.so t.php
    [Thread debugging using libthread_db enabled]
    
    Program received signal SIGSEGV, Segmentation fault.
    0x08182c73 in php_var_export_ex (struc=0xb7613160, level=1, buf=0xbfffbce0)
        at /home/ruslan/src/php-src-php-7.0.0RC7/ext/standard/var.c:557
    557             smart_str_append(buf, Z_OBJCE_P(struc)->name);
    (gdb) p struc->value.obj
    $4 = (zend_object *) 0x0
    (gdb) bt
    #0  0x08182c73 in php_var_export_ex (struc=0xb7613160, level=1, buf=0xbfffbce0)
        at /home/ruslan/src/php-src-php-7.0.0RC7/ext/standard/var.c:557
    #1  0x08183ee3 in zif_var_export (execute_data=0xb7613130, return_value=0xb76130d0)
        at /home/ruslan/src/php-src-php-7.0.0RC7/ext/standard/var.c:606
    #2  0x08266ac2 in ZEND_DO_ICALL_SPEC_HANDLER (execute_data=<optimized out>)
        at /home/ruslan/src/php-src-php-7.0.0RC7/Zend/zend_vm_execute.h:586
    #3  0x082566de in execute_ex (ex=0xb7613020) at /home/ruslan/src/php-src-php-7.0.0RC7/Zend/zend_vm_execute.h:417
    #4  0x082ab9d9 in zend_execute (op_array=0xb766a280, return_value=0x0)
        at /home/ruslan/src/php-src-php-7.0.0RC7/Zend/zend_vm_execute.h:458
    #5  0x082149d0 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
        at /home/ruslan/src/php-src-php-7.0.0RC7/Zend/zend.c:1428
    #6  0x081a6975 in php_execute_script (primary_file=0xbfffe0c0) at /home/ruslan/src/php-src-php-7.0.0RC7/main/main.c:2471
    #7  0x082ada42 in do_cli (argc=6, argv=0x8462c70) at /home/ruslan/src/php-src-php-7.0.0RC7/sapi/cli/php_cli.c:974
    #8  0x080671ec in main (argc=6, argv=0x8462c70) at /home/ruslan/src/php-src-php-7.0.0RC7/sapi/cli/php_cli.c:1345
    (gdb) 
    
  6. Log in to comment