php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73671 Zend assertion error in `make test` when php 7.1 is built with --enable-debug
Submitted: 2016-12-07 06:01 UTC Modified: 2017-10-24 06:30 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: tandre at ifwe dot co Assigned:
Status: Open Package: solr (PECL)
PHP Version: 7.1.0 OS: Ubuntu/Any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2016-12-07 06:01 UTC] tandre at ifwe dot co
Description:
------------
Both the current master branch and the extension's 2.4.0 release are affected in php 7.1. 7.0 doesn't seem to have this assertion.

Solr declares that it returns a reference for many functions in the method signatures. However, it returns IS_OBJECT or IS_NULL in many places in php 7 (E.g. uses ZVAL_COPY for the implementation of solr_return_solr_params_object();
 (But does set the is_ref flag in php 5). (I haven't investigated why it declared itself as returning a reference, but it didn't seem to make sense for SolrQuery->addFilterQuery())

Various errors of the below form are seen:

001+ php: /usr/local/php-7.1.0-src/Zend/zend_vm_execute.h:980: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER: Assertion `(call->func->common.fn_flags & 0x4000000) ? (
zval_get_type(&(*(ret))) == 10) : !(zval_get_type(&(*(ret))) == 10)' failed.

(0x4000000 is ZEND_ACC_RETURN_REFERENCE)

A patch is included, and tests passed for php 7.0 and php 7.1 built with --enable-debug. I 

Test script:
---------------
# Build php with --enable-maintainer-zts --enable-debug --enable-libxml

# in another window, run a solr server
sudo docker run -p 8983:8983 --name solr5 omars/solr53
cd solr
phpize
./configure
make clean
make test

Expected result:
----------------
`make test` should have all tests pass in php 7.1 when php is compiled with --enable-debug

Actual result:
--------------
Dozens of tests abort with zend assertion errors

Patches

solr_return_reference.patch (last revision 2016-12-07 06:02 UTC) by tandre at ifwe dot co)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-15 10:37 UTC] omars@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: omars
 [2016-12-15 10:37 UTC] omars@php.net
Thanks
 [2017-10-24 05:17 UTC] kalle@php.net
-Status: Verified +Status: Assigned
 [2017-10-24 06:30 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: omars +Assigned To:
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC