From: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>
To: Siddhesh Poyarekar <siddhesh@gotplt.org>
Cc: Stefan Liebler <stli@linux.ibm.com>,
GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH v3 02/10] Add mcheck tests to malloc
Date: Thu, 8 Jul 2021 16:37:10 -0700 [thread overview]
Message-ID: <CAMe9rOp-RPDsJy3qd-zSEz9MirrL0aMY7pMd_cL7qrA0UJ1Q3A@mail.gmail.com> (raw)
In-Reply-To: <0270d99b-3a15-09d2-7fa9-c9ecf2591d8f@gotplt.org>
On Tue, Jul 6, 2021 at 8:54 AM Siddhesh Poyarekar <siddhesh@gotplt.org> wrote:
>
> On 7/6/21 8:20 PM, Stefan Liebler via Libc-alpha wrote:
> > Hi Siddhesh,
> >
> > starting with this commit, malloc/tst-realloc-mcheck fails if build with
> > gcc 7.5 on s390x:
> > Error: realloc (NULL, 0) returned NULL.
> >
> > With gcc 7.5:
> > p = realloc (NULL, 0);
> > realloc is really called, which is using reallochook, which always
> > returns NULL:
> > static void *
> > reallochook (void *ptr, size_t size, const void *caller)
> > {
> > if (size == 0)
> > {
> > freehook (ptr, caller);
> > return NULL;
> > }
> >
> > With e.g. gcc 9.1:
> > malloc(0) is called, which is using mallochook. It is using
> > hdr = (struct hdr *) malloc (sizeof (struct hdr) + size + 1);
> > ...
> > return (void *) (hdr + 1);
> > => != NULL
> >
> > Can you please have a look? And perhaps also filter out this test?
>
> Thanks, that is an mcheck bug that gcc seems to have masked. I'll push
> a patch filter it out. I'll also need to update my hooks patch to fix
> this bug in mcheck.
>
> Thanks,
> Siddhesh
It also caused:
https://sourceware.org/bugzilla/show_bug.cgi?id=28068
on x32.
--
H.J.
next prev parent reply other threads:[~2021-07-08 23:38 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-02 2:35 [PATCH v3 00/10] Remove malloc hooks Siddhesh Poyarekar via Libc-alpha
2021-07-02 2:35 ` [PATCH v3 01/10] mtrace: Deprecate mallwatch and tr_break Siddhesh Poyarekar via Libc-alpha
2021-07-02 2:35 ` [PATCH v3 02/10] Add mcheck tests to malloc Siddhesh Poyarekar via Libc-alpha
2021-07-06 14:50 ` Stefan Liebler via Libc-alpha
2021-07-06 15:54 ` Siddhesh Poyarekar
2021-07-08 23:37 ` H.J. Lu via Libc-alpha [this message]
2021-07-09 0:06 ` H.J. Lu via Libc-alpha
2021-07-09 1:46 ` Siddhesh Poyarekar
2021-07-09 3:53 ` [PATCH] Add a generic malloc test for MALLOC_ALIGNMENT H.J. Lu via Libc-alpha
2021-07-09 4:07 ` Siddhesh Poyarekar
2021-07-09 12:24 ` [PATCH v2] " H.J. Lu via Libc-alpha
2021-07-09 13:00 ` Siddhesh Poyarekar
2021-07-09 13:31 ` [PATCH v3] " H.J. Lu via Libc-alpha
2021-07-09 13:34 ` Siddhesh Poyarekar
2021-07-12 18:02 ` [PATCH v3 02/10] Add mcheck tests to malloc Matheus Castanho via Libc-alpha
2021-07-13 1:06 ` Siddhesh Poyarekar
2021-07-13 12:11 ` Matheus Castanho via Libc-alpha
2021-07-02 2:35 ` [PATCH v3 03/10] Move glibc.malloc.check implementation into its own file Siddhesh Poyarekar via Libc-alpha
2021-07-02 9:05 ` Andreas Schwab
2021-07-02 9:29 ` Siddhesh Poyarekar via Libc-alpha
2021-07-02 9:59 ` Andreas Schwab
2021-07-02 2:35 ` [PATCH v3 04/10] malloc: Move malloc hook references to hooks.c Siddhesh Poyarekar via Libc-alpha
2021-07-02 2:35 ` [PATCH v3 05/10] glibc.malloc.check: Wean away from malloc hooks Siddhesh Poyarekar via Libc-alpha
2021-07-02 2:35 ` [PATCH v3 06/10] mcheck: " Siddhesh Poyarekar via Libc-alpha
2021-07-02 2:35 ` [PATCH v3 07/10] mtrace: " Siddhesh Poyarekar via Libc-alpha
2021-07-02 2:35 ` [PATCH v3 08/10] Remove " Siddhesh Poyarekar via Libc-alpha
2021-07-02 2:35 ` [PATCH v3 09/10] Remove __after_morecore_hook Siddhesh Poyarekar via Libc-alpha
2021-07-02 2:35 ` [PATCH v3 10/10] Remove __morecore and __default_morecore Siddhesh Poyarekar via Libc-alpha
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
List information: https://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMe9rOp-RPDsJy3qd-zSEz9MirrL0aMY7pMd_cL7qrA0UJ1Q3A@mail.gmail.com \
--to=libc-alpha@sourceware.org \
--cc=hjl.tools@gmail.com \
--cc=siddhesh@gotplt.org \
--cc=stli@linux.ibm.com \
/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).