From owner-freebsd-ports@FreeBSD.ORG Fri Aug 27 19:34:35 2010 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 996B31065698 for ; Fri, 27 Aug 2010 19:34:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 30A2B8FC1E for ; Fri, 27 Aug 2010 19:34:34 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o7RIwcup072349 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Aug 2010 21:58:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o7RIwc5x035975; Fri, 27 Aug 2010 21:58:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o7RIwcva035974; Fri, 27 Aug 2010 21:58:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 27 Aug 2010 21:58:38 +0300 From: Kostik Belousov To: Glen Barber Message-ID: <20100827185837.GZ2396@deviant.kiev.zoral.com.ua> References: <4C77DB15.5010501@gmail.com> <20100827163310.GD67795@home.opsec.eu> <4C77EBF8.9020405@gmail.com> <20100827165423.GA32102@icarus.home.lan> <4C77F0A9.6030807@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sUEwCCp6oxC9Oap7" Content-Disposition: inline In-Reply-To: <4C77F0A9.6030807@gmail.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: ports@freebsd.org, Kurt Jaeger , Jeremy Chadwick Subject: Re: security/clamav: Segmentation fault when running clamav in a 32-bit jail on a 64-bit host X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2010 19:34:35 -0000 --sUEwCCp6oxC9Oap7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 27, 2010 at 01:06:49PM -0400, Glen Barber wrote: > On 8/27/10 12:54 PM, Jeremy Chadwick wrote: > > On Fri, Aug 27, 2010 at 12:46:48PM -0400, Glen Barber wrote: > >> On 8/27/10 12:33 PM, Kurt Jaeger wrote: > >>> Hi! > >>> > >>>> I have a few clamav instances running in jails on 32-bit hosts witho= ut > >>>> any issues. A few days ago one of these jails was migrated to a 64-= bit > >>>> host (8.1-RELEASE), where I noticed clamd (0.96.2_1) segfaults when = queried. > >>>> > >>>> The issue seems specific to 32bit/64bit compatibility. I have a gdb > >>>> session available here: http://gist.github.com/549964 > >>>> > >>>> Any thoughts on if this is possible? > >>> > >>> Try > >>> > >>> Bytecode no > >>> > >>> in clamd.conf ? > >>> > >> > >> It was set to 'yes' initially. I thought it was disabled with building > >> without JIT. At any rate, no, it still segfaults with the same backtr= ace. > >=20 > > 1) Is clamd built with debugging symbols enabled? If not, you might wa= nt > > to rebuild it with such, else it might be difficult to debug the > > problem. > >=20 >=20 > It wasn't initially, but is now. >=20 > > Also, if the segfault happens after performing the above, can you > > provide output from "bt full" instead of just "bt"? > >=20 >=20 > Of course. The new backtrace is here: http://gist.github.com/553734 I suspect that this was fixed in r210796/HEAD and r211138/RELENG_8. >=20 > > 2) Was the software rebuilt from source after the upgrade from i386 to > > amd64, or are you expecting the software to work without any hitches > > running on amd64 with lib32 (32-bit compatibility libaries)? The latter > > is not always possible/the case. > >=20 >=20 > clamav was rebuilt from ports. I previously went as far as downgrading > to the previous version, to rule out something between 0.96.1 and > 0.96.2; same results there. Was clamav rebuilt in the 32-bit jail ? At least your backtrace shows 32-bit image being executed. >=20 > > I have no familiarity with the software or functions in question, but an > > initial guess would be that some piece of the code is making assumptions > > about the size of pointers (expecting 4 (32-bit) rather than 8 > > (64-bit)). Speculative on my part, but I ponder such when seeing code > > like somefunc(sizeof(int)). Absolute nonsense. --sUEwCCp6oxC9Oap7 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkx4Ct0ACgkQC3+MBN1Mb4hjMQCg936UkpSiEJ1wOF2jMmeCojN0 SxUAoM+/oeBs7wwOSSYNgiGUADXPOjtq =4w1R -----END PGP SIGNATURE----- --sUEwCCp6oxC9Oap7--