Skip to contentSkip to conversation

CI/randconfig: Disable CONFIG_CONDITION_COVERAGE

PATCH In review Andrew Cooper 3 participants 3 messages Jan 12 – Jan 31

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 CI/randconfig: Disable CONFIG_CONDITION_COVERAGE

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.

---
CC: Anthony PERARD <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Julien Grall <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Nicola Vetrini <[email protected]>

---
 xen/tools/kconfig/allrandom.config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/tools/kconfig/allrandom.config +1 -1
index f04b589a80af..8127ebb57090 100644
@@ -1,2 +1,2 @@
 # Explicit option choices not subject to regular RANDCONFIG
-
+CONFIG_CONDITION_COVERAGE=n

base-commit: a2a34d76643e49ccc949296c9a45888034e50b55

Signature · 1 line
2.39.5
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Andrew Cooper

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.

Quoted 25 lines

---
CC: Anthony PERARD <[email protected]>
CC: Michal Orzel <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Julien Grall <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Nicola Vetrini <[email protected]>

---
 xen/tools/kconfig/allrandom.config | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/tools/kconfig/allrandom.config +1 -1
index f04b589a80af..8127ebb57090 100644
@@ -1,2 +1,2 @@
 # Explicit option choices not subject to regular RANDCONFIG
-
+CONFIG_CONDITION_COVERAGE=n

base-commit: a2a34d76643e49ccc949296c9a45888034e50b55

Signature · 1 line
2.39.5
#2 lore raw
In reply to Andrew Cooper
Quoted 8 lines

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

Quoted 2 lines

[snip]