Bug #78903 [Opn]: "Allowed memory size" and "bus error" crashes in 7.4 that do not appear in 7.3

From: Date: Wed, 11 Dec 2019 11:29:52 +0000
Subject: Bug #78903 [Opn]: "Allowed memory size" and "bus error" crashes in 7.4 that do not appear in 7.3
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-224217@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:            "Allowed memory size" and "bus error" crashes in 7.4
                     that do not appear in 7.3
 Status:             Open
 Type:               Bug
 Package:            Reproducible crash
 Operating System:   macOS 10.15.1
 PHP Version:        7.4.0
 Block user comment: N
 Private report:     N

 New Comment:

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


Previous Comments:
------------------------------------------------------------------------
[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.

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

Can't reproduce memory limit / bus error, presumably because the test suite does not work
correctly: I get a lot of "RuntimeException: The config file
"/home/nikic/repos/opencfp/config/testing.yml" does not exist" errors.

------------------------------------------------------------------------
[2019-12-03 22:46:32] chartjes at grumpy-learning dot com

The command I use to run the integration test suite is:

SYMFONY_DEPRECATIONS_HELPER=disabled CFP_ENV=testing vendor/bin/phpunit --testsuite integration

If I set memory_limit in my phpunit.xml file to be -1, it crashes with a bus error.

gdb has issues on macOS Catalina where it needs to be codesigned and I have tried numerous fixes to
get it to work and have been unsuccessful.

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


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