php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74736 solr master branch fails to build in PHP 7.2.0alpha1, would have test errors
Submitted: 2017-06-10 01:31 UTC Modified: -
From: tandre at themeetgroup dot com Assigned:
Status: Open Package: solr (PECL)
PHP Version: 7.2.0alpha1 OS:
Private report: No CVE-ID:
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tandre at themeetgroup dot com
New email:
PHP Version: OS:

 

 [2017-06-10 01:31 UTC] tandre at themeetgroup dot com
Description:
------------
It uses the constant ZEND_ACC_CLONE, which was removed in PHP 7.2.0alpha1

(Comparing PHP 7.1 and PHP 7.2 source, it seems like that constant (bit flag) can be removed, and doesn't need to be replaced with any new flags)

After attempting to patch it (see attached patch), there are internal Zend assertion errors when PHP is compiled in debug mode.

PHP version has --enable-maintainer-zts and --enable-debug:
PHP 7.2.0alpha1 (cli) (built: Jun  9 2017 17:12:37) ( ZTS DEBUG )

- Tests pass in php 7.1. The issue I'm describing is separate from bug #73671 , which I filed for a different php 7.1 bug

Test script:
---------------
# 1.
git clone git@github.com:php/pecl-search_engine-solr.git
cd pecl-search_engine-solr

phpize; ./configure; make
# See the build failure reported
# 2. After patching the source manually

# Start solr java service in the background in a different window before running tests, see README of solr

make test



Expected result:
----------------
Unit tests pass, the same as they would for php 7.1 master branch

Actual result:
--------------
The test case contains various assertion failures such as the below:

========OUT========
php: php-7.2.0alpha1/Zend/zend_hash.c:2051: zend_hash_internal_pointer_reset_ex: Assertion `(&ht->nInternalPointer != pos || (ht)->gc.refcount == 1) || ((ht)->u.flags & (1<<6))' failed.
Aborted

Termsig=6
========DONE========
...
=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
SolrClient::deleteByIds() - Test deleting documents by an array of IDS [tests/007.solrclient_deleteByIds.phpt]
SolrClient::getByIds() - Testing Real Time Get by ids [tests/013.solrclient_getByIds.phpt]
SolrClient::deleteByQueries() - delete by multiple queries [tests/017.solrclient_deletebyqueries.phpt]
SolrResponse::getResponse() - maxScore [tests/104.solrresponse_get_response_maxscore.phpt]
SolrResponse::getDigestedResponse() - Get Raw Response Headers [tests/108.solrresponse_getdigestedresponse.phpt]
Solr Bug #72033 - Real Time Get requests fails if it wasn't the first request [tests/bug_72033.phpt]
=====================================================================

Additionally, obtained the following backtrace when invoking one of the tests with gdb

$ gdb -args php -d extension=modules/solr.so tests/007.solrclient_deleteByIds.php
... run it ...
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
php: /path/to/php-7.2.0alpha1/Zend/zend_hash.c:2051: zend_hash_internal_pointer_reset_ex: Assertion `(&ht->nInternalPointer != pos || (ht)->gc.refcount == 1) || ((ht)->u.flags & (1<<6))' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff41ffc37 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff41ffc37 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff4203028 in __GI_abort () at abort.c:89
#2  0x00007ffff41f8bf6 in __assert_fail_base (fmt=0x7ffff434cbf8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x14acf20 "(&ht->nInternalPointer != pos || (ht)->gc.refcount == 1) || ((ht)->u.flags & (1<<6))", file=file@entry=0x14acd30 "/path/to/php-7.2.0alpha1/Zend/zend_hash.c", line=line@entry=2051, 
    function=function@entry=0x14ad420 <__PRETTY_FUNCTION__.10106> "zend_hash_internal_pointer_reset_ex") at assert.c:92
#3  0x00007ffff41f8ca2 in __GI___assert_fail (
    assertion=0x14acf20 "(&ht->nInternalPointer != pos || (ht)->gc.refcount == 1) || ((ht)->u.flags & (1<<6))",
    file=0x14acd30 "/path/to/php-7.2.0alpha1/Zend/zend_hash.c", line=2051, 
    function=0x14ad420 <__PRETTY_FUNCTION__.10106> "zend_hash_internal_pointer_reset_ex") at assert.c:101
#4  0x0000000000c42ff3 in zend_hash_internal_pointer_reset_ex (ht=0x7fffedc03d80, pos=0x7fffedc03da4)
    at /path/to/php-7.2.0alpha1/Zend/zend_hash.c:2051
#5  0x00007fffed2ec07f in zim_SolrClient_deleteByIds (execute_data=0x7fffedc22260, return_value=0x7fffedc22170)
    at /path/to/pecl-search_engine-solr/src/php7/php_solr_client.c:1081
#6  0x0000000000c95a70 in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER ()
    at /path/to/php-7.2.0alpha1/Zend/zend_vm_execute.h:1030
#7  0x0000000000d1de44 in execute_ex (ex=0x7fffedc22030)
    at /path/to/php-7.2.0alpha1/Zend/zend_vm_execute.h:59754
#8  0x0000000000d232a6 in zend_execute (op_array=0x7fffedc85300, return_value=0x0)
    at /path/to/php-7.2.0alpha1/Zend/zend_vm_execute.h:63750
#9  0x0000000000c2999c in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /path/to/php-7.2.0alpha1/Zend/zend.c:1537
#10 0x0000000000b64f1d in php_execute_script (primary_file=0x7fffffffc5b0)
    at /path/to/php-7.2.0alpha1/main/main.c:2548
#11 0x0000000000d25ea1 in do_cli (argc=4, argv=0x18a3d90)
    at /path/to/php-7.2.0alpha1/sapi/cli/php_cli.c:1002
#12 0x0000000000d27324 in main (argc=4, argv=0x18a3d90) at /path/to/php-7.2.0alpha1/sapi/cli/php_cli.c:1395


Patches

solr_remove_ZEND_ACC_CLONE.patch (last revision 2017-06-10 01:31 UTC) by tandre at themeetgroup dot com)

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Tue Aug 29 15:01:52 2017 UTC