Topic: php-pecl-mongo(db) segfaults

On my CentOS 6 server, x86_64, I had php-pecl-mongo-1.6.14-1.el6.remi.5.6 installed, and then a couple of days ago, something, I guess maybe the php-horde-Horde-mongo-1.0.3-3.el6.remi.noarch update, required php-pecl-mongodb-1.1.7-2.el6.remi.5.6.x86_64 to be installed, and suddenly I started seeing these messages repeatedly in my /var/log/messages:

kernel: php[XXXXX]: segfault at XXXXXXXXXXXX ip 00007XXXXXXXXXXX sp 00007ffXXXXXXXXX error 14 in mongo.so[7fXXXXXXX000+5d000]

where the 'X's are apparently arbitrary digits (first is a process number, I suppose, the rest maybe memory locations?), [s]and the curly braces should be square brackets but your BBCode won't let me[/s] (and is giving me fits trying to figure out what it's counting as links even after cleaning that up).

Found that php-pecl-mongo owns both /usr/lib64/php/modules/mongo.so and /usr/lib64/php-zts/modules/mongo.so, so I removed it, and haven't seen those messages since. But php-pecl-mongo wasn't updated at the time things started going haywire, php-pecl-mongodb was installed, and some others updated as well. If it helps, here's the full list from that time:

(This seems to be what's triggering as links for phpBB, so I'll try to reproduce it in a follow-up.)

The first segfault:

Jun 29 06:47:36 rs4 kernel: php[5204]: segfault at 7f834b92bad0 ip 00007f834b92bad0 sp 00007fff9c879838 error 14 in mongo.so[7f834bd8a000+5d000]

…one second after the php-*mongo* installs.

FWIW, I never saw any negative effects outside of the logs, but I didn't open up every bit of the system myself, either. I could compare to the httpd logs and see what was being requested at the moments of segfaults (I'd assume something was).

Re: php-pecl-mongo(db) segfaults

OK, it seems fine in a reply.

Jun 29 06:47:33 Installed: libbson-1.3.5-1.el6.remi.x86_64
Jun 29 06:47:33 Installed: mongo-c-driver-libs-1.3.5-1.el6.remi.x86_64
Jun 29 06:47:33 Installed: mongo-c-driver-1.3.5-1.el6.remi.x86_64
Jun 29 06:47:35 Installed: php-pecl-mongodb-1.1.7-2.el6.remi.5.6.x86_64
Jun 29 06:47:35 Installed: php-mongodb-1.0.2-1.el6.remi.noarch
Jun 29 06:47:35 Installed: php-alcaeus-mongo-php-adapter-1.0.3-1.el6.remi.noarch
Jun 29 06:47:36 Updated: php-horde-Horde-Mongo-1.0.3-3.el6.remi.noarch
Jun 29 06:47:38 Updated: php-horde-Horde-Db-2.3.1-2.el6.remi.noarch
Jun 29 06:47:38 Updated: mock-1.2.18-1.el6.noarch
Jun 29 06:47:41 Updated: wordpress-4.5.3-2.el6.remi.noarch
Jun 29 06:47:42 Updated: php-pear-Cache-Lite-1.7.16-5.el6.remi.noarch
Jun 29 06:47:43 Updated: php-horde-Horde-Kolab-Format-2.0.8-2.el6.remi.noarch
Jun 29 06:47:46 Updated: youtube-dl-2016.06.03-1.el6.noarch
Jun 29 06:51:05 Updated: owncloud-httpd-8.2.5-3.el6.gp.noarch
Jun 29 06:51:53 Updated: owncloud-8.2.5-3.el6.gp.noarch
Jun 29 06:51:53 Updated: owncloud-mysql-8.2.5-3.el6.gp.noarch

(The *.el6.gp.* packages are from my own repository; I'm not ready for owncloud-9.0.2 yet.)

3 (edited by KarMann 2016-07-03 03:21:06)

Re: php-pecl-mongo(db) segfaults

I went ahead with the httpd log checking, and given the complete lack of any correlating entries, and the regular timing of some of the events, I'm pretty sure my owncloud's cron job is what's triggering the segfaults. Maybe I'll bump owncloud-9.0.2 up on my priority list. Or it could be something wrong with whichever-mongo(db) that's only exposed by my own owncloud build.

Re: php-pecl-mongo(db) segfaults

Try to update and then remove php-pecl-mongodb (I have drop the dependency from horde_mongo 1.0.3-4)

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 26 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.9 x86_64 + EPEL + remi + remi-php70

Re: php-pecl-mongo(db) segfaults

Ah, I see, you mean update the php-horde-Horde-* stuff, and then remove php-pecl-mongodb. It took php-alcaeus-mongo-php-adapter & php-mongodb with it, but it seems to no longer segfault on the quarter hour, and frankly, I don't even know what those packages do, so I don't suppose I'll miss them much. Good enough for me. Thanks, Remi!

Re: php-pecl-mongo(db) segfaults

I need a simple way to allow both installation:

Horde_Mongo + mongo + PHP 5
Horde_Mongo + mongodb (driver) + php-alcaeus-mongo-php-adapter (emulate mongo ext) + php-mongodb (library) + PHP 5 or 7

Having both raising segfault need to be reported upstream, it should work.

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 26 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.9 x86_64 + EPEL + remi + remi-php70

Re: php-pecl-mongo(db) segfaults

php5.6

install both php-pecl-mongo and php-pecl-mongodb raise Segmenation fault

reproduce:

yum install php php-cli php-pecl-mongodb php-pecl-mongo

php -v

PHP 5.6.30 (cli) (built: Jan 19 2017 08:09:42)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
Segmentation fault

php -m
[PHP Modules]
bz2
calendar
Core
ctype
curl
date
ereg
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
mhash
mongo
mongodb
openssl
pcntl
pcre
Phar
readline
Reflection
session
sockets
SPL
standard
tokenizer
zip
zlib

[Zend Modules]

Segmentation fault

php.x86_64                        5.6.30-1.el6.remi         
php-cli.x86_64                    5.6.30-1.el6.remi         
php-common.x86_64                 5.6.30-1.el6.remi         
php-pecl-jsonc.x86_64             1.3.10-2.el6.remi.5.6     
php-pecl-mongo.x86_64             1.6.14-1.el6.remi.5.6     
php-pecl-mongodb.x86_64           1.2.5-1.el6.remi.5.6       
php-pecl-zip.x86_64               1.13.5-1.el6.remi.5.6

Re: php-pecl-mongo(db) segfaults

Already reported upstream.
So you have to keep only one.

This is not a issue in mongo or mongodb extension but in cyrus-sasl old version in EL-6 (Works fine with more recent version available in Fedora or EL-7)

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 26 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.9 x86_64 + EPEL + remi + remi-php70

Re: php-pecl-mongo(db) segfaults

$ rpm -q cyrus-sals 
cyrus-sasl-2.1.26-26.2.fc24.x86_64
$ php56 -m | grep mongo
mongo
mongodb

No segfault.

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 26 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.9 x86_64 + EPEL + remi + remi-php70

Re: php-pecl-mongo(db) segfaults

See https://bugzilla.redhat.com/show_bug.cgi?id=1381958

Desktop: Fedora 25 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 26 x86_64 + remi (SCL only)
Hosting Server: CentOS 6.9 x86_64 + EPEL + remi + remi-php70