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: 2017-12-01 23:12 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: tandre at themeetgroup dot com Assigned: tandre (profile)
Status: Closed Package: solr (PECL)
PHP Version: 7.2.0alpha1 OS:
Private report: No CVE-ID: None
 [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

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-12-01 22:44 UTC] steve dot rolfe at gmail dot com
This affects PHP 7.2 release

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /tmp/pear/temp/pear-build-defaultuserbGdcdn/solr-2.4.0/libtool --mode=compile cc  -I. -I/tmp/pear/temp/solr -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserbGdcdn/solr-2.4.0/include -I/tmp/pear/temp/pear-build-defaultuserbGdcdn/solr-2.4.0/main -I/tmp/pear/temp/solr -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/libxml2  -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/libxml2 -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/solr/src/php7/php_solr.c -o src/php7/php_solr.lo
mkdir src/php7/.libs
 cc -I. -I/tmp/pear/temp/solr -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserbGdcdn/solr-2.4.0/include -I/tmp/pear/temp/pear-build-defaultuserbGdcdn/solr-2.4.0/main -I/tmp/pear/temp/solr -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/libxml2 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/libxml2 -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/solr/src/php7/php_solr.c  -fPIC -DPIC -o src/php7/.libs/php_solr.o
In file included from /usr/local/include/php/main/php.h:39:0,
                 from /tmp/pear/temp/solr/src/php7/php_solr.h:28,
                 from /tmp/pear/temp/solr/src/php7/php_solr.c:23:
/tmp/pear/temp/solr/src/php7/php_solr.c:560:56: error: 'ZEND_ACC_CLONE' undeclared here (not in a function)
  PHP_ME(SolrDocument, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE)
                                                        ^
/usr/local/include/php/Zend/zend_API.h:70:157: note: in definition of macro 'ZEND_FENTRY'
 #define ZEND_FENTRY(zend_name, name, arg_info, flags) { #zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
                                                                                                                                                             ^~~~~
/usr/local/include/php/main/php.h:422:25: note: in expansion of macro 'ZEND_ME'
 #define PHP_ME          ZEND_ME
                         ^~~~~~~
/tmp/pear/temp/solr/src/php7/php_solr.c:560:2: note: in expansion of macro 'PHP_ME'
  PHP_ME(SolrDocument, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE)
  ^~~~~~
/tmp/pear/temp/solr/src/php7/php_solr.c:603:59: error: invalid operands to binary | (have 'int' and 'zend_function_entry * {aka struct _zend_function_entry *}')
  PHP_ME(SolrInputDocument, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE)
                                                           ^
/usr/local/include/php/Zend/zend_API.h:70:157: note: in definition of macro 'ZEND_FENTRY'
 #define ZEND_FENTRY(zend_name, name, arg_info, flags) { #zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
                                                                                                                                                             ^~~~~
/usr/local/include/php/main/php.h:422:25: note: in expansion of macro 'ZEND_ME'
 #define PHP_ME          ZEND_ME
                         ^~~~~~~
/tmp/pear/temp/solr/src/php7/php_solr.c:603:2: note: in expansion of macro 'PHP_ME'
  PHP_ME(SolrInputDocument, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE)
  ^~~~~~
/usr/local/include/php/Zend/zend_compile.h:220:26: error: initializer element is not constant
 #define ZEND_ACC_PUBLIC  0x100
                          ^
/usr/local/include/php/Zend/zend_API.h:70:157: note: in definition of macro 'ZEND_FENTRY'
 #define ZEND_FENTRY(zend_name, name, arg_info, flags) { #zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
                                                                                                                                                             ^~~~~
/usr/local/include/php/main/php.h:422:25: note: in expansion of macro 'ZEND_ME'
 #define PHP_ME          ZEND_ME
                         ^~~~~~~
/tmp/pear/temp/solr/src/php7/php_solr.c:603:43: note: in expansion of macro 'ZEND_ACC_PUBLIC'
  PHP_ME(SolrInputDocument, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE)
                                           ^~~~~~~~~~~~~~~
/usr/local/include/php/Zend/zend_compile.h:220:26: note: (near initialization for 'solr_input_document_methods[2].flags')
 #define ZEND_ACC_PUBLIC  0x100
                          ^
/usr/local/include/php/Zend/zend_API.h:70:157: note: in definition of macro 'ZEND_FENTRY'
 #define ZEND_FENTRY(zend_name, name, arg_info, flags) { #zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
                                                                                                                                                             ^~~~~
/usr/local/include/php/main/php.h:422:25: note: in expansion of macro 'ZEND_ME'
 #define PHP_ME          ZEND_ME
                         ^~~~~~~
/tmp/pear/temp/solr/src/php7/php_solr.c:603:43: note: in expansion of macro 'ZEND_ACC_PUBLIC'
  PHP_ME(SolrInputDocument, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE)
                                           ^~~~~~~~~~~~~~~
/tmp/pear/temp/solr/src/php7/php_solr.c:636:52: error: invalid operands to binary | (have 'int' and 'zend_function_entry * {aka struct _zend_function_entry *}')
  PHP_ME(SolrClient, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE)
                                                    ^
/usr/local/include/php/Zend/zend_API.h:70:157: note: in definition of macro 'ZEND_FENTRY'
 #define ZEND_FENTRY(zend_name, name, arg_info, flags) { #zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
                                                                                                                                                             ^~~~~
/usr/local/include/php/main/php.h:422:25: note: in expansion of macro 'ZEND_ME'
 #define PHP_ME          ZEND_ME
                         ^~~~~~~
/tmp/pear/temp/solr/src/php7/php_solr.c:636:2: note: in expansion of macro 'PHP_ME'
  PHP_ME(SolrClient, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE)
  ^~~~~~
/usr/local/include/php/Zend/zend_compile.h:220:26: error: initializer element is not constant
 #define ZEND_ACC_PUBLIC  0x100
                          ^
/usr/local/include/php/Zend/zend_API.h:70:157: note: in definition of macro 'ZEND_FENTRY'
 #define ZEND_FENTRY(zend_name, name, arg_info, flags) { #zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
                                                                                                                                                             ^~~~~
/usr/local/include/php/main/php.h:422:25: note: in expansion of macro 'ZEND_ME'
 #define PHP_ME          ZEND_ME
                         ^~~~~~~
/tmp/pear/temp/solr/src/php7/php_solr.c:636:36: note: in expansion of macro 'ZEND_ACC_PUBLIC'
  PHP_ME(SolrClient, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE)
                                    ^~~~~~~~~~~~~~~
/usr/local/include/php/Zend/zend_compile.h:220:26: note: (near initialization for 'solr_client_methods[4].flags')
 #define ZEND_ACC_PUBLIC  0x100
                          ^
/usr/local/include/php/Zend/zend_API.h:70:157: note: in definition of macro 'ZEND_FENTRY'
 #define ZEND_FENTRY(zend_name, name, arg_info, flags) { #zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
                                                                                                                                                             ^~~~~
/usr/local/include/php/main/php.h:422:25: note: in expansion of macro 'ZEND_ME'
 #define PHP_ME          ZEND_ME
                         ^~~~~~~
/tmp/pear/temp/solr/src/php7/php_solr.c:636:36: note: in expansion of macro 'ZEND_ACC_PUBLIC'
  PHP_ME(SolrClient, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE)
                                    ^~~~~~~~~~~~~~~
/tmp/pear/temp/solr/src/php7/php_solr.c:713:52: error: invalid operands to binary | (have 'int' and 'zend_function_entry * {aka struct _zend_function_entry *}')
  PHP_ME(SolrParams, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE)
                                                    ^
/usr/local/include/php/Zend/zend_API.h:70:157: note: in definition of macro 'ZEND_FENTRY'
 #define ZEND_FENTRY(zend_name, name, arg_info, flags) { #zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
                                                                                                                                                             ^~~~~
/usr/local/include/php/main/php.h:422:25: note: in expansion of macro 'ZEND_ME'
 #define PHP_ME          ZEND_ME
                         ^~~~~~~
/tmp/pear/temp/solr/src/php7/php_solr.c:713:2: note: in expansion of macro 'PHP_ME'
  PHP_ME(SolrParams, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE)
  ^~~~~~
/usr/local/include/php/Zend/zend_compile.h:220:26: error: initializer element is not constant
 #define ZEND_ACC_PUBLIC  0x100
                          ^
/usr/local/include/php/Zend/zend_API.h:70:157: note: in definition of macro 'ZEND_FENTRY'
 #define ZEND_FENTRY(zend_name, name, arg_info, flags) { #zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
                                                                                                                                                             ^~~~~
/usr/local/include/php/main/php.h:422:25: note: in expansion of macro 'ZEND_ME'
 #define PHP_ME          ZEND_ME
                         ^~~~~~~
/tmp/pear/temp/solr/src/php7/php_solr.c:713:36: note: in expansion of macro 'ZEND_ACC_PUBLIC'
  PHP_ME(SolrParams, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE)
                                    ^~~~~~~~~~~~~~~
/usr/local/include/php/Zend/zend_compile.h:220:26: note: (near initialization for 'solr_params_methods[7].flags')
 #define ZEND_ACC_PUBLIC  0x100
                          ^
/usr/local/include/php/Zend/zend_API.h:70:157: note: in definition of macro 'ZEND_FENTRY'
 #define ZEND_FENTRY(zend_name, name, arg_info, flags) { #zend_name, name, arg_info, (uint32_t) (sizeof(arg_info)/sizeof(struct _zend_internal_arg_info)-1), flags },
                                                                                                                                                             ^~~~~
/usr/local/include/php/main/php.h:422:25: note: in expansion of macro 'ZEND_ME'
 #define PHP_ME          ZEND_ME
                         ^~~~~~~
/tmp/pear/temp/solr/src/php7/php_solr.c:713:36: note: in expansion of macro 'ZEND_ACC_PUBLIC'
  PHP_ME(SolrParams, __clone, NULL, ZEND_ACC_PUBLIC | ZEND_ACC_CLONE)
                                    ^~~~~~~~~~~~~~~
make: *** [Makefile:194: src/php7/php_solr.lo] Error 1
ERROR: `make' failed
 [2017-12-01 23:12 UTC] tandre@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: tandre
 [2017-12-01 23:12 UTC] tandre@php.net
PHP 7.2 builds were fixed by https://git.php.net/?p=pecl/search_engine/solr.git;a=commit;h=744e32915d5989101267ed2c84a407c582dc6f31 and other commits on master (On master, but no release tarball was published yet)

Solr now builds in 7.2.0 for me.
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC