unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Siddhesh Poyarekar <siddhesh@gotplt.org>
To: Stefan Liebler <stli@linux.ibm.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH v3 02/10] Add mcheck tests to malloc
Date: Tue, 6 Jul 2021 21:24:02 +0530	[thread overview]
Message-ID: <0270d99b-3a15-09d2-7fa9-c9ecf2591d8f@gotplt.org> (raw)
In-Reply-To: <d4140e60-2661-805c-09c5-499931da75a9@linux.ibm.com>

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

  reply	other threads:[~2021-07-06 15:54 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 [this message]
2021-07-08 23:37       ` H.J. Lu via Libc-alpha
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=0270d99b-3a15-09d2-7fa9-c9ecf2591d8f@gotplt.org \
    --to=siddhesh@gotplt.org \
    --cc=libc-alpha@sourceware.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).