Bug #78903 [Csd]: Conflict in RTD key for closures results in crash

From: Date: Wed, 11 Dec 2019 12:10:41 +0000
Subject: Bug #78903 [Csd]: Conflict in RTD key for closures results in crash
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-224219@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78903&edit=1

 ID:                 78903
 Updated by:         nikic@php.net
 Reported by:        chartjes at grumpy-learning dot com
 Summary:            Conflict in RTD key for closures results in crash
 Status:             Closed
 Type:               Bug
 Package:            Reproducible crash
 Operating System:   macOS 10.15.1
 PHP Version:        7.4.0
-Assigned To:        
+Assigned To:        nikic
 Block user comment: N
 Private report:     N

 New Comment:

Tests run through now with one failure that also exists on 7.3:

1) OpenCFP\Test\Integration\Http\Controller\Admin\SpeakersControllerTest::indexActionWorksCorrectly

Warning: sprintf(): Too few arguments in
/home/nikic/repos/opencfp/vendor/codedungeon/phpunit-result-printer/src/ResultPrinter71.php on line
77

/home/nikic/repos/opencfp/tests/Helper/ResponseHelper.php:60
/home/nikic/repos/opencfp/tests/Integration/Http/Controller/Admin/SpeakersControllerTest.php:43


Previous Comments:
------------------------------------------------------------------------
[2019-12-11 12:08:22] nikic@php.net

Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=b55033fa18afd9bb60fc4537270266d808ec0868
Log: Fixed bug #78903: Conflict in RTD key for closures results in crash

------------------------------------------------------------------------
[2019-12-11 11:29:52] nikic@php.net

Initial analysis suggests that this is caused by an RTD key collision. While a closure is being
executed, the file that defines the closure is re-compiled and a colliding RTD key is generated,
replacing the original closure. This is a long-standing problem without an easy fix, but we can at
least mitigate this in a similar way we do for anon classes.

This likely also indicates a bug/inefficiency in Laravel, because it likely shouldn't be
loading the same file twice.

[0x7fac0481b5d0]
Illuminate\Database\Eloquent\Factory->load("/home/nikic/repos/opencfp/tests/../factories")
/home/nikic/repos/opencfp/vendor/illuminate/database/Eloquent/Factory.php:202 
[0x7fac0481b500] Illuminate\Database\Eloquent\Factory->construct(object[0x7fac0481b550],
"/home/nikic/repos/opencfp/tests/../factories")
/home/nikic/repos/opencfp/vendor/illuminate/database/Eloquent/Factory.php:54 
[0x7fac0481b310] factory(object[0x7fac0481b360]) /home/nikic/repos/opencfp/tests/helpers.php:28 
[0x7fac0481b280] Illuminate\Database\Eloquent\Factory->{closure}()
/home/nikic/repos/opencfp/factories/Common.php:36

------------------------------------------------------------------------
[2019-12-04 13:25:30] chartjes at grumpy-learning dot com

My apologies for not providing clearer instructions for running the tests.

You could copy phpunit.xml.dist to phpunit.xml and change the memory_limit value in there, which the
tests will then use.

------------------------------------------------------------------------
[2019-12-04 08:33:36] nikic@php.net

Turns out the memory_limit is set in the phpunit.xml.dist, and removing it there does produce a
segfault. There is no useful trace because a corrupted function causes a jump to an invalid address.
Unfortunately there are no warnings under valgrind.

------------------------------------------------------------------------
[2019-12-04 07:32:32] nikic@php.net

After creating a cfp_test mysql user and database and running "make integration" first, I
now get:

Fatal error: Allowed memory size of 805306368 bytes exhausted at
/home/nikic/php-7.4/Zend/zend_hash.c:2079 (tried to allocate 1048616 bytes) in
/home/nikic/repos/opencfp/vendor/fzaninotto/faker/src/Faker/Provider/Text.php on line 84

I was not able to set memory_limit=-1 to produce the bus error, because the test runner apparently
ignores ini files and options specified on the command line.

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


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=78903


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


Thread (13 messages)

« previous php.bugs (#224219) next »