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

From: Date: Tue, 28 Jul 2015 11:43:46 +0000
Subject: Bug #69674 [Opn]: SIGSEGV array.c:953
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194775@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)
+PHP Version:        7.0.0beta2
 Block user comment: N
 Private report:     N

 New Comment:

This issue still exists with beta2.
What is needed to get this fixed?


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

Output of other PHP versions:

http://3v4l.org/UO3aI

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

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


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 (#194775) next »