This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: master: Build failure in malloc with GCC 7


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]