You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using phpredis on a high traffic site. Recently changing to php-fpm and since we are having occasional segfaults.
From our research we suggest it is a concurrency problem due to wrong separation of persistent connection.
Here is an excerpt of a gdb stacktrace from on of the core dumps:
(gdb) bt
#0 0x000000000065c75d in _php_stream_write (stream=0x23856a0,
buf=0x2154778 "*2\r\n$3\r\nTTL\r\n$48\r\nDataCollect:15930455cf71f0fb5c8c429412949b4f6c0d\r\n", count=68)
at /build/buildd/php5-5.3.10/main/streams/streams.c:1098
#1 0x00007f37ce048292 in redis_sock_write () from /usr/lib/php5/20090626/redis.so#2 0x00007f37ce0367b0 in generic_ttl () from /usr/lib/php5/20090626/redis.so
So the problem is in stream.c. The line where the segfault happens is marked:
PHPAPIint_php_stream_set_option(php_stream*stream, intoption, intvalue, void*ptrparamTSRMLS_DC)
{
intret=PHP_STREAM_OPTION_RETURN_NOTIMPL;
if (stream->ops->set_option) { // segfault happens hereret=stream->ops->set_option(stream, option, value, ptrparamTSRMLS_CC);
}
if (ret==PHP_STREAM_OPTION_RETURN_NOTIMPL) {
switch(option) {
casePHP_STREAM_OPTION_SET_CHUNK_SIZE:
ret=stream->chunk_size;
stream->chunk_size=value;
returnret;
casePHP_STREAM_OPTION_READ_BUFFER:
/* try to match the buffer mode as best we can */if (value==PHP_STREAM_BUFFER_NONE) {
stream->flags |= PHP_STREAM_FLAG_NO_BUFFER;
} elseif (stream->flags&PHP_STREAM_FLAG_NO_BUFFER) {
stream->flags ^= PHP_STREAM_FLAG_NO_BUFFER;
}
ret=PHP_STREAM_OPTION_RETURN_OK;
break;
default:
;
}
}
returnret;
}
Of course one solution would be to deactivate persistent connections, but the performace loss is not so nice. Any ideas how to solve it?
The text was updated successfully, but these errors were encountered:
We are using phpredis on a high traffic site. Recently changing to php-fpm and since we are having occasional segfaults.
From our research we suggest it is a concurrency problem due to wrong separation of persistent connection.
Here is an excerpt of a gdb stacktrace from on of the core dumps:
So the problem is in stream.c. The line where the segfault happens is marked:
Of course one solution would be to deactivate persistent connections, but the performace loss is not so nice. Any ideas how to solve it?
The text was updated successfully, but these errors were encountered: