Bug #75353 [Opn]: Some files always corrupted in file cache

From: Date: Tue, 06 Apr 2021 14:49:21 +0000
Subject: Bug #75353 [Opn]: Some files always corrupted in file cache
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233226@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75353&edit=1

 ID:                 75353
 Updated by:         cmb@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:

I have seen that error several times, but almost certainly not on
a regular basis, and that issue may have been resolved in the
meantime.  There is a relevant comment regarding uninitialized
regions[1] in the sources.

[1] <https://github.com/php/php-src/blob/php-7.4.16/ext/opcache/zend_file_cache.c#L944-L946>


Previous Comments:
------------------------------------------------------------------------
[2017-10-11 06:34:48] 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.

------------------------------------------------------------------------
[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)

« previous php.bugs (#233226) next »