asprintf() issue
Joseph Myers
joseph@codesourcery.com
Wed May 20 16:24:00 GMT 2015
On Wed, 20 May 2015, Dmitry V. Levin wrote:
> Some distributions, Owl and ALT Linux included, are patching glibc since
> 2001 to make asprintf set *ptr to NULL on error. It's quite a period of
> time to stumble upon a piece of code that relies upon current mainline
> glibc behaviour of not changing *ptr on error, and we haven't heard of
> such issues. It is extremely unlikely that such code ever existed.
> That is, I don't see any risk of breaking user code by correcting asprintf
> behaviour without introduction of a compat symbol.
The point of my option (b) (compat symbol points to same function as new
version) was that if we don't think the change would break any user code,
a new symbol version might still be desirable to ensure that newly linked
code, written (or configure-tested) for the new guarantee of setting *ptr
to NULL, does not run with older glibc binaries. Though there are
probably many more cases when we haven't added new symbol versions in such
circumstances (new glibc extends an interface to add more features than
old glibc, so the new symbol can work with old binaries but some new
binaries won't work with old glibc) than where we have added new versions.
(I think such a hypothetical new version would apply to five symbols -
__asprintf __asprintf_chk __vasprintf_chk asprintf vasprintf. At least,
those are the asprintf symbols currently exported from shared libc.)
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list