svn commit: r304011 - head/libexec/rtld-elf

Bryan Drewery bdrewery at FreeBSD.org
Tue Aug 16 15:35:23 UTC 2016


On 8/16/16 4:32 PM, Ravi Pokala wrote:
> -----Original Message-----
> From: <owner-src-committers at freebsd.org> on behalf of Bryan Drewery <bdrewery at FreeBSD.org>
> Organization: FreeBSD
> Date: 2016-08-16, Tuesday at 03:30
> To: Ngie Cooper <yaneurabeya at gmail.com>, Konstantin Belousov <kib at FreeBSD.org>
> Cc: <src-committers at freebsd.org>, <svn-src-all at freebsd.org>, <svn-src-head at freebsd.org>
> Subject: Re: svn commit: r304011 - head/libexec/rtld-elf
> 
>> 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.
> 
> I'll grant you "error-prone", but why do you consider it "dangerous"? It's inefficient to walk the whole list when passing NULL as the starting pointer, but I'm not sure what the danger is.
> 

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_FOREACH_FROM APIs entirely? It looks like rtld-elf was the last (in-tree) user:
> 

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
> 
> I confirmed that queue.h just defines the (S)TAILQ_FOREACH_FROM(_SAFE) macros, but doesn't use them internally to define anything else.
> 
> -Ravi (rpokala@)
> 
>> -- 
>> Regards,
>> Bryan Drewery 
> 
> 
> 


-- 
Regards,
Bryan Drewery

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 496 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20160816/50f567be/attachment.sig>


More information about the svn-src-all mailing list