This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: master: Build failure in malloc with GCC 7
- From: Florian Weimer <fweimer at redhat dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 12 Jul 2017 12:07:05 +0200
- Subject: Re: master: Build failure in malloc with GCC 7
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 94EB580477
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 94EB580477
- References: <53780a28-ff3e-0c60-f9b2-f16f9580667d@redhat.com> <mvm60ey9gyx.fsf@suse.de>
On 07/12/2017 10:50 AM, Andreas Schwab wrote:
> On Jul 12 2017, Florian Weimer <fweimer@redhat.com> wrote:
>
>> This is from a recent build in Fedora rawhide:
>>
>> malloc.c:1590:50: error: array subscript is above array bounds
>> [-Werror=array-bounds]
>> #define fastbin(ar_ptr, idx) ((ar_ptr)->fastbinsY[idx])
>> ~~~~~~~~~~~~~~~~~~~~^~~~~~
>> malloc.c:3572:26: note: in expansion of macro 'fastbin'
>> mfastbinptr *fb = &fastbin (av, idx);
>> ^~~~~~~
>
> I don't see that here (with r249772).
Thanks. It turns out it only happens with -O3, so it's no surprise no
one else has seen it yet. It's also related to the thread cache
changes. The full error message is this:
malloc.c: In function ‘tcache_init.part.9’:
malloc.c:3572:25: error: array subscript is above array bounds
[-Werror=array-bounds]
mfastbinptr *fb = &fastbin (av, idx);
^
malloc.c:1590:50: error: array subscript is above array bounds
[-Werror=array-bounds]
#define fastbin(ar_ptr, idx) ((ar_ptr)->fastbinsY[idx])
~~~~~~~~~~~~~~~~~~~~^~~~~~
malloc.c:3572:26: note: in expansion of macro ‘fastbin’
mfastbinptr *fb = &fastbin (av, idx);
^~~~~~~
malloc.c:1590:50: error: array subscript is above array bounds
[-Werror=array-bounds]
#define fastbin(ar_ptr, idx) ((ar_ptr)->fastbinsY[idx])
~~~~~~~~~~~~~~~~~~~~^~~~~~
malloc.c:3572:26: note: in expansion of macro ‘fastbin’
mfastbinptr *fb = &fastbin (av, idx);
I guess we need to debug this and determine whether it's a real problem
with the code, or a GCC bug.
Thanks,
Florian