From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id BA5203AAA0B6 for ; Thu, 8 Jul 2021 23:37:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BA5203AAA0B6 Received: by mail-pl1-x62c.google.com with SMTP id h1so4058597plf.6 for ; Thu, 08 Jul 2021 16:37:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=v7O01tIfktWwCpwCzwH/GWpNfgonurU9zZuxqnzDsGI=; b=aMyOotUGbAXy18auDmz5p/exnFIC04wzSgmmmK8lwsgKzy+psBcJcWrwR0xwIfufv1 +QcAO/HNwqQ6tSjxeCsBraYp9x9GhIQdE3vRjEL76BymjcfO2L87DeJf2Q/RqnnIG1xx UEw2PF2JLqmOCzHybDti7H30uEL56W4G5GYE3ZGx+My0SoWl4AVPMX6DCNr3P7zJ4gci MKKfKJKaVJjHWt+rioM+rVrK7jx1hZ4v64P414Ig+UIJwbDeUNi0XuEsuyVRa3svdOPa 0Bpr4R3pyobKtJfkVLtMbCQU7OfBD98yNx5ZMxNxGgK2GjSuoCEiUbKUeFd34d4xrCZc o6sA== X-Gm-Message-State: AOAM5311exKqJs4PaSyZqDY25ybnobTwm6ipdkgJ13ssUBNrE01CqxBJ X62SROrsIK/0MHpI1/AjyWcWRHXu9r6ZvLqDL2QWAAOXxEk= X-Google-Smtp-Source: ABdhPJxA/c0CeJn6XY/LiwtKrFaGbYqCq+QU+RGJrmSLl7wP5ogJoCdjp+oCm8J2W/H2PrB6k/qz1Fkn3y1qOhCu34Q= X-Received: by 2002:a17:90a:6be6:: with SMTP id w93mr16313671pjj.154.1625787466510; Thu, 08 Jul 2021 16:37:46 -0700 (PDT) MIME-Version: 1.0 References: <20210702023546.3081774-1-siddhesh@sourceware.org> <20210702023546.3081774-3-siddhesh@sourceware.org> <0270d99b-3a15-09d2-7fa9-c9ecf2591d8f@gotplt.org> In-Reply-To: <0270d99b-3a15-09d2-7fa9-c9ecf2591d8f@gotplt.org> From: "H.J. Lu" Date: Thu, 8 Jul 2021 16:37:10 -0700 Message-ID: Subject: Re: [PATCH v3 02/10] Add mcheck tests to malloc To: Siddhesh Poyarekar Cc: Stefan Liebler , GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3025.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jul 2021 23:37:52 -0000 On Tue, Jul 6, 2021 at 8:54 AM Siddhesh Poyarekar 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.