master: Build failure in malloc with GCC 7
Florian Weimer
fweimer@redhat.com
Wed Jul 12 10:07:00 GMT 2017
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
More information about the Libc-alpha
mailing list