Bug #75353 [Opn]: Some files always corrupted in file cache
Edit report at https://bugs.php.net/bug.php?id=75353&edit=1
ID: 75353
Updated by: mike@php.net
Reported by: mike@php.net
Summary: Some files always corrupted in file cache
Status: Open
Type: Bug
Package: opcache
Operating System: Linux
PHP Version: 7.1.10
Block user comment: N
Private report: N
New Comment:
Valgrind says info.checksum points to uninitialized bytes when writev()'d in
zend_file_cache_script_store(), but it is set a couple lines above.
Previous Comments:
------------------------------------------------------------------------
[2017-10-10 15:32:24] mike@php.net
Description:
------------
Some files will always end up corrupted in file cache, e.g. Laravel's Support/Str.php
Test script:
---------------
Shell session:
# install laravel
git clone https://github.com/laravel/laravel.git
cd laravel
composer install
# minimal env config
APP_KEY=$(pwgen 32 1)
LARAVEL_TMP=$(mktemp -d)
# prime opcache
php -d opcache.file_cache=$LARAVEL_TMP \
-d opcache.error_log=stderr \
-d opcache.log_verbosity_level=2 \
-S localhost:9999 server.php &
FCGI_PID=$!
sleep 1
for i in "" {1..5}; do curl -sSL localhost:9999/$i >/dev/null; done
kill $FCGI_PID
# now start over
php -d opcache.file_cache=$LARAVEL_TMP \
-d opcache.error_log=stderr \
-d opcache.log_verbosity_level=4 \
-S localhost:9999 server.php \
2> >(sed -re 's/(^.*Added key).*/\1/' | uniq -c) &
FCGI_PID=$!
sleep 1
for i in "" {1..5}; do curl -sSL localhost:9999/$i >/dev/null; done
kill $FCGI_PID
Actual result:
--------------
[1] 14149
PHP 7.1.10RC1 Development Server started at Tue Oct 10 17:21:00 2017
Listening on http://localhost:9999
Document root is /home/mike/src/laravel.git
Press Ctrl-C to quit.
1 Tue Oct 10 17:21:01 2017 (14149): Warning corrupted file
'/tmp/.../Illuminate/Support/Str.php.bin'
1
1 Tue Oct 10 17:21:01 2017 (14149): Message Cached script
'/home/.../Illuminate/Support/Str.php'
201 Tue Oct 10 17:21:01 2017 (14149): Message Added key
[1] + 14149 terminated ~/src/php-719-opcache/usr/bin/php -d opcache.file_cache=$LARAVEL_TMP -d -d
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75353&edit=1
Thread (3 messages)