php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75353 Some files always corrupted in file cache
Submitted: 2017-10-10 15:32 UTC Modified: 2017-10-11 06:34 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: mike@php.net Assigned:
Status: Open Package: opcache
PHP Version: 7.1.10 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-10-10 15:32 UTC] 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  


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-11 06:34 UTC] mike@php.net
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.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Jan 17 23:01:24 2019 UTC