php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #71163 Segmentation Fault (cleanup_unfinished_calls)
Submitted: 2015-12-19 01:44 UTC Modified: 2015-12-19 04:28 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: bowersbros at gmail dot com Assigned: laruence (profile)
Status: Closed Package: *General Issues
PHP Version: 7.0.1 OS: Ubuntu 14.04
Private report: No CVE-ID: None
 [2015-12-19 01:44 UTC] bowersbros at gmail dot com
Description:
------------
When running the unit tests for the Lithium framework (Li3 - https://github.com/unionofrad/lithium), a segmentation fault occurs in one of the tests.

The error thrown is: php: /home/vagrant/php-src/Zend/zend_execute.c:2466: cleanup_unfinished_calls: Assertion `op_num' failed.

I have tried and failed to generate a core dump file, and run it through gdb.

This issue is present in 7.0.0 and 7.0.1, but not in 5.6.14 (not tested others)

It is also current in the current master branch on GitHub (labelled as 7.1.0-dev).

To recreate, clone https://github.com/alexbowers/lithium/tree/feature/alternative-string-fix and run the following command:

lithium/console/li3 test tests/cases/core/LibrariesTest.php

Sometimes this passes. I have two virtual machines locally, and on one this passes, on the other it doesn't.

When it does, running this command causes the SegFault:

lithium/console/li3 test tests





Test script:
---------------
https://github.com/alexbowers/lithium/tree/feature/alternative-string-fix

Expected result:
----------------
No Segmentation Fault (test may fail though)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-12-19 02:19 UTC] bowersbros at gmail dot com
Clarification:

I have two Virtual Machines running locally with PHP 7.0.1 and the github master branch (labelled as 7.1.0-dev)

Both of these machines are Ubuntu 14.04 based.

The 7.1.0-dev was compiled from source with _only_ --enable-debug configured. Nothing else.

The 7.0.1 was installed via https://launchpad.net/~ondrej/+archive/ubuntu/php-7.0

On the 7.1.0-dev the following commands cause the SegFault:

$ lithium/console/li3 test tests/cases/core/LibrariesTest.php

$ lithium/console/li3 test tests/cases/core

$ lithium/console/li3 test tests/cases

$ lithium/console/li3 test tests

--

On the 7.0.1 setup, the following commands cause the SegFault:

$ lithium/console/li3 test tests

The other commands from the 7.1.0-dev do not cause the SegFault.

However, the segmentation fault is caused by the same test case in the code.

As far as I can see, the cause is an include, but I cannot verify that for certain.
 [2015-12-19 03:49 UTC] laruence@php.net
-Assigned To: +Assigned To: laruence
 [2015-12-19 04:28 UTC] laruence@php.net
A simple reproduce script is:

<?php
function __autoload($name) {
    eval ("class $name { public static function foo() {}}");
    throw new Exception("boom");
}

function test2() {
    try {
        Test::foo();
    } catch (Exception $e) {
    }
}

function test() {
    test2();
}

test();


and I've got fixes, but need more thinking... since there is not only one.. :)
 [2015-12-19 05:52 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=eb4ce3f1a8d3c14bf9245ef730d885be359499a8
Log: Fixed bug #71163 (Segmentation Fault: cleanup_unfinished_calls)
 [2015-12-19 05:52 UTC] laruence@php.net
-Status: Assigned +Status: Closed
 [2016-07-20 11:34 UTC] davey@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=eb4ce3f1a8d3c14bf9245ef730d885be359499a8
Log: Fixed bug #71163 (Segmentation Fault: cleanup_unfinished_calls)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC