From owner-svn-src-all@freebsd.org Tue Aug 16 15:35:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA81CBBBA88; Tue, 16 Aug 2016 15:35:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 99F8818BC; Tue, 16 Aug 2016 15:35:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 8D9911D7A; Tue, 16 Aug 2016 15:35:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 3EF011AC16; Tue, 16 Aug 2016 15:35:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id ou0fLNojrF5N; Tue, 16 Aug 2016 15:35:19 +0000 (UTC) Subject: Re: svn commit: r304011 - head/libexec/rtld-elf DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 55B8E1AC0C To: Ravi Pokala References: <201608121829.u7CITCIu059447@repo.freebsd.org> <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> <457F4AE9-A909-44C9-A38B-CD8C28E3068F@panasas.com> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Tue, 16 Aug 2016 16:35:16 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <457F4AE9-A909-44C9-A38B-CD8C28E3068F@panasas.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="EN5vBwOgnMHS8Hfm0mdDPF5U8AjCk0TPt" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Aug 2016 15:35:23 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EN5vBwOgnMHS8Hfm0mdDPF5U8AjCk0TPt Content-Type: multipart/mixed; boundary="5Ccw6cSeC65aD447LNviEajGxCPnrV1gH" From: Bryan Drewery To: Ravi Pokala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r304011 - head/libexec/rtld-elf References: <201608121829.u7CITCIu059447@repo.freebsd.org> <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> <457F4AE9-A909-44C9-A38B-CD8C28E3068F@panasas.com> In-Reply-To: <457F4AE9-A909-44C9-A38B-CD8C28E3068F@panasas.com> --5Ccw6cSeC65aD447LNviEajGxCPnrV1gH Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/16/16 4:32 PM, Ravi Pokala wrote: > -----Original Message----- > From: on behalf of Bryan Drewery > Organization: FreeBSD > Date: 2016-08-16, Tuesday at 03:30 > To: Ngie Cooper , Konstantin Belousov > Cc: , , > Subject: Re: svn commit: r304011 - head/libexec/rtld-elf >=20 >> On 8/12/16 7:34 PM, Ngie Cooper wrote: >>> >>> ... >>> >>>> Log: >>>> Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf. >>> >>> Why? >>> >> >> It's a somewhat error-prone and dangerous macro. See r302908. >=20 > I'll grant you "error-prone", but why do you consider it "dangerous"? I= t's inefficient to walk the whole list when passing NULL as the starting = pointer, but I'm not sure what the danger is. >=20 I don't mean "dangerous" here as in security, but as in "doing the right thing" or "doing what is expected", which it did not as seen in r302908. Granted, the original commit for _FROM noted this problem, but it is very much not obvious. > And, if it really *is* dangerous, perhaps we should purge the TAILQ_FOR= EACH_FROM APIs entirely? It looks like rtld-elf was the last (in-tree) us= er: >=20 I'm not a fan of having it with this behavior, but I understand why it was designed like this. > [freebsd/base/head] rpokala% grep -rl TAILQ_FOREACH_FROM . > ./share/man/man3/Makefile > ./share/man/man3/queue.3 > ./sys/sys/queue.h >=20 > I confirmed that queue.h just defines the (S)TAILQ_FOREACH_FROM(_SAFE) = macros, but doesn't use them internally to define anything else. >=20 > -Ravi (rpokala@) >=20 >> --=20 >> Regards, >> Bryan Drewery=20 >=20 >=20 >=20 --=20 Regards, Bryan Drewery --5Ccw6cSeC65aD447LNviEajGxCPnrV1gH-- --EN5vBwOgnMHS8Hfm0mdDPF5U8AjCk0TPt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXszK0AAoJEDXXcbtuRpfPOeAH/0KMfBjmKxdRGDTm0IjZAkcc 7uvBZ3o4EqFnS85Pjzgqq9uOcB8p745fMAGj/pacwWKUlPwTBRSr7uPrXMYe9tEU DeG/xLQ2F9mIclqFbS0PGR9gQDVChhR4tlpbNzC863zWnUF6XM8oOOhw1fRNP9Zo F6ludxdCBsVLvvq6Ofhg0tM/HCeay/hBSjh+rRb3WPG/5IvBPNPuh8e7fDaWa5tY ur2BjYzLuEh2wHy/NJgyRn9QMxclDa0xgFJzycmf0Z3W5mEHvZTN1Yl2P2gIZLjh pexwhwlqg+R1IZP1YwjjsMq70yLM3CUtbEaubh73wzXRhopEd1K/gs8eglCJ01Q= =qTZe -----END PGP SIGNATURE----- --EN5vBwOgnMHS8Hfm0mdDPF5U8AjCk0TPt--