lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAP-5=fW+_rSpxDABw7EVxVaMOr6pMOiU7WUSMUkbGWppTej+Yg@mail.gmail.com>
Date:   Tue, 15 Nov 2022 09:06:32 -0800
From:   Ian Rogers <irogers@...gle.com>
To:     Naresh Kamboju <naresh.kamboju@...aro.org>
Cc:     open list <linux-kernel@...r.kernel.org>,
        linux-perf-users@...r.kernel.org,
        Arnaldo Carvalho de Melo <acme@...nel.org>
Subject: Re: perf: gcc-12: tests/builtin-test.c:242:66: error: array subscript
 1 is outside array bounds of 'struct test_suite *[1]' [-Werror=array-bounds] ^

On Tue, Nov 15, 2022 at 4:14 AM Naresh Kamboju
<naresh.kamboju@...aro.org> wrote:
>
> You might be aware of the following perf build fails with gcc-12 for
> 32bit arm and i386.
> Whereas gcc-11 builds passed.
>
> Reported-by: Linux Kernel Functional Testing <lkft@...aro.org>
>
> Build log:
> -----------
>   CC      /home/tuxbuild/.cache/tuxmake/builds/1/build/util/block-info.o
> In function '__cmd_test',
>     inlined from 'cmd_test' at tests/builtin-test.c:522:9:
> tests/builtin-test.c:242:66: error: array subscript 1 is outside array
> bounds of 'struct test_suite *[1]' [-Werror=array-bounds]
>   242 |                 for (k = 0, t = tests[j][k]; tests[j][k]; k++,
> t = tests[j][k])
>       |                                                                  ^
> tests/builtin-test.c:351:9: note: in expansion of macro 'for_each_test'
>   351 |         for_each_test(j, k, t) {
>       |         ^~~~~~~~~~~~~
> tests/builtin-test.c: In function 'cmd_test':
> tests/builtin-test.c:35:27: note: at offset 4 into object 'arch_tests' of size 4
>    35 | struct test_suite *__weak arch_tests[] = {
>       |                           ^~~~~~~~~~
> cc1: all warnings being treated as errors
>
>   CC      /home/tuxbuild/.cache/tuxmake/builds/1/build/util/expr.o
> In function 'parse_events_term__num',
>     inlined from 'parse_events_multi_pmu_add' at util/parse-events.c:1594:6:
> util/parse-events.c:2638:64: error: array subscript 'YYLTYPE[0]' is
> partly outside array bounds of 'char[4]' [-Werror=array-bounds]
>  2638 |                 .err_term  = loc_term ? loc_term->first_column : 0,
>       |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
> util/parse-events.c: In function 'parse_events_multi_pmu_add':
> util/parse-events.c:1579:15: note: object 'config' of size 4
>  1579 |         char *config;
>       |               ^~~~~~
> cc1: all warnings being treated as errors
>
> build log link,
> https://builds.tuxbuild.com/2HXiqb3LCKg451GckF052odBiPY/
>
> Please refer following links for perf build results comparison between
> gcc-11 and gcc-12
>
> https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.0.y/build/v6.0.8-191-gf8896c3ebbcf/testrun/13003574/suite/build/test/gcc-11-lkftconfig-perf/history/
>
> https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.0.y/build/v6.0.8-191-gf8896c3ebbcf/testrun/13003574/suite/build/test/gcc-12-lkftconfig-perf/history/

I wonder if this is a GCC bug. There shouldn't be any difference 32 vs
64-bit, the arrays of tests are NULL terminated. Perhaps the weak
symbol (weak symbols are outside the C specification) is the issue and
defeats the analysis but only for 32-bit.

Thanks,
Ian

> --
> Linaro LKFT
> https://lkft.linaro.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ