Bug #78225 [Com]: Preloading Laravel results in a segfault
| From: | brent at spatie dot be | Date: | Wed, 03 Jul 2019 12:51:36 +0000 |
| Subject: | Bug #78225 [Com]: Preloading Laravel results in a segfault | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-221619@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78225&edit=1
ID: 78225
Comment by: brent at spatie dot be
Reported by: brent at spatie dot be
Summary: Preloading Laravel results in a segfault
Status: Open
Type: Bug
Package: opcache
Operating System: macOS Mojave
PHP Version: 7.4.0alpha2
Block user comment: N
Private report: N
New Comment:
Thanks Nikita, the improved logging helps indeed.
Could you tell me what the correct approach would be in this case?
```
Can't preload unlinked class Ramsey\Uuid\Exception\UnsupportedOperationException: Parent with
unresolved property types RuntimeException in
```
It turns out that this specific class extends
\RuntimeException like so:
```
class UnsupportedOperationException extends \RuntimeException
```
How would you go about preloading built-in classes? Shouldn't this happen automatically?
Previous Comments:
------------------------------------------------------------------------
[2019-07-03 12:07:18] nikic@php.net
I've pushed some improved diagnostics for the unlinked class messages. You'll now see
something like:
Warning: Can't preload unlinked class Illuminate\Http\Exceptions\PostTooLargeException: Unknown
parent Symfony\Component\HttpKernel\Exception\HttpException in
/home/nikic/laravel-preload/vendor/laravel/framework/src/Illuminate/Http/Exceptions/PostTooLargeException.php
on line 8
Which should make it clear that the reason why you're not seeing much preloading is that you
are only preloading Laravel, without its Symfony component dependencies.
------------------------------------------------------------------------
[2019-07-03 11:45:04] nikic@php.net
I can't reproduce this crash on current 7.4 head.
------------------------------------------------------------------------
[2019-07-02 12:49:30] brent at spatie dot be
Edit because of autofiller changing the summary
------------------------------------------------------------------------
[2019-07-02 12:48:43] brent at spatie dot be
I'm not sure whether the patch about facades was a troll or not, but it gave me a debug idea.
It turns out the segfault only happens when trying to preload one of these classes:
- \Illuminate\Log\LogManager
(https://github.com/laravel/framework/blob/5.8/src/Illuminate/Log/LogManager.php)
- \Illuminate\Http\Testing\File
(https://github.com/laravel/framework/blob/5.8/src/Illuminate/Http/Testing/File.php)
- \Illuminate\Http\UploadedFile
(https://github.com/laravel/framework/blob/5.8/src/Illuminate/Http/UploadedFile.php)
- \Illuminate\Support\Carbon
(https://github.com/laravel/framework/blob/5.8/src/Illuminate/Support/Carbon.php)
I've also updated my example project: https://github.com/brendt/laravel-preload/commit/fa8e8b253ebd771f99c41554ed44b80197a23ba7
------------------------------------------------------------------------
[2019-07-02 11:57:16] facades at laravel dot com
The following patch has been added/updated:
Patch Name: did_you_try_adding_facades_prefix
Revision: 1562068636
URL: https://bugs.php.net/patch-display.php?bug=78225&patch=did_you_try_adding_facades_prefix&revision=1562068636
------------------------------------------------------------------------
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=78225
--
Edit this bug report at https://bugs.php.net/bug.php?id=78225&edit=1