PHP 7.2: SIGSEGV in OpenSSL

Marcel Bonnet marcelbonnet at gmail.com
Thu Apr 25 20:08:05 UTC 2019


On Wed, 24 Apr 2019 at 18:03, Stefan Bethke <stb at lassitu.de> wrote:

> Am 24.04.2019 um 22:50 schrieb Mathieu Arnold <mat at FreeBSD.org>:
>
> On Wed, Apr 24, 2019 at 06:34:06PM +0200, Stefan Bethke wrote:
>
> Am 23.04.2019 um 18:01 schrieb Kurt Jaeger <pi at freebsd.org>:
>
> Hi!
>
> Did you find a solution? Please let me know.
>
>
> There's a well-known problem in the sequence in which php modules
> are loaded. I don't know if this is the case here as well,
> but that's what we do:
>
> fetch -o fixphpextorder \
>       https://people.freebsd.org/~ohauer/scripts/fixphpextorder.sh
> chmod 755 fixphpextorder
>
> cd /usr/local/etc/php
> cat ext-*ini > extensions.ini
> fixphpextorder
> mv extensions.ini.new extensions.ini
> rm ext-*ini
>
> Please test and report if it fixes the problem.
>
>
> Thanks Kurt, it appears to fix (or at least work around) the problem.
>
> Why is the default load order broken? Why does it not affect everyone?
>
> I moved all the individual inis into a bak subdir, and now only have an
> extensions.ini.
>
> If I understand correctly, mod_php/PHP reads the individual inis in order.
> Why aren’t they in the right order? Can this be fixed in the ports for the
> PHP modules?
>
>
> Could you give the order that works for you, so that we can try to
> figure out which module is making it break ?
>
> Because there is no "right" order, there is an order that can work for
> most people, and from time to time, two libs have conflicting symbols,
> but it is not possible to detect that.  So I made up an order that
> should be ok, but some time is not.
>
>
> This is the order I’m actively using now:
> $ cat extensions.ini
> extension=session.so
> extension=fileinfo.so
> extension=ldap.so
> extension=simplexml.so
> extension=ctype.so
> extension=mbstring.so
> extension=tokenizer.so
> extension=filter.so
> extension=pgsql.so
> extension=mcrypt.so
> extension=gd.so
> extension=gettext.so
> extension=iconv.so
> extension=zlib.so
> extension=curl.so
> extension=xmlrpc.so
> extension=bz2.so
> extension=openssl.so
> extension=dom.so
> extension=hash.so
> extension=wddx.so
> extension=memcache.so
> extension=soap.so
> extension=pdo.so
> extension=pdo_mysql.so
> extension=mysqli.so
> extension=sockets.so
> extension=xml.so
> ; additional extension(s) not known by fixphpextorder.sh
> extension=intl.so
> extension=json.so
> extension=sqlite3.so
> extension=zip.so
> extension=memcached.so
> extension=pdo_pgsql.so
> extension=phar.so
>
> This is the order as installed by the ports (at least I think that’s the
> order PHP will read the files):
> $ cat $(echo bak/*.ini|sort)
> zend_extension=opcache.so
> extension=session.so
> extension=bz2.so
> extension=ctype.so
> extension=curl.so
> extension=dom.so
> extension=fileinfo.so
> extension=filter.so
> extension=gd.so
> extension=gettext.so
> extension=hash.so
> extension=iconv.so
> extension=intl.so
> extension=json.so
> extension=ldap.so
> extension=mbstring.so
> extension=mcrypt.so
> extension=mysqli.so
> extension=openssl.so
> extension=pdo.so
> extension=pgsql.so
> extension=simplexml.so
> extension=soap.so
> extension=sockets.so
> extension=sqlite3.so
> extension=tokenizer.so
> extension=xml.so
> extension=zip.so
> extension=zlib.so
> extension=memcache.so
> extension=memcached.so
> extension=pdo_mysql.so
> extension=pdo_pgsql.so
> extension=phar.so
> extension=wddx.so
> extension=xmlrpc.so
>
> This is the contents of bak (the former contents of /usr/local/etc/php):
> $ ls bak
> ext-10-opcache.ini ext-20-intl.ini ext-20-sqlite3.ini
> ext-18-session.ini ext-20-json.ini ext-20-tokenizer.ini
> ext-20-bz2.ini ext-20-ldap.ini ext-20-xml.ini
> ext-20-ctype.ini ext-20-mbstring.ini ext-20-zip.ini
> ext-20-curl.ini ext-20-mcrypt.ini ext-20-zlib.ini
> ext-20-dom.ini ext-20-mysqli.ini ext-30-memcache.ini
> ext-20-fileinfo.ini ext-20-openssl.ini ext-30-memcached.ini
> ext-20-filter.ini ext-20-pdo.ini ext-30-pdo_mysql.ini
> ext-20-gd.ini ext-20-pgsql.ini ext-30-pdo_pgsql.ini
> ext-20-gettext.ini ext-20-simplexml.ini ext-30-phar.ini
> ext-20-hash.ini ext-20-soap.ini ext-30-wddx.ini
> ext-20-iconv.ini ext-20-sockets.ini ext-30-xmlrpc.ini
>
>
> These are the PHP packages I have installed, minus the web apps:
> $ pkg info -r php72
> php72-7.2.17_2:
> php72-xml-7.2.17_2
> php72-hash-7.2.17_2
> php72-session-7.2.17_2
> php72-openssl-7.2.17_2
> php72-xmlrpc-7.2.17_2
> php72-mysqli-7.2.17_2
> php72-mbstring-7.2.17_2
> php72-phar-7.2.17_2
> php72-ctype-7.2.17_2
> php72-tokenizer-7.2.17_2
> php72-json-7.2.17_2
> php72-filter-7.2.17_2
> php72-gd-7.2.17_2
> php72-zlib-7.2.17_2
> php72-zip-7.2.17_2
> php72-bz2-7.2.17_2
> php72-iconv-7.2.17_2
> php72-fileinfo-7.2.17_2
> php72-pgsql-7.2.17_2
> php72-opcache-7.2.17_2
> php72-wddx-7.2.17_2
> php72-simplexml-7.2.17_2
> php72-dom-7.2.17_2
> php72-pecl-mcrypt-1.0.2
> php72-soap-7.2.17_2
> php72-ldap-7.2.17_2
> php72-curl-7.2.17_2
> php72-sqlite3-7.2.17_2
> php72-pdo-7.2.17_2
> php72-memcache-4.0.3
> php72-pecl-memcached-3.1.3
> php72-sockets-7.2.17_2
> php72-intl-7.2.17_2
> php72-gettext-7.2.17_2
> php72-pdo_pgsql-7.2.17_2
> php72-pdo_mysql-7.2.17_2
>
>
>
> --
> Stefan Bethke <stb at lassitu.de>   Fon +49 151 14070811
>
> Thank you so much, fellows!

These are the extensions currently installed:
[@machine php #]  pkg info -iqox php73
lang/php73
devel/php-composer
textproc/php73-ctype
ftp/php73-curl
security/php73-filter
security/php73-hash
devel/php73-intl
devel/php73-json
converters/php73-mbstring
www/php73-opcache
security/php73-openssl
archivers/php73-phar

The fixphpextorder script did not work. So, I tried to change the order of
any extension that seemed to require openssl . Reading the coredump, I
supposed some lib was not finding openssl into the stack.
So I put curl.so below openssl.so , and now it works.

[@machine php #]  cat extensions.ini
extension=ctype.so
extension=mbstring.so
extension=filter.so
extension=openssl.so
extension=curl.so
extension=hash.so
; additional extension(s) not known by fixphpextorder.sh
extension=intl.so
extension=json.so
extension=phar.so

Cheers,

-- 
Marcel Bonnet


More information about the freebsd-ports mailing list