Bug 1381958 - segfaults in sasl_done
Summary: segfaults in sasl_done
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: cyrus-sasl
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-05 12:32 UTC by Remi Collet
Modified: 2018-05-29 11:39 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-05-29 11:39:06 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Remi Collet 2016-10-05 12:32:59 UTC
Reproduced with different version (from 2.1.23-15.el6_6.2 to 2.1.26-25.2.fc23)

In PHP when a module uses sasl, it have to call sasl_done in its module shutdown process. That's OK.

But when multiple module use sasl, they all call sasl_done, and this raise a segfault.

Ex: 
#0  0x00007f6487507ad0 in ?? ()
#1  0x000000303ee08fab in client_done () at client.c:109
#2  0x000000303ee0b329 in sasl_done () at common.c:653
#3  0x00007f648797cc00 in zm_shutdown_mongo (type=<value optimized out>, module_number=<value optimized out>)
    at /usr/src/debug/php-pecl-mongo-1.6.14/NTS/php_mongo.c:399
#4  0x00000000005eed55 in module_destructor (module=0x1875630) at /usr/src/debug/php-5.6.26/Zend/zend_API.c:2415
#5  0x00000000005f606a in i_zend_hash_bucket_delete (ht=0x9f0020, p=0x18755d0) at /usr/src/debug/php-5.6.26/Zend/zend_hash.c:182
#6  zend_hash_bucket_delete (ht=0x9f0020, p=0x18755d0) at /usr/src/debug/php-5.6.26/Zend/zend_hash.c:192
#7  0x00000000005f6328 in zend_hash_graceful_reverse_destroy (ht=0x9f0020) at /usr/src/debug/php-5.6.26/Zend/zend_hash.c:613
#8  0x00000000005e9282 in zend_shutdown () at /usr/src/debug/php-5.6.26/Zend/zend.c:836
#9  0x0000000000585e4a in php_module_shutdown () at /usr/src/debug/php-5.6.26/main/main.c:2477
#10 0x000000000068ff35 in main (argc=2, argv=0x1788e20) at /usr/src/debug/php-5.6.26/sapi/cli/php_cli.c:1393


Affected modules (identified for now)

- php-pecl-mongo
- php-pecl-mongodb
- php-smbclient (not using directly sasl, but via libsmbclient)

Upstream bug reports:

- https://jira.mongodb.org/browse/PHPC-658
- https://github.com/eduardok/libsmbclient-php/issues/39

Any help on this issue will be very welcome.

Comment 1 Remi Collet 2016-10-05 13:44:44 UTC
Sorry, in fact I only reproduce with 2.1.23 on RHEL-6

Comment 2 Jakub Jelen 2016-10-05 14:59:48 UTC
How exactly can we reproduce your segfault in RHEL6?

lib/client.c:
 109   sasl_MUTEX_FREE(cmechlist->mutex);

It looks like double free() or similar stuff. Is possible that the calling library forks/threads and calls sasl_done() in both versions?

Comment 3 Remi Collet 2016-10-05 16:58:05 UTC
For now, there is not enough packages in RHEL + EPEL to reproduce (will search more later), for now I can reproduce with PHP packages from my repository (remi-safe + remi-php56) [1]

php
php-bcmath
php-cli
php-common
php-gd
php-gmp
php-horde-horde-lz4
php-imap
php-intl
php-ldap
php-mbstring
php-mcrypt
php-mysqlnd
php-pdo
php-pecl-apfd
php-pecl-geoip
php-pecl-http
php-pecl-jsonc
php-pecl-json-post
php-pecl-lzf
php-pecl-memcache
php-pecl-mongo
php-pecl-mongodb
php-pecl-oauth
php-pecl-propro
php-pecl-raphf
php-pecl-ssh2
php-pecl-zip
php-process
php-smbclient
php-tidy
php-twig
php-xml


A simple "php --version" trigger the segfault



[1] https://rpms.remirepo.net/

Comment 4 Fedora End Of Life 2017-02-28 10:24:55 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 5 Fedora End Of Life 2018-05-03 08:26:20 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 6 Fedora End Of Life 2018-05-29 11:39:06 UTC
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26
is no longer maintained, which means that it will not receive any
further security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.