Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 926355 - x11-base/xorg-server-21.1.11 - ../xorg-server-21.1.11/test/list.c:383:5: ../xorg-server-21.1.11/include/list.h:311:10: error: array subscript 0 is outside array bounds of 'struct parent[1]' (w. CFLAGS="-Os"))
Summary: x11-base/xorg-server-21.1.11 - ../xorg-server-21.1.11/test/list.c:383:5: ../x...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-07 13:24 UTC by ernsteiswuerfel
Modified: 2024-03-07 13:25 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log.xz (ppc, 21.1.11) (xorg-server-21.1.11:20240307-125455.log.xz,21.59 KB, application/x-xz)
2024-03-07 13:24 UTC, ernsteiswuerfel
Details
emerge --info (file_926355.txt,6.45 KB, text/plain)
2024-03-07 13:25 UTC, ernsteiswuerfel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ernsteiswuerfel archtester 2024-03-07 13:24:33 UTC
Created attachment 886901 [details]
build.log.xz (ppc, 21.1.11)

Builds fine with -O2 but fails with -Os:

[...]
ninja: job failed: powerpc-gentoo-linux-musl-gcc -Itest/tests.p -Itest -I../xorg-server-21.1.11/test -IXext -I../xorg-server-21.1.11/Xext -IXi -I../xorg-server-21.1.11/Xi -Icomposite -I../xorg-server-21.1.11/composite -Idamageext -I../xorg-server-21.1.11/damageext -Iexa -I../xorg-server-21.1.11/exa -Ifb -I../xorg-server-21.1.11/fb -Iglamor -I../xorg-server-21.1.11/glamor -Imi -I../xorg-server-21.1.11/mi -Imiext/damage -I../xorg-server-21.1.11/miext/damage -Imiext/shadow -I../xorg-server-21.1.11/miext/shadow -Imiext/sync -I../xorg-server-21.1.11/miext/sync -Idbe -I../xorg-server-21.1.11/dbe -Idri3 -I../xorg-server-21.1.11/dri3 -Iinclude -I../xorg-server-21.1.11/include -Ipresent -I../xorg-server-21.1.11/present -Irandr -I../xorg-server-21.1.11/randr -Irender -I../xorg-server-21.1.11/render -Ixfixes -I../xorg-server-21.1.11/xfixes -Ihw/xfree86/common -I../xorg-server-21.1.11/hw/xfree86/common -Ihw/xfree86/ddc -I../xorg-server-21.1.11/hw/xfree86/ddc -Ihw/xfree86/dri2 -I../xorg-server-21.1.11/hw/xfree86/dri2 -Ihw/xfree86/i2c -I../xorg-server-21.1.11/hw/xfree86/i2c -Ihw/xfree86/int10 -I../xorg-server-21.1.11/hw/xfree86/int10 -Ihw/xfree86/loader -I../xorg-server-21.1.11/hw/xfree86/loader -Ihw/xfree86/modes -I../xorg-server-21.1.11/hw/xfree86/modes -Ihw/xfree86/os-support -I../xorg-server-21.1.11/hw/xfree86/os-support -I../xorg-server-21.1.11/hw/xfree86/os-support/bus -Ihw/xfree86/parser -I../xorg-server-21.1.11/hw/xfree86/parser -Ihw/xfree86/ramdac -I../xorg-server-21.1.11/hw/xfree86/ramdac -Ihw/xfree86/vgahw -I../xorg-server-21.1.11/hw/xfree86/vgahw -I../xorg-server-21.1.11/test/xi1 -I../xorg-server-21.1.11/test/xi2 -I/usr/include/pixman-1 -fdiagnostics-color=always -DNDEBUG -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -DHAVE_DIX_CONFIG_H -fno-strict-aliasing -fvisibility=hidden -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Os -mcpu=7450 -mtune=7450 -pipe -DXORG_TESTS -DRES_TESTS -fno-lto -MD -MQ test/tests.p/list.c.o -MF test/tests.p/list.c.o.d -o test/tests.p/list.c.o -c ../xorg-server-21.1.11/test/list.c
In file included from ../xorg-server-21.1.11/test/list.c:32:
In function 'test_xorg_list_for_each',
    inlined from 'list_test' at ../xorg-server-21.1.11/test/list.c:383:5:
../xorg-server-21.1.11/include/list.h:311:10: error: array subscript 0 is outside array bounds of 'struct parent[1]' [-Werror=array-bounds=]
  311 |          &pos->member != (head);                                        \
../xorg-server-21.1.11/test/list.c:213:5: note: in expansion of macro 'xorg_list_for_each_entr '
  213 |     xorg_list_for_each_entry(c, &parent.children, node) {
      |     ^~~~~~~~~~~~~~~~~~~~~~~~
../xorg-server-21.1.11/test/list.c: In function 'list_test':
../xorg-server-21.1.11/test/list.c:193:19: note: at offset -4 into object 'parent' of size 16
  193 |     struct parent parent = { 0 };
      |                   ^~~~~~
cc1: some warnings being treated as errors
ninja: subcommand failed


Probably this is neither GCC 14, musl nor ppc specific so I didn't set blockers up.
Comment 1 ernsteiswuerfel archtester 2024-03-07 13:25:11 UTC
Created attachment 886902 [details]
emerge --info
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-03-07 13:25:41 UTC
These errors are very sensitive to the amount of optimisation done.