This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Set behavior of sprintf-like functions with overlapping source and destination


* Joseph Myers:

> On Thu, 20 Dec 2018, Gabriel F. T. Gomes wrote:
>
>> >Traditionally we didn't worry about breaking code like PughUtils.c's 
>> >'sprintf(mess,"%s %d",mess,...)' under the principle that such code was 
>> >already broken. Why depart from that tradition here?
>> 
>> I don't know how to answer that...  I'm sort of a rookie, and I wasn't
>> here to witness past, similar changes and what was the fallout.  Maybe
>> other people have better, backed opinions about it...
>
> We have the example of x86_64 memcpy (where a GLIBC_2.14 version was added 
> to avoid breaking old *binaries* expecting it to have memmove semantics, 
> but in that case breaking *sources* expecting overlapping copies to work 
> was considered fine).

The fallout from that was largely negative, though, because
memcpy@GLIBC_2.14 was the only symbol that required the GLIBC_2.14
symbol version for quite some time.

These days, I'd expect us to provide an LD_PRELOAD library instead of a
symbol version (like libBrokenLocale), or wait until something else that
requires a new symbol version for many binaries comes around.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]