php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80321 Segfault with standard Symfony demo app
Submitted: 2020-11-05 11:58 UTC Modified: 2020-11-05 13:12 UTC
From: phil at phil-taylor dot com Assigned:
Status: Closed Package: opcache
PHP Version: 8.0.0RC3 OS: Alpine in docker
Private report: No CVE-ID: None
 [2020-11-05 11:58 UTC] phil at phil-taylor dot com
Description:
------------
forked from https://github.com/symfony/symfony/issues/38997

When PHP8RC3 is enabled in FPM mode, with preload enabled using Symfony 5.1.7 (or Symfony 5), when a page loads, and PHP accesses the Cache Pool randomly named folders, PHP Segfaults and crashes. 

Reproducible with a bare, new, Symfony demo app.

Test script:
---------------
Install PHP 8.0.0 RC 3 (However you wish, mine was a docker container)
Install Symfony CLI binary

symfony new --demo my_project
edit .env set ENV=prod
php bin/console cache:clear

Edit php.ini and set (note your path & user might be different)

[opcache]
opcache.enable=1
opcache.preload='/application/var/cache/prod/App_KernelProdContainer.preload.php';
opcache.preload_user=www-data

cd my_project/public
php -S 0.0.0.0:8000
Try to load a webpage

Expected result:
----------------
No Segfault - page loads.

Actual result:
--------------
see screenshot: https://user-images.githubusercontent.com/400092/98182889-c4f74d00-1efe-11eb-8d3e-930d67df7d88.png

"Segmentation Fault"

see screenshot: https://user-images.githubusercontent.com/400092/98183196-93cb4c80-1eff-11eb-8a00-4d03e02551be.png


When tracing the process I get to:

SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x10}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-05 12:03 UTC] cmb@php.net
That might have the same cause as bug #80307.  Could you try with
a current Git snapshot?
 [2020-11-05 13:11 UTC] phil at phil-taylor dot com
Im pleased to report, after compiling PHP from git sources, in Alpine Docker containers, and running PHP 8.1.0-dev with my massive Symfony 4.4.16 application, with PHP Preloading enabled, and JIT Enabled, this bug seems resolved and PHP doesn't segfault.

It seems this has been fixed since PHP8.0RC3 :-) 

You can also take this as a vote of confidence that bug #80307 fix has been tested and works. 

Thanks.
 [2020-11-05 13:12 UTC] phil at phil-taylor dot com
-Status: Open +Status: Closed
 [2020-11-05 13:12 UTC] phil at phil-taylor dot com
Closing... Thank you...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 15:01:29 2024 UTC