From owner-freebsd-ports@freebsd.org Thu Apr 25 20:08:05 2019 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CFBD15A12AB for ; Thu, 25 Apr 2019 20:08:05 +0000 (UTC) (envelope-from marcelbonnet@gmail.com) Received: from mail-ot1-x343.google.com (mail-ot1-x343.google.com [IPv6:2607:f8b0:4864:20::343]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A74568322; Thu, 25 Apr 2019 20:08:04 +0000 (UTC) (envelope-from marcelbonnet@gmail.com) Received: by mail-ot1-x343.google.com with SMTP id d24so627630otl.11; Thu, 25 Apr 2019 13:08:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/LRuYJZJF6bmVs0/BDGtkvCpZMrdMDfes6hHJVvSaDI=; b=EokD85tJJUL0pOZkWRrkGoX/EfsLqIkSAfkdRC+FQrPmeKXjePs0FhE2IlmCx04PcN iyo0jTimizQU+NXxe3YrgdSvUR5Qu6J8Ok6UB0En3fkBHbIllzkWxhYIfj01LvLIf0NM KH4fldONXoopSCra/JHevbyh0NKVcndOejJcOSaYi4cv2noh8C/KJp9ZL3VVryCIQE4G 69SGUMhl5TUWqLvJ3cJxIvVb9W1Gu3leTkdvMKkFq5v4mzi3Yz+9Ah2BIrWgXmgAnn5i q84Yu4fgVDeVAvp6Gp85f1GhPFtuc922fWsguWTnZYQ/2KQdXutFkv/X6lGA+z5pM6n2 uadw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/LRuYJZJF6bmVs0/BDGtkvCpZMrdMDfes6hHJVvSaDI=; b=A3mzlxH3U1VPxTxrSX0FXhAv+hpciYEDJC4mctQd4bhUnwTuve9byKol2qd+PU3Rt6 SVC56TGCXcbnLr0q1qZiHSb7Wmh58dmVNoNxwj+BY+f7iZSUR8tErw7BcnZH0SaqQhQx B1UTecZ/vyWwNRiAcPP9OWDyM/5pXFLtvk/OHW/rWsxbCQgzcbYPp6uC1F+abModTYoP 0+sECPzHwIPJ8qlbbSfak+i1OoJnr7UYMghPitou3/covWPsunBoz/SBS3XWO2j2XUhs oZTGgbmpVizuh/45BobzmYCtnPmgxQpnmwqHTdFELbZuX6LbNwCW1bGqxmh2b8frASO2 JNPw== X-Gm-Message-State: APjAAAXiajCP9dBjOmF7j/szI2Tr4yroct4YadM3SyMF8wg9ABFH42/c CdRZ/FCxBIyn/eVBSB4QSUaCWPM8POCAzu6/Z1Y= X-Google-Smtp-Source: APXvYqwt7/Gt+s1LanTrKPUIboNSgM1JVosB6s5hLoybFo1r/UiqHskY3YziuhYFK1TD6q3ID/owNk4uzDoLlcBGoMM= X-Received: by 2002:a9d:480b:: with SMTP id c11mr1743129otf.61.1556222882863; Thu, 25 Apr 2019 13:08:02 -0700 (PDT) MIME-Version: 1.0 References: <67841009-B4BC-4F0A-BB53-77487EE19CBD@lassitu.de> <20190423160110.GS72200@home.opsec.eu> <0D187548-4221-4DA5-9A22-8478D9FB32F3@lassitu.de> <20190424205044.ll3rsu3hhfwxrxof@atuin.in.mat.cc> <0AEC703C-5ACE-44BD-A9D3-70ABBA8785EB@lassitu.de> In-Reply-To: <0AEC703C-5ACE-44BD-A9D3-70ABBA8785EB@lassitu.de> From: Marcel Bonnet Date: Thu, 25 Apr 2019 17:07:26 -0300 Message-ID: Subject: Re: PHP 7.2: SIGSEGV in OpenSSL To: Stefan Bethke Cc: Mathieu Arnold , Kurt Jaeger , FreeBSD Ports X-Rspamd-Queue-Id: 0A74568322 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=EokD85tJ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of marcelbonnet@gmail.com designates 2607:f8b0:4864:20::343 as permitted sender) smtp.mailfrom=marcelbonnet@gmail.com X-Spamd-Result: default: False [-3.02 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.991,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; URI_COUNT_ODD(1.00)[7]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[3.4.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; IP_SCORE(-0.81)[ip: (1.39), ipnet: 2607:f8b0::/32(-3.15), asn: 15169(-2.25), country: US(-0.06)]; NEURAL_HAM_SHORT(-0.20)[-0.203,0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2019 20:08:05 -0000 On Wed, 24 Apr 2019 at 18:03, Stefan Bethke wrote: > Am 24.04.2019 um 22:50 schrieb Mathieu Arnold : > > On Wed, Apr 24, 2019 at 06:34:06PM +0200, Stefan Bethke wrote: > > Am 23.04.2019 um 18:01 schrieb Kurt Jaeger : > > 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=E2=80=99t they in the right order? Can this be fixed in the port= s 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=E2=80=99m actively using now: > $ cat extensions.ini > extension=3Dsession.so > extension=3Dfileinfo.so > extension=3Dldap.so > extension=3Dsimplexml.so > extension=3Dctype.so > extension=3Dmbstring.so > extension=3Dtokenizer.so > extension=3Dfilter.so > extension=3Dpgsql.so > extension=3Dmcrypt.so > extension=3Dgd.so > extension=3Dgettext.so > extension=3Diconv.so > extension=3Dzlib.so > extension=3Dcurl.so > extension=3Dxmlrpc.so > extension=3Dbz2.so > extension=3Dopenssl.so > extension=3Ddom.so > extension=3Dhash.so > extension=3Dwddx.so > extension=3Dmemcache.so > extension=3Dsoap.so > extension=3Dpdo.so > extension=3Dpdo_mysql.so > extension=3Dmysqli.so > extension=3Dsockets.so > extension=3Dxml.so > ; additional extension(s) not known by fixphpextorder.sh > extension=3Dintl.so > extension=3Djson.so > extension=3Dsqlite3.so > extension=3Dzip.so > extension=3Dmemcached.so > extension=3Dpdo_pgsql.so > extension=3Dphar.so > > This is the order as installed by the ports (at least I think that=E2=80= =99s the > order PHP will read the files): > $ cat $(echo bak/*.ini|sort) > zend_extension=3Dopcache.so > extension=3Dsession.so > extension=3Dbz2.so > extension=3Dctype.so > extension=3Dcurl.so > extension=3Ddom.so > extension=3Dfileinfo.so > extension=3Dfilter.so > extension=3Dgd.so > extension=3Dgettext.so > extension=3Dhash.so > extension=3Diconv.so > extension=3Dintl.so > extension=3Djson.so > extension=3Dldap.so > extension=3Dmbstring.so > extension=3Dmcrypt.so > extension=3Dmysqli.so > extension=3Dopenssl.so > extension=3Dpdo.so > extension=3Dpgsql.so > extension=3Dsimplexml.so > extension=3Dsoap.so > extension=3Dsockets.so > extension=3Dsqlite3.so > extension=3Dtokenizer.so > extension=3Dxml.so > extension=3Dzip.so > extension=3Dzlib.so > extension=3Dmemcache.so > extension=3Dmemcached.so > extension=3Dpdo_mysql.so > extension=3Dpdo_pgsql.so > extension=3Dphar.so > extension=3Dwddx.so > extension=3Dxmlrpc.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 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=3Dctype.so extension=3Dmbstring.so extension=3Dfilter.so extension=3Dopenssl.so extension=3Dcurl.so extension=3Dhash.so ; additional extension(s) not known by fixphpextorder.sh extension=3Dintl.so extension=3Djson.so extension=3Dphar.so Cheers, --=20 Marcel Bonnet