All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "HyeongJun An" <sammiee5311@gmail.com>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next] selftests/bpf: Tolerate libarena skeleton failures under BPF_STRICT_BUILD=0
Date: Fri, 11 Sep 2026 14:33:40 +0000	[thread overview]
Message-ID: <20260911143341.7905E1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260911141621.1944900-1-sammiee5311@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The permissive fallback for libarena sub-makes does not remove the target file on failure, leaving a corrupted or empty skeleton header that permanently breaks incremental builds.
- [Medium] The `bench` executable fails to link and is completely skipped when the libarena benchmark skeleton generation fails, contradicting the commit message's claim that 'bench all link'.
--

commit 03a9a4a189e91e03941dfb620bf2f4bda1071094
Author: HyeongJun An <sammiee5311@gmail.com>

selftests/bpf: Tolerate libarena skeleton failures under BPF_STRICT_BUILD=0

This patch modifies the libarena skeleton build rules to respect
BPF_STRICT_BUILD=0, allowing the build to continue if the libarena
skeletons fail to generate. It adds permissive fallback logic to the
three libarena sub-makes.

> The build then prints SKIP-SKEL and continues, and test_progs,
> test_progs-no_alu32, test_progs-cpuv4 and bench all link.

[Severity: Medium]
Is this claim about bench linking successfully accurate when the benchmark
skeleton fails?

Looking at the bench target in the Makefile, it has a hardcoded
dependency on $(OUTPUT)/bench_libarena.o. The link command unconditionally
passes all objects to the compiler:

$(Q)$(CC) $(CFLAGS) $(LDFLAGS) $(filter %.a %.o,$^) $(LDLIBS) -o $@ ...

If the libarena benchmark skeleton fails under permissive mode,
bench_libarena.o will be missing. Because the link command doesn't
filter out skipped benchmark objects, won't this cause the entire bench
executable to fail to link and trigger SKIP-LINK instead?

> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index 7ea5ba1df29e3..a9951774e5c85 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -835,17 +835,20 @@ LIBARENA_SKEL := libarena/libarena.skel.h
>  LIBARENA_BENCH_SKEL := libarena/libarena_bench.skel.h
>  
>  $(LIBARENA_SKEL): $(INCLUDE_DIR)/vmlinux.h $(BPFOBJ) $(LIBARENA_BPF_DEPS)
> -	+$(MAKE) -C libarena libarena.skel.h $(LIBARENA_MAKE_ARGS)
> +	+$(MAKE) -C libarena libarena.skel.h $(LIBARENA_MAKE_ARGS) $(if $(PERMISSIVE),|| \
> +		printf '  %-12s %s\n' 'SKIP-SKEL' '$(notdir $@)' 1>&2)

[Severity: High]
Does this missing cleanup leave behind a corrupted skeleton header?

In other permissive fallback rules, ($(RM) $@; printf ...) is used to
ensure the target file is removed on failure. Because shell redirection
in the sub-make might truncate the skeleton header before bpftool runs,
could an error leave a 0-byte or incomplete file behind?

If the file isn't explicitly removed here, won't subsequent incremental
builds attempt to use the corrupted skeleton header instead of rebuilding
it?

[ ... ]

>  $(LIBARENA_BENCH_SKEL): $(INCLUDE_DIR)/vmlinux.h $(BPFOBJ) $(LIBARENA_BENCH_BPF_DEPS) | $(LIBARENA_SKEL)
> -	+$(MAKE) -C libarena benchmarks $(LIBARENA_MAKE_ARGS)
> +	+$(MAKE) -C libarena benchmarks $(LIBARENA_MAKE_ARGS) $(if $(PERMISSIVE),|| \
> +		printf '  %-12s %s\n' 'SKIP-SKEL' '$(notdir $@)' 1>&2)

[Severity: High]
Similarly, should this fallback also remove the target file with $(RM) $@ to
prevent breaking future incremental builds with a corrupted
libarena_bench.skel.h?

[ ... ]

>  ifneq ($(CLANG_HAS_ARENA_ASAN),)
>  LIBARENA_ASAN_SKEL := libarena/libarena_asan.skel.h
>  CFLAGS += -DHAS_BPF_ARENA_ASAN
>  
>  $(LIBARENA_ASAN_SKEL): $(INCLUDE_DIR)/vmlinux.h $(BPFOBJ) $(LIBARENA_BPF_DEPS)
> -	+$(MAKE) -C libarena libarena_asan.skel.h $(LIBARENA_MAKE_ARGS)
> +	+$(MAKE) -C libarena libarena_asan.skel.h $(LIBARENA_MAKE_ARGS) $(if $(PERMISSIVE),|| \
> +		printf '  %-12s %s\n' 'SKIP-SKEL' '$(notdir $@)' 1>&2)

[Severity: High]
Does this fallback need the same target cleanup for libarena_asan.skel.h?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260911141621.1944900-1-sammiee5311@gmail.com?part=1

  reply	other threads:[~2026-09-11 14:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-11 14:16 [PATCH bpf-next] selftests/bpf: Tolerate libarena skeleton failures under BPF_STRICT_BUILD=0 HyeongJun An
2026-09-11 14:33 ` sashiko-bot [this message]
2026-09-11 15:27 ` bot+bpf-ci
2026-09-11 18:02 ` Ricardo B. Marlière (SUSE)
2026-09-12  0:47   ` HyeongJun An
2026-09-11 20:24 ` Eduard Zingerman
2026-09-12  0:59   ` HyeongJun An

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260911143341.7905E1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=sammiee5311@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.