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: 2019-07-15 21:34 UTC
Votes:2
Avg. Score:3.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: tandre at ifwe dot co Assigned: omars (profile)
Status: Closed Package: solr (PECL)
PHP Version: 7.1.0 OS: Ubuntu/Any
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tandre at ifwe dot co
New email:
PHP Version: OS:

 

 [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)

Pull Requests

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:
 [2019-03-29 09:31 UTC] omars@php.net
-Assigned To: +Assigned To: omars
 [2019-07-15 21:34 UTC] omars@php.net
-Status: Assigned +Status: Closed
 [2019-07-15 21:34 UTC] omars@php.net
released: 2.5.0
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 12:01:33 2025 UTC