php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78329 Autoloading broken with 7.4.0beta1
Submitted: 2019-07-24 07:20 UTC Modified: 2019-07-25 05:25 UTC
From: remi@php.net Assigned:
Status: Not a bug Package: opcache
PHP Version: 7.4.0alpha3 OS: GNU/Linux
Private report: No CVE-ID: None
 [2019-07-24 07:20 UTC] remi@php.net
Description:
------------
From php-fpm error-log

[24-Jul-2019 07:08:52 UTC] PHP Fatal error:  Uncaught Error: Call to undefined method Fedora\Autoloader\Autoload::addPsr4() in /usr/share/php/Fedora/Autoloader/autoload.php:18
Stack trace:
#0 /usr/share/glpi/vendor/autoload.php(4): require_once()
#1 /usr/share/glpi/inc/autoload.function.php(346): require_once('/usr/share/glpi...')
#2 /usr/share/glpi/inc/based_config.php(45): include_once('/usr/share/glpi...')
#3 /usr/share/glpi/index.php(44): include('/usr/share/glpi...')
#4 {main}
  thrown in /usr/share/php/Fedora/Autoloader/autoload.php on line 18

While this file includes needed stuff.

See
https://github.com/php-fedora/autoloader

Here is the file which doesn't work
https://github.com/php-fedora/autoloader/blob/master/src/autoload.php


Issue only there when opcache is enabled.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-07-24 10:27 UTC] nikic@php.net
-Status: Open +Status: Feedback
 [2019-07-24 10:27 UTC] nikic@php.net
Is there a way to reproduce this? Just running the autoload.php file under opcache works fine.
 [2019-07-24 11:05 UTC] remi@php.net
-Status: Feedback +Status: Open
 [2019-07-24 11:05 UTC] remi@php.net
Using command line server

<?php
echo "Debug....";
require_once "/usr/share/php/Fedora/Autoloader/autoload.php";
echo "done\n";

$ php74 -dopcache.enable_cli=1  -S localhost:8000

And

$ wget -q http://localhost:8000/repro.php -O -
Debug....done
$ wget -q http://localhost:8000/repro.php -O -
(no output)

From serveur output

[Wed Jul 24 13:03:06 2019] PHP 7.4.0beta1 Development Server (http://localhost:8000) started
[Wed Jul 24 13:03:13 2019] 127.0.0.1:38800 Accepted
[Wed Jul 24 13:03:13 2019] 127.0.0.1:38800 [200]: GET /repro.php
[Wed Jul 24 13:03:13 2019] 127.0.0.1:38800 Closing
[Wed Jul 24 13:03:14 2019] 127.0.0.1:38802 Accepted
[Wed Jul 24 13:03:14 2019] PHP Fatal error:  Uncaught Error: Call to undefined method Fedora\Autoloader\Autoload::addPsr4() in /usr/share/php/Fedora/Autoloader/autoload.php:18
Stack trace:
#0 /var/www/html/repro.php(4): require_once()
#1 {main}
  thrown in /usr/share/php/Fedora/Autoloader/autoload.php on line 18
 [2019-07-24 11:09 UTC] nikic@php.net
I still can't reproduce this, at least with 7.4 HEAD. All requests are successful, and I double checked that opcache is working with opcache_get_status().
 [2019-07-24 11:42 UTC] remi@php.net
Strange.....
With PHP-7.4 HEAD I got a segfault...

(gdb) bt
#0  0x00007ffff767da17 in __strlen_avx2 () from /lib64/libc.so.6
#1  0x00007ffff6f37889 in persistent_compile_file (type=8, file_handle=0x7fffffffbca0) at /work/build/php74/ext/opcache/ZendAccelerator.c:1917
#2  persistent_compile_file (file_handle=0x7fffffffbca0, type=8) at /work/build/php74/ext/opcache/ZendAccelerator.c:1876
#3  0x000000000089788d in zend_execute_scripts (type=type@entry=8, retval=retval@entry=0x0, file_count=file_count@entry=3) at /tmp/php-7.4.0beta1/Zend/zend.c:1657
#4  0x000000000083b5c0 in php_execute_script (primary_file=primary_file@entry=0x7fffffffbca0) at /tmp/php-7.4.0beta1/main/main.c:2606
#5  0x00000000009222ba in php_cli_server_dispatch_script (server=server@entry=0x141aea0 <server>, client=client@entry=0x1443d60)
    at /tmp/php-7.4.0beta1/sapi/cli/php_cli_server.c:2077
#6  0x00000000009228ac in php_cli_server_dispatch (client=0x1443d60, server=0x141aea0 <server>) at /tmp/php-7.4.0beta1/sapi/cli/php_cli_server.c:2248
#7  php_cli_server_recv_event_read_request (server=0x141aea0 <server>, client=0x1443d60) at /tmp/php-7.4.0beta1/sapi/cli/php_cli_server.c:2492
#8  0x0000000000922bf0 in php_cli_server_do_event_for_each_fd_callback (_params=_params@entry=0x7fffffffbf20, fd=fd@entry=5, event=event@entry=1)
    at /tmp/php-7.4.0beta1/sapi/cli/php_cli_server.c:2578
#9  0x00000000009236f6 in php_cli_server_poller_iter_on_active (poller=0x141aea8 <server+8>, callback=0x922bb0 <php_cli_server_do_event_for_each_fd_callback>, 
    opaque=0x7fffffffbf20) at /tmp/php-7.4.0beta1/sapi/cli/php_cli_server.c:919
#10 php_cli_server_do_event_for_each_fd (whandler=0x921480 <php_cli_server_send_event>, rhandler=0x9222c0 <php_cli_server_recv_event_read_request>, server=0x141aea0 <server>)
    at /tmp/php-7.4.0beta1/sapi/cli/php_cli_server.c:2596
#11 php_cli_server_do_event_loop (server=0x141aea0 <server>) at /tmp/php-7.4.0beta1/sapi/cli/php_cli_server.c:2606
#12 do_cli_server (argc=argc@entry=11, argv=argv@entry=0x14264d0) at /tmp/php-7.4.0beta1/sapi/cli/php_cli_server.c:2734
#13 0x000000000063bc0d in main (argc=11, argv=0x14264d0) at /tmp/php-7.4.0beta1/sapi/cli/php_cli.c:1355
(gdb) quit


Could this be related to build options (RPM default ones) ?

 CFLAGS="${CFLAGS:--O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection}" ; export CFLAGS ; 

 LDFLAGS="${LDFLAGS:--Wl,-z,relro   -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld}" ; export LDFLAGS;
 [2019-07-25 05:25 UTC] remi@php.net
-Status: Open +Status: Not a bug
 [2019-07-25 05:25 UTC] remi@php.net
Looks like I have some memory corruption issue.
Today, everything seems ok...
Very strange
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Aug 14 21:01:24 2020 UTC