[PATCH] CI/randconfig: Disable CONFIG_CONDITION_COVERAGE

Andrew Cooper posted 1 patch 3 weeks, 5 days ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20260112163827.1023401-1-andrew.cooper3@citrix.com
xen/tools/kconfig/allrandom.config | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] CI/randconfig: Disable CONFIG_CONDITION_COVERAGE
Posted by Andrew Cooper 3 weeks, 5 days ago
In addition to GCC not liking x86_emulate(), it turns out that Clang is still
rather more a work in progress than a usable feature, causing failures in the
FreeBSD builds:

  https://cirrus-ci.com/task/5934059060199424

Exclude CONFIG_CONDITION_COVERAGE from Ranconfig until it gets a bit more
stable.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Anthony PERARD <anthony.perard@vates.tech>
CC: Michal Orzel <michal.orzel@amd.com>
CC: Jan Beulich <jbeulich@suse.com>
CC: Julien Grall <julien@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/tools/kconfig/allrandom.config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/tools/kconfig/allrandom.config b/xen/tools/kconfig/allrandom.config
index f04b589a80af..8127ebb57090 100644
--- a/xen/tools/kconfig/allrandom.config
+++ b/xen/tools/kconfig/allrandom.config
@@ -1,2 +1,2 @@
 # Explicit option choices not subject to regular RANDCONFIG
-
+CONFIG_CONDITION_COVERAGE=n

base-commit: a2a34d76643e49ccc949296c9a45888034e50b55
-- 
2.39.5


Re: [PATCH] CI/randconfig: Disable CONFIG_CONDITION_COVERAGE
Posted by Wentao Zhang 1 week, 1 day ago
> In addition to GCC not liking x86_emulate(), it turns out that Clang is still
> rather more a work in progress than a usable feature, causing failures in the
> FreeBSD builds:
>
>   https://cirrus-ci.com/task/5934059060199424
>
> Exclude CONFIG_CONDITION_COVERAGE from Ranconfig until it gets a bit more
> stable.

Hi Andrew,

Thanks for catching this. I can confirm it is reliably reproducible on
a FreeBSD host with LLVM toolchain, as long as CONFIG_COVERAGE is on
(regardless of CONFIG_CONDITION_COVERAGE). So this patch probably won't
avoid the failure in the future.

See also the report by Roger which predates the introduction of LLVM
condition coverage:

  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290381

The cause looks multifold:

1. Direct cause is null dereferences in LLVM linker

  https://github.com/llvm/llvm-project/blob/llvmorg-23-init/lld/ELF/OutputSections.cpp#L631
  https://github.com/llvm/llvm-project/blob/llvmorg-23-init/lld/ELF/InputSection.cpp#L419

2. The use of objcopy from elftoolchain on FreeBSD

  $ objcopy --version
  objcopy (elftoolchain r3769)

3. gnu_inline attribute of xen/include/xen/sort.h

On FreeBSD 14.2, the following sequence using small program reproduces the
crash:

```
cat > 1.c <<'EOF'
#include "h.h"
int fun1(int a, int b) { return add(a, b); }
EOF

cat > 2.c <<'EOF'
#include "h.h"
int func2(int a, int b) { return add(a+1, b+1); }
EOF

cat > h.h <<'EOF'
extern inline __attribute__((__gnu_inline__))
int add(int a, int b) { return a + b; }
EOF

# OBJCOPY=/usr/local/bin/objcopy # binutils -- fine
# OBJCOPY=/usr/bin/llvm-objcopy  # LLVM -- fine
# OBJCOPY=cp                     # skip -- fine
OBJCOPY=/usr/bin/objcopy       # elftoolchain -- X

CFLAGS='-O1 -fprofile-instr-generate -fcoverage-mapping'

clang $CFLAGS -c 1.c -o 1.o.tmp
clang $CFLAGS -c 2.c -o 2.o.tmp
$OBJCOPY 1.o.tmp 1.o
$OBJCOPY 2.o.tmp 2.o

ld.lld -o output.o -r 1.o 2.o
```

I will consider filing a report/patch to LLVM but I am frankly not sure
whether it will be accommodated given (1) this unusual combination of
toolchain to trigger the bug (2) elftoolchain is retiring in newer FreeBSD.

Thanks,
Wentao

>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

[snip]
Re: [PATCH] CI/randconfig: Disable CONFIG_CONDITION_COVERAGE
Posted by Stefano Stabellini 3 weeks, 5 days ago
On Mon, 12 Jan 2026, Andrew Cooper wrote:
> In addition to GCC not liking x86_emulate(), it turns out that Clang is still
> rather more a work in progress than a usable feature, causing failures in the
> FreeBSD builds:
> 
>   https://cirrus-ci.com/task/5934059060199424
> 
> Exclude CONFIG_CONDITION_COVERAGE from Ranconfig until it gets a bit more
> stable.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> CC: Anthony PERARD <anthony.perard@vates.tech>
> CC: Michal Orzel <michal.orzel@amd.com>
> CC: Jan Beulich <jbeulich@suse.com>
> CC: Julien Grall <julien@xen.org>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> CC: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
>  xen/tools/kconfig/allrandom.config | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/tools/kconfig/allrandom.config b/xen/tools/kconfig/allrandom.config
> index f04b589a80af..8127ebb57090 100644
> --- a/xen/tools/kconfig/allrandom.config
> +++ b/xen/tools/kconfig/allrandom.config
> @@ -1,2 +1,2 @@
>  # Explicit option choices not subject to regular RANDCONFIG
> -
> +CONFIG_CONDITION_COVERAGE=n
> 
> base-commit: a2a34d76643e49ccc949296c9a45888034e50b55
> -- 
> 2.39.5
>