public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: Alejandro Colomar <une+c@alejandro-colomar.es>
To: Florian Weimer <fweimer@redhat.com>
Cc: David Svoboda <svoboda@cert.org>,
	Robert Seacord <rcseacord@gmail.com>,
	 "sc22wg14@open-std. org" <sc22wg14@open-std.org>,
	Carlos O'Donell <carlos@redhat.com>,
	 Aaron Ballman <aaron@aaronballman.com>,
	"libc-alpha@sourceware.org" <libc-alpha@sourceware.org>,
	 "musl@lists.openwall.com" <musl@lists.openwall.com>,
	"linux-man@vger.kernel.org" <linux-man@vger.kernel.org>,
	 Paul Eggert <eggert@cs.ucla.edu>
Subject: Re: [SC22WG14.34664] n3752, alx-0029r8 - Restore the traditional realloc(3) specification
Date: Wed, 7 Jan 2026 21:28:30 +0100	[thread overview]
Message-ID: <aV6_UHBxHrOsL3qD@devuan> (raw)
In-Reply-To: <lhuqzs1uy7s.fsf@oldenburg.str.redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2268 bytes --]

Hi Florian, David,

On Wed, Jan 07, 2026 at 06:30:47PM +0100, Florian Weimer wrote:
> * David Svoboda:
> 
> > WRT this text:
> >
> >         Code written for platforms returning a null pointer can be
> >       migrated to platforms returning non-null, without significant
> >       issues.
> >
> > I am very skeptical that this is indeed true. But to be precise, this
> > is Glibc's problem rather than WG14's.  If they are willing to change
> > glibc to return non-null on realloc(0), then I am willing to agree to
> > this change in ISO C.

A major implementation, gnulib, has done the switch in 2024 after this
proposal.  No regressions are known.  We would have certainly noticed
if something important had happened.

> If glibc makes the change, it becomes the problem of our users (and
> developers who interpose glibc's malloc).  I'm not sure that's a helpful
> approach.

A reminder: glibc's realloc(p,0) already can return non-null
(if p==NULL before the call).  This means that correct glibc code must
be able to handle the possibility of realloc(p,0) returning a non-null
pointer.

> Someone needs to take responsibility.

What do you mean exactly by this?

> For glibc, we would have to do some analysis to figure out the impact.

I have done some theoretical analysis in the paper.

gnulib has done some experimental analysis, to the extent that it has
done the change in 2024, and we're already in 2026 and we've seen zero
regression reports so far.  This is used in GNU coreutils, which is
certainly something essential enough that if it had any important
issues, we would have noticed by now.

You could do some more, but with the resources we have, this should be
quite convincing.

> I don't think the glibc team at Red Hat will be able to work on this in
> the foreseeable future.  I don't we should make such changes upstream
> without such an analysis.
> 
> What's Microsoft's position on this entire topic?  I thought they use
> the glibc behavior, too?

Microsoft doesn't seem to have representation in the committee.  At
least, they haven't showed up to talk about this.


Cheers,
Alex

> 
> Thanks,
> Florian
> 

-- 
<https://www.alejandro-colomar.es>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-01-07 20:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20251223161139.196AB356CF9@www.open-std.org>
     [not found] ` <20251223164349.F0BC5356D1A@www.open-std.org>
     [not found]   ` <CACqWKsOkbArXm0XBUHkLcFFwDUP8iDQv_xPeNbomR0bKf-GCFw@mail.gmail.com>
     [not found]     ` <20251223211529.6365A356CF9@www.open-std.org>
     [not found]       ` <CACqWKsNQCchFZnFKKAyi-3HDtJYQ6sc=UZeb+hX48WQ1e7yj_w@mail.gmail.com>
     [not found]         ` <20260106210527.AA3FA356D3A@www.open-std.org>
     [not found]           ` <20260106214930.A5C8E356D2B@www.open-std.org>
2026-01-06 23:08             ` n3752, alx-0029r8 - Restore the traditional realloc(3) specification Alejandro Colomar
     [not found]             ` <PH1P110MB1636A1DEC402A702C28EBA9ECC84A@PH1P110MB1636.NAMP110.PROD.OUTLOOK.COM>
2026-01-07  7:51               ` [SC22WG14.34664] " Alejandro Colomar
     [not found]                 ` <PH1P110MB1636D74EDD4F3074AC98F12FCC84A@PH1P110MB1636.NAMP110.PROD.OUTLOOK.COM>
     [not found]                   ` <PH1P110MB163601133BF0167C46C8CC9DCC84A@PH1P110MB1636.NAMP110.PROD.OUTLOOK.COM>
2026-01-07 17:30                     ` Florian Weimer
2026-01-07 20:28                       ` Alejandro Colomar [this message]
2026-01-08 11:18                         ` Florian Weimer
2026-01-08 11:53                           ` [musl] " Adhemerval Zanella Netto
2026-01-07 20:36                     ` [SC22WG14.34672] " Alejandro Colomar
     [not found]                     ` <20260108023757.3C908356D01@www.open-std.org>
2026-01-08 11:08                       ` [SC22WG14.34681] " Alejandro Colomar
2026-01-07 20:16                   ` [SC22WG14.34664] " Alejandro Colomar
2026-01-07 22:01                     ` Joseph Myers
     [not found]                     ` <20260107220138.AE8DF356CFB@www.open-std.org>
2026-01-08 14:59                       ` [SC22WG14.34679] " Martin Uecker
     [not found]                         ` <PH1P110MB16361EF635C579E30308D647CC85A@PH1P110MB1636.NAMP110.PROD.OUTLOOK.COM>
2026-01-08 16:26                           ` Joseph Myers
     [not found]           ` <20260106221652.F02B3356D1A@www.open-std.org>
2026-01-06 23:15             ` [SC22WG14.34665] " Alejandro Colomar
     [not found]       ` <20260106201250.2A0A5356CEC@www.open-std.org>
     [not found]         ` <4dda2463-3adf-4fdf-a2c9-d58a2cdce415@informatik.uni-frankfurt.de>
2026-01-07 20:00           ` [SC22WG14.34662] " Alejandro Colomar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aV6_UHBxHrOsL3qD@devuan \
    --to=une+c@alejandro-colomar.es \
    --cc=aaron@aaronballman.com \
    --cc=carlos@redhat.com \
    --cc=eggert@cs.ucla.edu \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=linux-man@vger.kernel.org \
    --cc=musl@lists.openwall.com \
    --cc=rcseacord@gmail.com \
    --cc=sc22wg14@open-std.org \
    --cc=svoboda@cert.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox