Block: bio.c:1232:6: error: variable 'i' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]

2 views
Skip to first unread message

Naresh Kamboju

unread,
Jul 11, 2022, 8:44:22 AM7/11/22
to open list, Linux-Next Mailing List, linux-block, lkft-...@lists.linaro.org, regre...@lists.linux.dev, Jens Axboe, Al Viro, Christoph Hellwig, clang-built-linux
Following regression found with clang i386 and x86 builds failed on
Linux next-20220711 tag. Please find the build error logs.

Reported-by: Linux Kernel Functional Testing <lk...@linaro.org>
Reported-by: Naresh Kamboju <naresh....@linaro.org>

Regressions found on i386:

- build-clang-12-defconfig
- build-clang-nightly-lkftconfig
- build-clang-13-defconfig
- build-clang-12-lkftconfig
- build-clang-14-lkftconfig
- build-clang-nightly-defconfig
- build-clang-13-lkftconfig

Regressions found on x86_64:

- build-clang-nightly-x86_64_defconfig
- build-clang-nightly-lkftconfig
- build-clang-13-lkftconfig
- build-clang-12-lkftconfig
- build-clang-13-lkftconfig-kcsan
- build-clang-14-lkftconfig
- build-clang-14-x86_64_defconfig

make --silent --keep-going --jobs=8
O=/home/tuxbuild/.cache/tuxmake/builds/1/build LLVM=1 LLVM_IAS=1
ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- 'HOSTCC=sccache clang'
'CC=sccache clang'
block/bio.c:1232:6: error: variable 'i' is used uninitialized whenever
'if' condition is true [-Werror,-Wsometimes-uninitialized]
if (unlikely(!size)) {
^~~~~~~~~~~~~~~
include/linux/compiler.h:78:22: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^~~~~~~~~~~~~~~~~~~~~~~~~~
block/bio.c:1254:9: note: uninitialized use occurs here
while (i < nr_pages)
^
block/bio.c:1232:2: note: remove the 'if' if its condition is always false
if (unlikely(!size)) {
^~~~~~~~~~~~~~~~~~~~~~
block/bio.c:1202:17: note: initialize the variable 'i' to silence this warning
unsigned len, i;
^
= 0
1 error generated.

Build details:
---------------
download_url: https://builds.tuxbuild.com/2BnQO6OXSJejfpLO4fQ3fWa5wVT/,
git_describe: next-20220711,
git_repo: https://gitlab.com/Linaro/lkft/mirrors/next/linux-next,
git_sha: 4112a8699ae2eac797415b9be1d7901b3f79e772,
git_short_log: 4112a8699ae2 (\Add linux-next specific files
for 20220711\),
kconfig: https://builds.tuxbuild.com/2BnQO6OXSJejfpLO4fQ3fWa5wVT/config
kernel_version: 5.19.0-rc6,
make_variables: {
LLVM: 1,
LLVM_IAS: 1
},

Steps to reproduce:
tuxmake --runtime podman --target-arch x86_64 --toolchain clang-14
--kconfig https://builds.tuxbuild.com/2BnQO6OXSJejfpLO4fQ3fWa5wVT/config
LLVM=1 LLVM_IAS=1

Best regards
Naresh Kamboju

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

Keith Busch

unread,
Jul 11, 2022, 10:59:46 AM7/11/22
to Naresh Kamboju, open list, Linux-Next Mailing List, linux-block, lkft-...@lists.linaro.org, regre...@lists.linux.dev, Jens Axboe, Al Viro, Christoph Hellwig, clang-built-linux
On Mon, Jul 11, 2022 at 06:14:10PM +0530, Naresh Kamboju wrote:
> Following regression found with clang i386 and x86 builds failed on
> Linux next-20220711 tag. Please find the build error logs.
>
> Reported-by: Linux Kernel Functional Testing <lk...@linaro.org>
> Reported-by: Naresh Kamboju <naresh....@linaro.org>

Sorry, I needed to send a v2 of this patch. I didn't realize this was already
merged (it doesn't appear in the block tree), though, so I'm not sure if I need
send a fixup patch or the correct version now.
Reply all
Reply to author
Forward
0 new messages