From owner-freebsd-stable@FreeBSD.ORG Sun Feb 9 18:38:00 2014 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13F6B179; Sun, 9 Feb 2014 18:38:00 +0000 (UTC) Received: from tensor.andric.com (unknown [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A8B1F1AF4; Sun, 9 Feb 2014 18:37:59 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::20a4:db0:4ac7:1cb7] (unknown [IPv6:2001:7b8:3a7:0:20a4:db0:4ac7:1cb7]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 3EE155C45; Sun, 9 Feb 2014 19:37:54 +0100 (CET) Subject: Re: Squid aufs crashes under 10.0 Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Content-Type: multipart/signed; boundary="Apple-Mail=_E87A879D-D177-4169-A07F-9199A7700C54"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.1 (6062eb4) From: Dimitry Andric In-Reply-To: Date: Sun, 9 Feb 2014 19:37:34 +0100 Message-Id: <92705E1C-E06E-411D-B88C-5A1AA096E2BD@FreeBSD.org> References: To: Pavel Timofeev X-Mailer: Apple Mail (2.1827) Cc: freebsd-stable stable , ports-list freebsd X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Feb 2014 18:38:00 -0000 --Apple-Mail=_E87A879D-D177-4169-A07F-9199A7700C54 Content-Type: multipart/mixed; boundary="Apple-Mail=_DDD4A3DE-3493-4A20-94EF-80FE31FB5ED1" --Apple-Mail=_DDD4A3DE-3493-4A20-94EF-80FE31FB5ED1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 07 Feb 2014, at 14:24, Pavel Timofeev wrote: > Sorry, it has to be in freebsd-ports@ too. >=20 > 2014-02-07 Pavel Timofeev : >> Hi! >> There is a problem with squid under FreeBSD10.0. >> Squid crashes immediately if storage type is set to aufs. >> It goes down during read of config file. >>=20 >> No problem with diskd. No problem with aufs under FreeBSD9.2. >>=20 >> Someone thinks that it's related to clang which is default compiler = on >> FreeBSD 10.0. Nope, it is a bug in Squid's configure script. It recognizes FreeBSD 10.x and later as FreeBSD 1.x, causing it to disable pthreads support. This leads to the required DiskThreads module being disabled too. It then crashes when it tries to access a NULL pointer returned by DiskIOModule::Find("DiskThreads"), in src/fs/ufs/UFSSwapDir.cc: Fs::Ufs::UFSSwapDir::UFSSwapDir(char const *aType, const char *anIOType) = : SwapDir(aType), IO(NULL), map(new FileMap()), suggest(0), swaplog_fd = (-1), currentIOOptions(new ConfigOptionVector()), = ioType(xstrdup(anIOType)), cur_size(0), n_disk_objects(0) { /* modulename is only set to disk modules that are built, by = configure, * so the Find call should never return NULL here. */ IO =3D new = Fs::Ufs::UFSStrategy(DiskIOModule::Find(anIOType)->createStrategy()); } Very bad coding practice, obviously. It should call Find() first, and if that returns NULL, it should abort in some sort of controlled way. In any case, the cause is the following fragment in the configure script: freebsd) if test `echo "$squid_host_os_version" | cut -b1` -lt 7 ; = then { $as_echo "$as_me:${as_lineno-$LINENO}: pthread library = requires FreeBSD 7 or later" >&5 $as_echo "$as_me: pthread library requires FreeBSD 7 or later" >&6;} squid_opt_use_diskthreads=3D"no" else which was edited here: http://bazaar.launchpad.net/~squid/squid/3-trunk/revision/11124 I have attached a tentative patch for the port. However, this causes the configure script logic to run a little differently, and there is some sort of very strange bug in it, that leads to the SQUID_CFLAGS and SQUID_CXXFLAGS values being mangled in the default case. With my patch the DiskThreads detection runs again, but the variables are not mangled anymore, and this leads to -Werror being enabled again, causing errors about deprecated kerberos5 functions later on in the build. For now, I would not bother with -Werror and Squid, but just add --disable-strict-error-checking to CONFIGURE_ARGS in the Makefile. That is, until somebody with autoconf knowledge can fix the badly broken configure script... >> I recompiled www/squid33 with DEBUG option. Got coredump. >> Then I did and got this: >> gdb /usr/local/sbin/squid /var/squid/squid.core >> .... >> Reading symbols from /usr/lib/private/libheimipcc.so.11...done. >> Loaded symbols for /usr/lib/private/libheimipcc.so.11 >> Reading symbols from /libexec/ld-elf.so.1...done. >> Loaded symbols for /libexec/ld-elf.so.1 >> Segmentation fault (core dumped) >>=20 >> Gdb goes down too =3D) >> Any ideas? Yes, please don't use gdb in base for anything serious. Use ports gdb instead. :-) -Dimitry --Apple-Mail=_DDD4A3DE-3493-4A20-94EF-80FE31FB5ED1 Content-Disposition: attachment; filename=www__squid33-fix-pthreads-detection-1.diff Content-Type: application/octet-stream; name="www__squid33-fix-pthreads-detection-1.diff" Content-Transfer-Encoding: 7bit Index: www/squid33/files/patch-configure =================================================================== --- www/squid33/files/patch-configure (revision 341653) +++ www/squid33/files/patch-configure (working copy) @@ -1,5 +1,14 @@ --- configure.orig 2013-03-12 11:18:22.000000000 +0100 +++ configure 2013-04-09 11:43:01.000000000 +0200 +@@ -19343,7 +19343,7 @@ + $as_echo "$as_me: Windows threads support automatically enabled" >&6;} + ;; + freebsd) +- if test `echo "$squid_host_os_version" | cut -b1` -lt 7 ; then ++ if test `echo "$squid_host_os_version" | cut -d. -f1` -lt 7 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: pthread library requires FreeBSD 7 or later" >&5 + $as_echo "$as_me: pthread library requires FreeBSD 7 or later" >&6;} + squid_opt_use_diskthreads="no" @@ -22798,7 +22798,7 @@ done --Apple-Mail=_DDD4A3DE-3493-4A20-94EF-80FE31FB5ED1 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii --Apple-Mail=_DDD4A3DE-3493-4A20-94EF-80FE31FB5ED1-- --Apple-Mail=_E87A879D-D177-4169-A07F-9199A7700C54 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlL3yvcACgkQsF6jCi4glqPApgCfSA6cbPdPF1BVRxfMW8goxd/O txAAoOelds0kVWuI/m3EAiukcfOUrLHu =Voe2 -----END PGP SIGNATURE----- --Apple-Mail=_E87A879D-D177-4169-A07F-9199A7700C54--