Bug #69674 [Opn]: SIGSEGV array.c:953

From: Date: Tue, 23 Jun 2015 14:30:34 +0000
Subject: Bug #69674 [Opn]: SIGSEGV array.c:953
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193805@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69674&edit=1

 ID:                 69674
 User updated by:    opitz dot alexander at googlemail dot com
 Reported by:        opitz dot alexander at googlemail dot com
 Summary:            SIGSEGV array.c:953
 Status:             Open
 Type:               Bug
 Package:            *General Issues
 Operating System:   Linux
 PHP Version:        master-Git-2015-05-20 (Git)
 Block user comment: N
 Private report:     N

 New Comment:

Output of other PHP versions:

http://3v4l.org/UO3aI


Previous Comments:
------------------------------------------------------------------------
[2015-06-23 13:38:33] opitz dot alexander at googlemail dot com

Snippet to crash PHP7.

Without the unset, $var isn't changed and returns same content as before.
If array is empty in the first assignment you get a notice that $var is an uninitialized var.

<?php
    $configuration = array(
        'controllerConfiguration' => array(
            'TheFirstController' => array(
            ),
        )
    );
    $var = current(array_keys($configuration['controllerConfiguration']));
    var_dump($var);

    unset($configuration['controllerConfiguration']['TheFirstController']);

    $configuration['controllerConfiguration'] = array();
    $var = current(array_keys($configuration['controllerConfiguration']));
    var_dump($var);

------------------------------------------------------------------------
[2015-06-23 13:26:19] opitz dot alexander at googlemail dot com

Dragged this down a bit further.

The crash happens on following line:
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/extbase/Classes/Mvc/Web/RequestBuilder.php#L110

$this->defaultControllerName =
current(array_keys($configuration['controllerConfiguration']));

in the crashing test, this is an empty array. But trying this in a 10 lines test doesn't fail.

------------------------------------------------------------------------
[2015-06-05 12:18:20] opitz dot alexander at googlemail dot com

Example of output for running the tests.

https://travis-ci.org/TYPO3/TYPO3.CMS/jobs/65556246

------------------------------------------------------------------------
[2015-05-22 10:25:59] opitz dot alexander at googlemail dot com

I run it normaly with

phpunit -c typo3/sysext/core/Build/UnitTests.xml

At the moment I use PHPUnit 4.6.6

------------------------------------------------------------------------
[2015-05-22 09:55:24] laruence@php.net

okey, I have cloned the TYPO3 , how could I run the test?

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=69674


--
Edit this bug report at https://bugs.php.net/bug.php?id=69674&edit=1


Thread (16 messages)

« previous php.bugs (#193805) next »