php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75344 Drupal 8 vanilla SIGBUS with disabled opcache
Submitted: 2017-10-09 08:55 UTC Modified: 2018-02-23 14:25 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: chingis at wodby dot com Assigned: nikic (profile)
Status: Closed Package: opcache
PHP Version: 7.1.10 OS: Alpine 3.6
Private report: No CVE-ID: None
 [2017-10-09 08:55 UTC] chingis at wodby dot com
Description:
------------
Vanilla Drupal 8 on php-fpm (page /admin/people/permissions) with disabled opcache gives me SIGBUS segfault, the same thing happened with php 7.1.9.

gdb backtrace:

Core was generated by `php-fpm:'.
Program terminated with signal SIGBUS, Bus error.
#0  0x0000555dcdfcb2ad in zend_mm_free_heap (heap=0x7fa504e00040, ptr=0x7fa4f85c51d8, __zend_filename=0x555dce66a280 "/usr/src/php/Zend/zend_string.h", __zend_lineno=272,
    __zend_orig_filename=0x0, __zend_orig_lineno=0) at /usr/src/php/Zend/zend_alloc.c:1372
1372	/usr/src/php/Zend/zend_alloc.c: No such file or directory.
(gdb) bt
#0  0x0000555dcdfcb2ad in zend_mm_free_heap (heap=0x7fa504e00040, ptr=0x7fa4f85c51d8, __zend_filename=0x555dce66a280 "/usr/src/php/Zend/zend_string.h", __zend_lineno=272,
    __zend_orig_filename=0x0, __zend_orig_lineno=0) at /usr/src/php/Zend/zend_alloc.c:1372
#1  0x0000555dcdfcdbea in _efree (ptr=0x7fa4f85c51d8, __zend_filename=0x555dce66a280 "/usr/src/php/Zend/zend_string.h", __zend_lineno=272, __zend_orig_filename=0x0,
    __zend_orig_lineno=0) at /usr/src/php/Zend/zend_alloc.c:2433
#2  0x0000555dce0188ce in zend_string_release (s=0x7fa4f85c51d8) at /usr/src/php/Zend/zend_string.h:272
#3  0x0000555dce01cd0a in zend_array_destroy (ht=0x7fa4f6db39c0) at /usr/src/php/Zend/zend_hash.c:1311
#4  0x0000555dce002fd9 in _zval_dtor_func (p=0x7fa4f6db39c0, __zend_filename=0x555dce66a357 "/usr/src/php/Zend/zend_hash.c", __zend_lineno=1309)
    at /usr/src/php/Zend/zend_variables.c:43
#5  0x0000555dce018d00 in i_zval_ptr_dtor (zval_ptr=0x7fa4f6da35e0, __zend_filename=0x555dce66a357 "/usr/src/php/Zend/zend_hash.c", __zend_lineno=1309)
    at /usr/src/php/Zend/zend_variables.h:48
#6  0x0000555dce01cce4 in zend_array_destroy (ht=0x7fa4f6db3a80) at /usr/src/php/Zend/zend_hash.c:1309
#7  0x0000555dce002fd9 in _zval_dtor_func (p=0x7fa4f6db3a80, __zend_filename=0x555dce66a357 "/usr/src/php/Zend/zend_hash.c", __zend_lineno=1305)
    at /usr/src/php/Zend/zend_variables.c:43
#8  0x0000555dce018d00 in i_zval_ptr_dtor (zval_ptr=0x7fa4f6da3760, __zend_filename=0x555dce66a357 "/usr/src/php/Zend/zend_hash.c", __zend_lineno=1305)
    at /usr/src/php/Zend/zend_variables.h:48
#9  0x0000555dce01cca6 in zend_array_destroy (ht=0x7fa4f6db3b40) at /usr/src/php/Zend/zend_hash.c:1305
#10 0x0000555dce002fd9 in _zval_dtor_func (p=0x7fa4f6db3b40, __zend_filename=0x555dce66a357 "/usr/src/php/Zend/zend_hash.c", __zend_lineno=1309)
    at /usr/src/php/Zend/zend_variables.c:43
#11 0x0000555dce018d00 in i_zval_ptr_dtor (zval_ptr=0x7fa4f6dbba80, __zend_filename=0x555dce66a357 "/usr/src/php/Zend/zend_hash.c", __zend_lineno=1309)
    at /usr/src/php/Zend/zend_variables.h:48
#12 0x0000555dce01cce4 in zend_array_destroy (ht=0x7fa4f736c2a0) at /usr/src/php/Zend/zend_hash.c:1309
#13 0x0000555dce002fd9 in _zval_dtor_func (p=0x7fa4f736c2a0, __zend_filename=0x555dce667088 "/usr/src/php/Zend/zend_opcode.c", __zend_lineno=165)
    at /usr/src/php/Zend/zend_variables.c:43
#14 0x0000555dcdff0b91 in i_zval_ptr_dtor (zval_ptr=0x7fa4f734b570, __zend_filename=0x555dce667088 "/usr/src/php/Zend/zend_opcode.c", __zend_lineno=165)
    at /usr/src/php/Zend/zend_variables.h:48
#15 0x0000555dcdff111a in zend_cleanup_user_class_data (ce=0x7fa4f73284a8) at /usr/src/php/Zend/zend_opcode.c:165
#16 0x0000555dcdfeb48f in shutdown_executor () at /usr/src/php/Zend/zend_execute_API.c:338
#17 0x0000555dce005737 in zend_deactivate () at /usr/src/php/Zend/zend.c:1003
#18 0x0000555dcdf6b1fb in php_request_shutdown (dummy=0x0) at /usr/src/php/main/main.c:1877
#19 0x0000555dce101038 in main (argc=1, argv=0x7ffe19b34718) at /usr/src/php/sapi/fpm/fpm/fpm_main.c:1994

====================

php -i output:

phpinfo()
PHP Version => 7.1.10

System => Linux php-2912993767-xrg4h 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64
Build Date => Oct  9 2017 07:31:32
Configure Command =>  './configure'  '--build=x86_64-linux-musl' '--with-config-file-path=/usr/local/etc/php' '--with-config-file-scan-dir=/usr/local/etc/php/conf.d' '--disable-cgi' '--enable-ftp' '--enable-mbstring' '--enable-mysqlnd' '--with-curl' '--with-libedit' '--with-openssl' '--with-zlib' '--with-pcre-regex=/usr' '--enable-fpm' '--with-fpm-user=www-data' '--with-fpm-group=www-data' '--enable-debug' 'build_alias=x86_64-linux-musl'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /usr/local/etc/php
Loaded Configuration File => /usr/local/etc/php/php.ini
Scan this dir for additional .ini files => /usr/local/etc/php/conf.d
Additional .ini files parsed => /usr/local/etc/php/conf.d/docker-php-ext-amqp.ini,
/usr/local/etc/php/conf.d/docker-php-ext-apcu.ini,
/usr/local/etc/php/conf.d/docker-php-ext-ast.ini,
/usr/local/etc/php/conf.d/docker-php-ext-bcmath.ini,
/usr/local/etc/php/conf.d/docker-php-ext-bz2.ini,
/usr/local/etc/php/conf.d/docker-php-ext-calendar.ini,
/usr/local/etc/php/conf.d/docker-php-ext-exif.ini,
/usr/local/etc/php/conf.d/docker-php-ext-gd.ini,
/usr/local/etc/php/conf.d/docker-php-ext-geoip.ini,
/usr/local/etc/php/conf.d/docker-php-ext-imagick.ini,
/usr/local/etc/php/conf.d/docker-php-ext-imap.ini,
/usr/local/etc/php/conf.d/docker-php-ext-intl.ini,
/usr/local/etc/php/conf.d/docker-php-ext-ldap.ini,
/usr/local/etc/php/conf.d/docker-php-ext-mcrypt.ini,
/usr/local/etc/php/conf.d/docker-php-ext-memcached.ini,
/usr/local/etc/php/conf.d/docker-php-ext-mongodb.ini,
/usr/local/etc/php/conf.d/docker-php-ext-mysqli.ini,
/usr/local/etc/php/conf.d/docker-php-ext-oauth.ini,
/usr/local/etc/php/conf.d/docker-php-ext-opcache.ini,
/usr/local/etc/php/conf.d/docker-php-ext-pcntl.ini,
/usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini,
/usr/local/etc/php/conf.d/docker-php-ext-pdo_pgsql.ini,
/usr/local/etc/php/conf.d/docker-php-ext-pgsql.ini,
/usr/local/etc/php/conf.d/docker-php-ext-redis.ini,
/usr/local/etc/php/conf.d/docker-php-ext-soap.ini,
/usr/local/etc/php/conf.d/docker-php-ext-sockets.ini,
/usr/local/etc/php/conf.d/docker-php-ext-uploadprogress.ini,
/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini,
/usr/local/etc/php/conf.d/docker-php-ext-xmlrpc.ini,
/usr/local/etc/php/conf.d/docker-php-ext-xsl.ini,
/usr/local/etc/php/conf.d/docker-php-ext-yaml.ini,
/usr/local/etc/php/conf.d/docker-php-ext-zip.ini,
/usr/local/etc/php/conf.d/docker-php.ini

PHP API => 20160303
PHP Extension => 20160303
Zend Extension => 320160303
Zend Extension Build => API320160303,NTS,debug
PHP Extension Build => API20160303,NTS,debug
Debug Build => yes
Thread Safety => disabled
Zend Signal Handling => enabled
Zend Memory Manager => enabled
Zend Multibyte Support => provided by mbstring
IPv6 Support => enabled
DTrace Support => disabled

Registered PHP Streams => https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar, zip
Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2
Registered Stream Filters => zlib.*, convert.iconv.*, bzip2.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, mcrypt.*, mdecrypt.*

This program makes use of the Zend Scripting Language Engine:
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.10, Copyright (c) 1999-2017, by Zend Technologies

====

php -m:

[PHP Modules]
amqp
apcu
ast
bcmath
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
geoip
hash
iconv
imagick
imap
intl
json
ldap
libxml
mbstring
mcrypt
memcached
mongodb
mysqli
mysqlnd
OAuth
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
readline
redis
Reflection
session
SimpleXML
soap
sockets
SPL
sqlite3
standard
tokenizer
uploadprogress
xml
xmlreader
xmlrpc
xmlwriter
xsl
yaml
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-09 08:57 UTC] chingis at wodby dot com
opcache settings:

[opcache]
zend_extension = opcache.so
opcache.enable = 0
opcache.validate_timestamps = 1
opcache.revalidate_freq = 2
opcache.max_accelerated_files = 20000
opcache.memory_consumption = 64
opcache.interned_strings_buffer = 16
opcache.fast_shutdown = 1
 [2017-10-09 12:15 UTC] chingis at wodby dot com
The segfault goes away if I disable apcu (Drupal uses it for caching by default), Increasing apc.shm_size from 32M to 512M doesn't help.
 [2017-10-10 04:46 UTC] chingis at wodby dot com
I resolved the problem by removing the line apc.serializer = "default", phpinfo now shows it as "php". The value "default" I took from http://php.net/manual/en/apc.configuration.php. Perhaps worth updating.
 [2018-02-23 14:25 UTC] nikic@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2018-02-23 14:25 UTC] nikic@php.net
The issues with the "default" serializer should be fixed as part of https://github.com/krakjoe/apcu/issues/248 in APCu 5.1.10.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Dec 02 08:03:36 2021 UTC