Bug #78918 [Com]: Segfault with preloading Laravel
| From: | brent at spatie dot be | Date: | Mon, 16 Dec 2019 09:05:26 +0000 |
| Subject: | Bug #78918 [Com]: Segfault with preloading Laravel | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-224325@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78918&edit=1
ID: 78918
Comment by: brent at spatie dot be
Reported by: brent at spatie dot be
Summary: Segfault with preloading Laravel
Status: Feedback
Type: Bug
Package: opcache
Operating System: macOS 10.14
PHP Version: 7.4.0
Block user comment: N
Private report: N
New Comment:
Hi Nikita
I just used 7.4.1-RC1 to try out these changes. I didn't look too hard into the Carbon issue
for now, and simply removed the constant references in the vendor folder, so that I'd be able
to do my tests.
Unfortunately there's still a segfault, the same one:
0x00007fff7c4eb78e in ?? () from /usr/lib/system/libsystem_kernel.dylib
php-fpm is able to start and preload files, it's only after sending a request that the and when
the Laravel kernel is triggered that the segfault happens.
When opcache.preload is disabled in php.ini, things just work fine. Let me know if there's
anything else I can test.
Previous Comments:
------------------------------------------------------------------------
[2019-12-11 09:34:13] nikic@php.net
The additional class_alias issue is fixed by https://github.com/php/php-src/commit/3280209c0312df000d558e029aa4e8c63912967a.
------------------------------------------------------------------------
[2019-12-11 08:02:08] nikic@php.net
Additional failure case in class alias support:
interface I {}
class B implements I {}
class_alias('B', 'C');
update_parent_ce does not handle duplicate classes correctly.
------------------------------------------------------------------------
[2019-12-11 00:34:31] hopeseekr at gmail dot com
I would have guessed someone would have run Laravel's phpunit test suite while and after
developing something as inner-touching as preloading.
Guess not! Probably didn't run Symonfy's tests either.
------------------------------------------------------------------------
[2019-12-10 13:19:45] cmb@php.net
> You will not get a fatal error [â¦]
That is supposed to be "You will now get a fatal error [â¦]".
------------------------------------------------------------------------
[2019-12-10 12:59:02] nikic@php.net
Support for class aliases has been added, and issues relating to classes with unresolved
initializers fixed.
You will not get a fatal error if you try to preload a class with unresolved initializers under the
"require" model (under the opcache_compile_file() model a graceful fallback is possible).
However, opcache will try harder to make sure everything can be resolved.
I was not able to test preloading Laravel due to https://github.com/briannesbitt/Carbon/blob/298d9f0e8e369301b0ca647f3ce9c92b53ad3a82/src/Carbon/Traits/Date.php#L541-L556.
This references constants that are not defined in the trait and are only available in the class
using the trait. This will need to either be fixed, or the trait and it's dependencies skipped.
------------------------------------------------------------------------
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=78918
--
Edit this bug report at https://bugs.php.net/bug.php?id=78918&edit=1