503 Example: Opcode Cache Crashes PHP
User B complained of 503 errors while using a collaboration application. We used strace to find that PHP was crashing:
18:06:05.816339 stat("/xxxxx/xxxx/x/xxxx.class.php", {st_mode=S_IFREG|0666, st_size=54285, ...}) = 0 <0.000024> 18:06:05.817292 brk(0x16e6000) = 0x16e6000 <0.000026> 18:06:05.817790 --- SIGSEGV (Segmentation fault) @ 0 (0) ---
Using GNU Debugger to examine the stack backtrace, we found:
Program received signal SIGSEGV, Segmentation fault. 0x000000000061c91b in ?? () (gdb) bt #0 0x000000000061c91b in ?? () #1 0x0000000000641ac3 in zend_stack_push () #2 0x000000000060bbf9 in ?? () #3 0x0000000000611515 in lex_scan () #4 0x000000000061fb60 in ?? () #5 0x0000000000608223 in ?? () #6 0x0000000000614965 in compile_file () #7 0x00007fd3c99eda21 in ?? () from /opt/alt/php55/usr/lib64/php/modules/phar.so #8 0x00007fd3d0993359 in ?? () from /opt/alt/php55/usr/lib64/php/modules/opcache.so #9 0x00007fd3d0994187 in ?? () from /opt/alt/php55/usr/lib64/php/modules/opcache.so #10 0x00000000006b54da in ?? () #11 0x00000000006b68e8 in execute_ex () #12 0x000000000064239c in zend_execute_scripts () #13 0x00000000005e2fb0 in php_execute_script () #14 0x00000000006f29ff in ?? () #15 0x00000000006f2c5c in ?? () #16 0x00000000006f2f85 in ?? () #17 0x00007fd3d37cdd1d in __libc_start_main () from /lib64/libc.so.6 #18 0x0000000000424bc9 in _start ()
This shows us the problem is in the opcode cache. We do not know whether the user upgraded the opcode cache, tried a different version of PHP, or disabled the opcode cache, but the issue seems to have been resolved.