From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by sourceware.org (Postfix) with ESMTPS id C8893389703D for ; Mon, 26 Oct 2020 13:32:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C8893389703D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=liqingqing3@huawei.com Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CKbNw0CH1z15LXD; Mon, 26 Oct 2020 21:32:32 +0800 (CST) Received: from [10.174.178.215] (10.174.178.215) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Mon, 26 Oct 2020 21:32:19 +0800 Subject: Re: [PATCH] malloc debug: fix compile error when enable macro MALLOC_DEBUG > 1 From: liqingqing To: , , , CC: Liusirui , Hushiyuan References: <588ad7ca-f69a-3aa5-7715-a60437587993@huawei.com> Message-ID: <2fab33b7-3cd1-287c-64b2-5a7021c64c63@huawei.com> Date: Mon, 26 Oct 2020 21:32:20 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 MIME-Version: 1.0 In-Reply-To: <588ad7ca-f69a-3aa5-7715-a60437587993@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.178.215] X-CFilter-Loop: Reflected X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_NUMSUBJECT, NICE_REPLY_A, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Mon, 26 Oct 2020 13:32:36 -0000 ping again. On 2020/10/22 17:11, liqingqing wrote: > malloc debug: fix compile error when enable macro MALLOC_DEBUG > 1. > > this is because commit e9c4fe93b3855239752819303ca377dff0ed0553 has > change the struct malloc_chunk's member "size" to "mchunk_size". > > the reproduction is like that: > setp1: modify related Makefile. > vim ../glibc/malloc/Makefile > CPPFLAGS-malloc.o += -DMALLOC_DEBUG=2 > > step2: ../configure --prefix=/usr >        make -j32 > > this will cause the compile error: > /home/liqingqing/glibc_upstream/buildglibc/malloc/malloc.o > In file included from malloc.c:1899:0: > arena.c: In function ‘dump_heap’: > arena.c:422:58: error: ‘struct malloc_chunk’ has no member named ‘size’ >        fprintf (stderr, "chunk %p size %10lx", p, (long) p->size); >                                                           ^~ > arena.c:428:17: error: ‘struct malloc_chunk’ has no member named ‘size’ >        else if (p->size == (0 | PREV_INUSE)) > --- >  malloc/arena.c | 4 ++-- >  1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/malloc/arena.c b/malloc/arena.c > index cecdb7f4c4..202daf15b0 100644 > --- a/malloc/arena.c > +++ b/malloc/arena.c > @@ -419,13 +419,13 @@ dump_heap (heap_info *heap) >                     ~MALLOC_ALIGN_MASK); >    for (;; ) >      { > -      fprintf (stderr, "chunk %p size %10lx", p, (long) p->size); > +      fprintf (stderr, "chunk %p size %10lx", p, (long) > chunksize_nomask(p)); >        if (p == top (heap->ar_ptr)) >          { >            fprintf (stderr, " (top)\n"); >            break; >          } > -      else if (p->size == (0 | PREV_INUSE)) > +      else if (chunksize_nomask(p) == (0 | PREV_INUSE)) >          { >            fprintf (stderr, " (fence)\n"); >            break;