public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
To: "Martin Liška" <mliska@suse.cz>
Cc: Florian Weimer <fweimer@redhat.com>,
	libc-alpha@sourceware.org, Andreas Schwab <schwab@linux-m68k.org>
Subject: Re: [PATCH] Use size_t for mallinfo fields.
Date: Thu, 23 Jul 2020 15:38:36 +0100	[thread overview]
Message-ID: <20200723143835.GJ7127@arm.com> (raw)
In-Reply-To: <093814cf-0b7d-1011-08e7-4d5c3e56b423@suse.cz>

The 07/08/2020 09:24, Martin Liška wrote:
> Subject: [PATCH] Add mallinfo2 function that support sizes >= 4GB.
> 
> The current int type can easily overflow for allocation of more
> than 4GB.

i don't think a new symbol with a similar bad
design as the old one is desirable.

(i think a good design would allow exposing malloc
internal info without abi and api issues when the
internals change, e.g. no struct field names and
struct layout that are tied to internals. and
supportable by other implementations so whatever
gcc is doing would work elsewhere not just on glibc)

one hack that may be acceptable is to use some
nonsensical value in a mallinfo field to signal that
the fields have new meaning, then the api can work
backward compatibly when all field values are less
than 2G and after that things are broken anyway so
we can switch to some different struct content that
has no overflow issue, but abi compatible with the
old struct (e.g. round up the values to multiples of
1M), so we don't need a new abi symbol and interposers
continue to work. (but i'm not entirely sure this
is a good idea either)

  parent reply	other threads:[~2020-07-23 14:38 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-07 12:00 Martin Liška
2020-07-07 12:17 ` Andreas Schwab
2020-07-07 13:07   ` Martin Liška
2020-07-07 13:19     ` H.J. Lu
2020-07-07 13:49     ` Florian Weimer
2020-07-07 13:52       ` Martin Liška
2020-07-07 14:22         ` Florian Weimer
2020-07-07 14:32           ` Andreas Schwab
2020-07-07 14:36             ` Florian Weimer
2020-07-08  7:25               ` Martin Liška
2020-07-08  7:24           ` Martin Liška
2020-07-23 10:23             ` Martin Liška
2020-07-23 14:38             ` Szabolcs Nagy [this message]
2020-07-27 12:08               ` Martin Liška
2020-07-27 12:21                 ` Florian Weimer
2020-07-27 12:45                   ` Martin Liška
2020-08-11 12:26                     ` Martin Liška
2020-08-11 13:44                     ` Florian Weimer
2020-08-11 17:08                       ` DJ Delorie
2020-08-12 12:29                         ` Martin Liška
2020-08-24  9:55                           ` Martin Liška
2020-08-28 19:05                             ` DJ Delorie
2020-08-31 13:35                               ` H.J. Lu
2020-08-31 13:56                                 ` Adhemerval Zanella
2020-08-31 14:00                                   ` H.J. Lu
2020-08-31 14:10                                     ` Adhemerval Zanella
2020-09-01 17:26                               ` Joseph Myers
2020-09-02 13:19                                 ` Martin Liška
2020-09-02 13:34                                   ` Adhemerval Zanella
2020-09-02 14:00                                   ` Carlos O'Donell
2020-09-02 16:11                                   ` DJ Delorie
2020-09-21  8:49                                     ` Martin Liška
2020-09-02 20:16                                 ` DJ Delorie
2020-09-02 20:24                                   ` Florian Weimer
2020-09-02 21:04                                     ` [PATCH/v2] " DJ Delorie
2020-09-03 11:17                                       ` Adhemerval Zanella
2020-09-03 21:33                                         ` DJ Delorie
2020-09-17 23:02                                         ` DJ Delorie
2020-09-02 20:25                                   ` [PATCH] " Joseph Myers

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=20200723143835.GJ7127@arm.com \
    --to=szabolcs.nagy@arm.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=mliska@suse.cz \
    --cc=schwab@linux-m68k.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).