Bug #78175 [Com]: Preloading segfaults at preload time and at runtime

From: Date: Wed, 24 Jul 2019 09:24:02 +0000
Subject: Bug #78175 [Com]: Preloading segfaults at preload time and at runtime
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-221918@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78175&edit=1

 ID:                 78175
 Comment by:         nicolas dot grekas+php at gmail dot com
 Reported by:        nicolas dot grekas+php at gmail dot com
 Summary:            Preloading segfaults at preload time and at runtime
 Status:             Closed
 Type:               Bug
 Package:            opcache
 PHP Version:        7.4.0alpha1
 Assigned To:        dmitry
 Block user comment: N
 Private report:     N

 New Comment:

Thanks for the fix, I have another error, not a segfault this time:
https://github.com/nicolas-grekas/symfony/releases/download/php-bugs/preload-failures-78175.tar.bz2

I run
php -S localhost:8000 -t public/
-dopcache.preload=var/cache/prod/srcApp_KernelProdContainer.preload.php

Then in another console:
php info.php

This fails with an error:
Uncaught Psr\Log\InvalidArgumentException: The log level "critical" does not exist.

Yet it exists. To debug, I added a var_dump in
vendor/symfony/http-kernel/Log/Logger.php

And it displays:
UNKNOWN:0


Previous Comments:
------------------------------------------------------------------------
[2019-07-22 09:26:04] dmitry@php.net

Commit 60dca2295d4eb87873e85bed24880a948a4049cc fixes a related crash

------------------------------------------------------------------------
[2019-07-21 19:42:25] nicolas dot grekas+php at gmail dot com

Sorry, this still segfaults for me, here is the code:
https://github.com/nicolas-grekas/symfony/releases/download/php-bugs/preload-php-bug-78175.zip

------------------------------------------------------------------------
[2019-06-24 17:38:52] dmitry@php.net

Should be fixed by https://github.com/php/php-src/commit/0f29fb5cd81d9df4829bc63f704019df910b3075

------------------------------------------------------------------------
[2019-06-21 10:30:25] dmitry@php.net

A partial fix is available at

https://github.com/php/php-src/compare/PHP-7.4...dstogov:bug78175?expand=1

It needs to be extended to support static variables of methods.

------------------------------------------------------------------------
[2019-06-20 12:30:41] nicolas dot grekas+php at gmail dot com

> Although, this is a bug, it's also an interesting unexpected side effect, that allow
> initialization and preloading of big arrays as static properties (e.g. application configuration)

While funny, that's not that interesting to keep: if one wants this, it's always possible
to generate a file with the array and load it. Preloading the default static value is what would be
the most expected, to me at least :)

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


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=78175


--
Edit this bug report at https://bugs.php.net/bug.php?id=78175&edit=1


Thread (14 messages)

« previous php.bugs (#221918) next »