Bug #78092 [NEW]: Opcache shared lockfile and fcntl()
| From: | stefan dot djordjevic at humanity dot com | Date: | Fri, 31 May 2019 12:11:15 +0000 |
| Subject: | Bug #78092 [NEW]: Opcache shared lockfile and fcntl() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-221058@lists.php.net to get a copy of this message | ||
From: stefan dot djordjevic at humanity dot com
Operating system: Centos 7.6
PHP version: Irrelevant
Package: opcache
Bug Type: Bug
Bug description: Opcache shared lockfile and fcntl()
Description:
------------
Hi,
We got some strange behaviour which seems related to shared lockfile
stored on a default path (/tmp/.ZendSem.04tkPY)
Randomly our Apache server with forked workers enter in some strange
"loop", which slows them down and brings our load and number of apache
workers to max.
I mange to strace them and what I see is:
cntl(10, F_SETLKW, {l_type=F_WRLCK, l_whence=SEEK_SET, l_start=0,
l_len=1}) = 0
fcntl(10, F_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=0,
l_len=1}) = 0
fcntl(10, F_SETLKW, {l_type=F_WRLCK, l_whence=SEEK_SET, l_start=0,
l_len=1}) = 0
fcntl(10, F_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=0,
l_len=1}) = 0
fcntl(10, F_SETLKW, {l_type=F_WRLCK, l_whence=SEEK_SET, l_start=0,
l_len=1}) = 0
fcntl(10, F_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=0,
l_len=1}) = 0
fcntl(10, F_SETLKW, {l_type=F_WRLCK, l_whence=SEEK_SET, l_start=0,
l_len=1}) = 0
fcntl(10, F_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET, l_start=0,
l_len=1}) = 0
.
.
At one point in time it just passed this "condition" and execute, finish
request.
File Descriptor is actually pointing to opcode lock files:
ls -l /proc/30174/fd/10
lrwx------ 1 root root 64 May 30 13:35 /proc/30174/fd/10 ->
/tmp/.ZendSem.04tkPY (deleted)
As this condition happens pretty randomly, it's hard to identify real
cause of this, but from what I see is that it entering some kind of
loop, or race condition with locking - unlocking pattern.
I am trying to figure out how we get to this condition, as there are
many "variables" included in our new setup (docker containers etc.) I am
wondering if you guys have any clue if this can be triggered by some
kind of bug in Zend opcode cache-ing mechanism or similar ?
Thanks.
--
Edit bug report at https://bugs.php.net/bug.php?id=78092&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=78092&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=78092&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=78092&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=78092&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78092&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78092&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78092&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78092&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78092&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78092&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78092&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78092&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78092&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78092&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=78092&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78092&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78092&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78092&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78092&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78092&r=mysqlcfg