symfony: [Cache] Weird out of memory error where cache file is missing

Symfony version(s) affected: 3.4+

Description
Weird out of memory error where cache file is missing

How to reproduce
Not sure, see below.

Additional context

mmap() failed: [12] Cannot allocate memory
[PHP Warning:  Uncaught ErrorException: include(/home/circleci/api-platform/core/tests/Fixtures/app/var/cache/test/pools/xPMxMSz2th/C/R/iI7euN4OxW-zn9IcjAug): failed to open stream: No such file or directory in /home/circleci/api-platform/core/vendor/symfony/cache/Traits/PhpFilesTrait.php:114
Stack trace:
#0 /home/circleci/api-platform/core/vendor/symfony/cache/Traits/PhpFilesTrait.php(114): Symfony\Component\Cache\Adapter\PhpFilesAdapter::Symfony\Component\Cache\Adapter\{closure}(2, 'include(/home/c...', '/home/circleci/...', 114, Array)
#1 /home/circleci/api-platform/core/vendor/symfony/cache/Traits/PhpFilesTrait.php(114): include()
#2 /home/circleci/api-platform/core/vendor/symfony/cache/Traits/AbstractAdapterTrait.php(51): Symfony\Component\Cache\Adapter\PhpFilesAdapter->doFetch(Array)
#3 /home/circleci/api-platform/core/vendor/symfony/cache/Adapter/TraceableAdapter.php(77): Symfony\Component\Cache\Adapter\AbstractAdapter->getItem('DoctrineNamespa...')
#4 /home/circleci/api-platform/core/vendor/symfony/cache/DoctrinePro in /home/circleci/api-platform/core/vendor/symfony/cache/Traits/PhpFilesTrait.php on line 114]
[PHP Fatal error:  Out of memory (allocated 55050240) (tried to allocate 5664790229566204359 bytes) in /home/circleci/api-platform/core/vendor/symfony/cache/Traits/PhpFilesTrait.php on line 114]
Exited with code 255

https://circleci.com/gh/api-platform/core/14655?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

https://github.com/symfony/symfony/blob/v4.3.2/src/Symfony/Component/Cache/Traits/PhpFilesTrait.php#L114

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (12 by maintainers)

Most upvoted comments

OK, closing then thanks for investigating.

There’s a bug in PHP 7.3.0 up to 7.3.7 which may corrupt structures in memory:

This ticket looks like a presentation of that bug. Switching minors may change the location of that bug. Try disabling gc and see if that helps.

I don’t know. If you are on 7.2.20 and are affected by this, I’d try to go back to 7.2.19 if that changes anything.