Run-time failure on ppc64le: invalid input constraint 'YZ<>' in asm
- Dominant language
- C
- Stars
- 22.7k
- Forks
- 4.1k
- Avg merge
- 10d 4h
- Merged PRs (30d)
- 3
Description
jfyi, test run of `cpudist` from 0.31.0 started to fail on Linux v6.12.5 on ppc64le with:
```
[00:02:05] ++ /usr/src/tmp/bcc-buildroot/usr/share/bcc/tools/cpudist 1 1
[00:02:08] In file included from /virtual/main.c:2:
[00:02:08] In file included from include/uapi/linux/ptrace.h:145:
[00:02:08] In file included from arch/powerpc/include/asm/ptrace.h:141:
[00:02:08] In file included from arch/powerpc/include/asm/paca.h:25:
[00:02:08] arch/powerpc/include/asm/atomic.h:183:53: error: invalid input constraint 'YZ<>' in asm
[00:02:08] 183 | __asm__ __volatile__("ld%U1%X1 %0,%1" : "=r"(t) : DS_FORM_CONSTRAINT (v->counter));
[00:02:08] | ^
[00:02:08] arch/powerpc/include/asm/asm-compat.h:43:28: note: expanded from macro 'DS_FORM_CONSTRAINT'
[00:02:08] 43 | #define DS_FORM_CONSTRAINT "YZ<>"
[00:02:08] | ^
[00:02:08] In file included from /virtual/main.c:2:
[00:02:08] In file included from include/uapi/linux/ptrace.h:145:
[00:02:08] In file included from arch/powerpc/include/asm/ptrace.h:141:
[00:02:08] In file included from arch/powerpc/include/asm/paca.h:25:
[00:02:08] arch/powerpc/include/asm/atomic.h:194:44: error: invalid output constraint '=YZ<>' in asm
[00:02:08] 194 | __asm__ __volatile__("std%U0%X0 %1,%0" : "=" DS_FORM_CONSTRAINT (v->counter) : "r"(i));
[00:02:08] | ^
[00:02:08] 2 errors generated.
[00:02:08] Traceback (most recent call last):
[00:02:08] File "/usr/src/tmp/bcc-buildroot/usr/share/bcc/tools/cpudist", line 210, in
[00:02:08] b = BPF(text=bpf_text, cflags=["-DMAX_PID=%d" % max_pid])
[00:02:08] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:02:08] File "/usr/src/tmp/bcc-buildroot/usr/lib64/python3/site-packages/bcc/__init__.py", line 480, in __init__
[00:02:08] raise Exception("Failed to compile BPF module %s" % (src_file or ""))
[00:02:08] Exception: Failed to compile BPF module
```
This test was working OK on Linux v6.10.6 (I'm not implying that kernel version difference is the cause of failure though).
This architecture is low priority for us, thus I'm just disabling build of bcc package on ppc64le for ALT Linux, but this failure might interesting for you, so I'm reporting it here.
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the failure by running cpudist on ppc64le with the Linux headers involved in arch/powerpc/include/asm/atomic.h and arch/powerpc/include/asm/asm-compat.h. Trace the BPF compilation path that raises the error, then verify that cpudist builds and runs successfully on the affected architecture and kernel versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux
- Domain
- devtools, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100