This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] bring -Warray-bounds closer to -Wstringop-overflow (PR91647, 91463, 91679)
- From: "Maciej W. Rozycki" <macro at wdc dot com>
- To: Martin Sebor <msebor at gmail dot com>, libc-alpha at sourceware dot org
- Cc: Jeff Law <law at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 6 Nov 2019 23:09:00 +0000 (GMT)
- Subject: Re: [PATCH] bring -Warray-bounds closer to -Wstringop-overflow (PR91647, 91463, 91679)
- Ironport-sdr: j8/f2QPvVq1dLXqwR8a4e9W++0bVuvFXW8T9dRaPR1tEIg/0SQIcei6WtopxfFtFm0csWBjr5P AzWqXa6K4IWPdkErsWPQ36JbWK8eQZzCamxc2E1xe7huEVMZO+py5ZpP3UhpGarK0rig/ZlgvU oy537sD6ElqGcVBVcHF48pXjNXtw5taJsgogtDaBuz/JdjIEP0ixOcKaN4+1Ck4GIkZGWfpJZB wo7RTD+4G/ckBbseDvmdqJ/vq0DQZWZ4B3fmShgvftnLGPMbY11tU0yGRFzD1GtM46WmuqSTsV dsI=
- Ironport-sdr: aOaJYaYnEFiYFgMZW2OiGSK/5Tq/on9imXBAXdisLeZj5CkKKOTaq0fzlJEncPfawm9irEDaPr iyrK9sWzT5F1yAiVYq5wD5KsbMboaJ1DPuWZ9Aub1AJzDXwc+MrGQtTNEt+1KxAn+ZTpefo97y RVOK8lAupFOck3e8TzEtxLD7K+9h6lKAiMfojVDv7FkzJk2ZEiY50pgUJwSFzXoGmaZ38mw1Bn 7PT7USdadcEAZOtuBZZF9/AIvUeOoSGQITpmnLK7zcvxv9X5oGQbwssK1AxK4JDT2RYg/7lAIW bvTUugmGJvr+i1sao9X9W4pf
- Ironport-sdr: JnqdmZdB/6TVocwGS/eUhi76Bs3dFLLiia7syDK6xZpnYjsXIsABD4eDSg0TOsaZY9alt8ke1q mBAmZFe7YPQRV9RZY7LtZIuboME3Gi3jLqgUdc3XALqHJyJlGZDte81txy3dRnX1Yp2cdNDJ6r hZlW1KsA9Dp1ZZX6JtghmE31XYn7zZROGWGKyd2TBdvfN6GqIFq5SCX9PoPJ5YUrZml2rAglCM rzcLdTkpf7YrV9oMjRH9i7gOEwSpT1/odjQZkWYjKmdP4+w4QqqxdQp7om7RIC2jc6pyDSKkMP edw=
- References: <f80f84af-4f40-5af6-1b5f-88feafb589cc@gmail.com> <ee719686-3260-b20b-4732-95421f14ce27@redhat.com> <5573d108-2441-8d0f-6c60-514b4fd0db3e@gmail.com> <d44f680e-d3f5-ce9a-9632-b38a967ea7dc@redhat.com> <d5d3de75-de21-0a2e-ec0f-2de91d9c53f6@gmail.com>
- Wdcironportexception: Internal
On Fri, 1 Nov 2019, Martin Sebor wrote:
> Rebuilding the kernel with the updated patch results in the following
> breakdown of the two warnings (the numbers are total instances of each,
> unique instances, and files they come from):
>
> -Wzero-length-bounds 49 46 13
> -Warray-bounds 45 14 8
>
> The -Warray-bounds instances I checked look legitimate even though
> the code is some of them still looks benign. I'm not sure there's
> a good way to relax the warning to sanction some of these abuses
> without also missing some bugs. It might be worth looking into
> some more in stage 3, depending on the fallout during mass rebuild.
>
> After bootstrapping on x86_64 and i385 and regtesting I committed
> the attached patch in r277728.
It is what I believe has also broken glibc:
In file included from ../sysdeps/riscv/libc-tls.c:19:
../csu/libc-tls.c: In function '__libc_setup_tls':
../csu/libc-tls.c:209:30: error: array subscript 1 is outside the bounds of an interior zero-length array 'struct dtv_slotinfo[0]' [-Werror=zero-length-bounds]
209 | static_slotinfo.si.slotinfo[1].map = main_map;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from ../sysdeps/riscv/ldsodefs.h:46,
from ../sysdeps/gnu/ldsodefs.h:46,
from ../sysdeps/unix/sysv/linux/ldsodefs.h:25,
from ../sysdeps/unix/sysv/linux/riscv/ldsodefs.h:22,
from ../csu/libc-tls.c:21,
from ../sysdeps/riscv/libc-tls.c:19:
../sysdeps/generic/ldsodefs.h:423:7: note: while referencing 'slotinfo'
423 | } slotinfo[0];
| ^~~~~~~~
cc1: all warnings being treated as errors
(here in a RISC-V build).
Has anybody looked yet into how the breakage could possibly be addressed?
Maciej