Bug #77649 [Opn->Wfx]: preload: Can't preload class %s with unresolved initializer for constant

From: Date: Fri, 13 Dec 2019 10:13:43 +0000
Subject: Bug #77649 [Opn->Wfx]: preload: Can't preload class %s with unresolved initializer for constant
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-224261@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77649&edit=1

 ID:                 77649
 Updated by:         nikic@php.net
 Reported by:        mberchtold at gmail dot com
 Summary:            preload: Can't preload class %s with unresolved
                     initializer for constant
-Status:             Open
+Status:             Wont fix
 Type:               Bug
 Package:            opcache
 Operating System:   Windows 10 x64
 PHP Version:        master-Git-2019-02-21 (snap)
 Block user comment: N
 Private report:     N

 New Comment:

Per previous comment, this is a Windows ASLR issue, which I don't believe we can avoid. We may
instead disable preloading on Windows entirely, see https://github.com/php/php-src/pull/4999.


Previous Comments:
------------------------------------------------------------------------
[2019-02-22 16:25:54] nikic@php.net

Sorry, accidental assignment.

------------------------------------------------------------------------
[2019-02-22 16:21:58] nikic@php.net

Ah wait, I see it now. There's another warning on Windows:

Warning: Can't preload unlinked class Zend\Db\Sql\Join at
D:\htdocs\zend-db-master\src\Sql\Join.php:25 in Unknown on line 0

And this is the class declaration: https://github.com/zendframework/zend-db/blob/master/src/Sql/Join.php#L25

I guess that we don't support linking of internal classes on Windows due to ASLR issues.

------------------------------------------------------------------------
[2019-02-22 16:15:51] nikic@php.net

So, good news is that I can indeed reproduce this on Windows. However, I can't debug it there,
and it doesn't repro on Ubuntu. Not immediately obvious to me why this would be OS dependent
either.

------------------------------------------------------------------------
[2019-02-22 15:55:44] mberchtold at gmail dot com

Let me help you with this:

1. Use PHP on Windows 10 64-bit
2. Download the latest snap (today) from here: https://windows.php.net/downloads/snaps/master/r7cf177c/php-master-nts-windows-vc15-x64-avx-r7cf177c.zip
3. Create a file called preload.php and use the code from the script in this bug report.
4. Download zend-db from here: https://codeload.github.com/zendframework/zend-db/zip/master
and extract the zip
5. Change the $basedirectory in the preload.php pointing to correct location of the zend-db in 4.
6. change php ini values:
opcache.enable_cli=1
opcache.preload=preload.php
7. run php.exe

------------------------------------------------------------------------
[2019-02-22 08:25:16] nikic@php.net

I'm not able to reproduce this.

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


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


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


Thread (7 messages)

« previous php.bugs (#224261) next »