Hi, Andrey.
I noticed you add test_sysctl to tools/bpf, so drop this problem to you.
When I run selftests: bpf: test_sysctl, failed with
"(test_sysctl.c:1490: errno: Permission denied) >>> Loading program
(./test_sysctl_prog.o) error."
Testing env: "Debian GNU/Linux 9 (stretch)"
kernel: 5.7.0-rc2 5.7.0-rc1 5.6 both failed
Whole run log and kconfig please see the attatchment.
Error info
```
root@vm-snb-42
/usr/src/perf_selftests-x86_64-…
[View More]rhel-7.6-kselftests-ae83d0b416db002fe95601e7f97f64b59514d936/tools/testing/selftests/bpf#
./test_sysctl
Test case: sysctl wrong attach_type .. [PASS]
Test case: sysctl:read allow all .. [PASS]
Test case: sysctl:read deny all .. [PASS]
[snip]
libbpf: -- END LOG --
libbpf: failed to load program 'cgroup/sysctl'
libbpf: failed to load object './test_sysctl_prog.o'
(test_sysctl.c:1490: errno: Permission denied) >>> Loading program
(./test_sysctl_prog.o) error.
Test case: C prog: read tcp_mem .. [FAIL]
Summary: 37 PASSED, 3 FAILED
```
--
Best Regards.
Ma Xinjian
[View Less]
It is possible to get multiple records from trace during test and then more
than 4 arguments are assigned to ARGS. This situation results in the failure
of kprobe_args_type.tc. For example:
-----------------------------------------------------------
grep testprobe trace
ftracetest-5902 [001] d... 111195.682227: testprobe: (_do_fork+0x0/0x460) arg1=334823024 arg2=334823024 arg3=0x13f4fe70 arg4=7
pmlogger-5949 [000] d... 111195.709898: testprobe: (_do_fork+0x0/0x460) arg1=345308784 …
[View More]arg2=345308784 arg3=0x1494fe70 arg4=7
grep testprobe trace
sed -e 's/.* arg1=\(.*\) arg2=\(.*\) arg3=\(.*\) arg4=\(.*\)/\1 \2 \3 \4/'
ARGS='334823024 334823024 0x13f4fe70 7
345308784 345308784 0x1494fe70 7'
-----------------------------------------------------------
We don't care which process calls do_fork so just check the first record to
fix the issue.
Signed-off-by: Xiao Yang <yangx.jy(a)cn.fujitsu.com>
---
.../testing/selftests/ftrace/test.d/kprobe/kprobe_args_type.tc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_type.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_type.tc
index 1bcb67dcae26..81490ecaaa92 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_type.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_type.tc
@@ -38,7 +38,7 @@ for width in 64 32 16 8; do
echo 0 > events/kprobes/testprobe/enable
: "Confirm the arguments is recorded in given types correctly"
- ARGS=`grep "testprobe" trace | sed -e 's/.* arg1=\(.*\) arg2=\(.*\) arg3=\(.*\) arg4=\(.*\)/\1 \2 \3 \4/'`
+ ARGS=`grep "testprobe" trace | head -n 1 | sed -e 's/.* arg1=\(.*\) arg2=\(.*\) arg3=\(.*\) arg4=\(.*\)/\1 \2 \3 \4/'`
check_types $ARGS $width
: "Clear event for next loop"
--
2.25.1
[View Less]
On Sat, Apr 18, 2020 at 11:28 PM Alan Maguire <alan.maguire(a)oracle.com> wrote:
>
>
> On Fri, 17 Apr 2020, David Gow wrote:
>
> > This patchset contains everything needed to integrate KASAN and KUnit.
> >
> > KUnit will be able to:
> > (1) Fail tests when an unexpected KASAN error occurs
> > (2) Pass tests when an expected KASAN error occurs
> >
> > Convert KASAN tests to KUnit with the exception of copy_user_test
> > because …
[View More]KUnit is unable to test those.
> >
>
> I tried building and running and things look good but I am
> still seeing the three failures I reported before, even with
> CONFIG_AMD_MEM_ENCRYPT not set. My config is attached if you
> want to try and reproduce at your end. Oddly this config was
> working before IIRC (once CONFIG_AMD_MEM_ENCRYPT was not set).
>
> Here's the failures:
>
> # kasan_memchr: EXPECTATION FAILED at lib/test_kasan.c:545
> Expected fail_data.report_expected == fail_data.report_found, but
> fail_data.report_expected == 1
> fail_data.report_found == 0
> not ok 31 - kasan_memchr
> # kasan_memcmp: EXPECTATION FAILED at lib/test_kasan.c:566
> Expected fail_data.report_expected == fail_data.report_found, but
> fail_data.report_expected == 1
> fail_data.report_found == 0
> not ok 32 - kasan_memcmp
I was able to reproduce these (along with a kasan_strings) failure,
and the cause seems to be some combination of __builtin functions
being inlined by the compiler and potentially dead code elimination,
as fixed by Daniel Axtens here:
https://lkml.org/lkml/2020/4/23/708
I've sent out v7 of the patchset[1], which I've rebased on top of
Daniel's patches, and can no longer reproduce those test failures with
your .config.
Cheers,
-- David
[1]: https://lkml.org/lkml/2020/4/24/80
[View Less]
Hi Andrii.
sorry to bother you again.
I run bpf: test_progs on debian 9, and failed with"Segmentation fault".
CONFIG_DEBUG_INFO_BTF was enabled in kconfig.
Testing env: "Debian GNU/Linux 9 (stretch)"
kernel: v5.7-rc2 v5.6 both failed
Whole run log and kconfig please see the attatchment.
Error info
```
root@vm-snb-42
/usr/src/perf_selftests-x86_64-rhel-7.6-kselftests-ae83d0b416db002fe95601e7f97f64b59514d936/tools/testing/selftests/bpf#
./test_progs
#1 attach_probe:OK
#2 …
[View More]bpf_obj_id:OK
#3/1 dctcp:OK
[snip]
libbpf: bpf_fentry_test1 is not found in vmlinux BTF
libbpf: failed to load object 'fentry_test'
libbpf: failed to load BPF skeleton 'fentry_test': -2
test_fentry_fexit:FAIL:fentry_skel_load fentry skeleton failed
#13 fentry_fexit:FAIL
libbpf: bpf_fentry_test1 is not found in vmlinux BTF
libbpf: failed to load object 'fentry_test'
libbpf: failed to load BPF skeleton 'fentry_test': -2
test_fentry_test:FAIL:fentry_skel_load fentry skeleton failed
#14 fentry_test:FAIL
#15 fexit_bpf2bpf:OK
libbpf: bpf_fentry_test1 is not found in vmlinux BTF
test_fexit_stress:FAIL:find_vmlinux_btf_id failed: -2
#16 fexit_stress:FAIL
libbpf: bpf_fentry_test1 is not found in vmlinux BTF
libbpf: failed to load object 'fexit_test'
libbpf: failed to load BPF skeleton 'fexit_test': -2
test_fexit_test:FAIL:fexit_skel_load fexit skeleton failed
#17 fexit_test:FAIL
#18 flow_dissector:OK
#19 flow_dissector_load_bytes:OK
#20 flow_dissector_reattach:OK
#21 get_stack_raw_tp:OK
#22 global_data:OK
#23 global_data_init:OK
test_kfree_skb:PASS:prog_load sched cls 0 nsec
libbpf: eth_type_trans is not found in vmlinux BTF
libbpf: failed to load object './kfree_skb.o'
test_kfree_skb:FAIL:prog_load raw tp err -22 errno 1
#24 kfree_skb:FAIL
#25 l4lb_all:OK
#26/1 pin_raw_tp:OK
#26/2 pin_tp_btf:OK
#26 link_pinning:OK
#27 map_lock:OK
Segmentation fault
```
--
Best Regards.
Ma Xinjian
[View Less]
Hi Andrii.
I noticed you add tools/testing/selftests/bpf/progs/test_btf_*, so drop
this problem to you.
I failed to run bpf: test_btf on debian9(stretch), hope you can give me
some suggestion.
Testing env: "Debian GNU/Linux 9 (stretch)"
kernel: 5.7.0-rc2 5.6 both failed
Description: run bpf: test_btf failed with ""Arg#0 type PTR in
test_long_fname_2() is not supported yet.""
Whole run log and kconfig please see the attatchment.
Error info
```
root@vm-snb-42
/usr/…
[View More]src/perf_selftests-x86_64-rhel-7.6-kselftests-ae83d0b416db002fe95601e7f97f64b59514d936/tools/testing/selftests/bpf#
./test_btf
BTF raw test[1] (struct test #1): OK
BTF raw test[2] (struct test #2): OK
BTF raw test[3] (struct test #3 Invalid member offset): OK
[snip]
BTF libbpf test[1] (test_btf_haskv.o): libbpf: load bpf program failed:
Invalid argument
libbpf: -- BEGIN DUMP LOG ---
libbpf:
Validating test_long_fname_2() func#1...
Arg#0 type PTR in test_long_fname_2() is not supported yet.
processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0
peak_states 0 mark_read 0
libbpf: -- END LOG --
libbpf: failed to load program 'dummy_tracepoint'
libbpf: failed to load object 'test_btf_haskv.o'
do_test_file:4201:FAIL bpf_object__load: -4007
BTF libbpf test[2] (test_btf_newkv.o): libbpf: load bpf program failed:
Invalid argument
libbpf: -- BEGIN DUMP LOG ---
libbpf:
Validating test_long_fname_2() func#1...
Arg#0 type PTR in test_long_fname_2() is not supported yet.
processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0
peak_states 0 mark_read 0
libbpf: -- END LOG --
libbpf: failed to load program 'dummy_tracepoint'
libbpf: failed to load object 'test_btf_newkv.o'
do_test_file:4201:FAIL bpf_object__load: -4007
BTF libbpf test[3] (test_btf_nokv.o): libbpf: load bpf program failed:
Invalid argument
libbpf: -- BEGIN DUMP LOG ---
libbpf:
Validating test_long_fname_2() func#1...
Arg#0 type PTR in test_long_fname_2() is not supported yet.
processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0
peak_states 0 mark_read 0
libbpf: -- END LOG --
libbpf: failed to load program 'dummy_tracepoint'
libbpf: failed to load object 'test_btf_nokv.o'
do_test_file:4201:FAIL bpf_object__load: -4007
[snip]
```
--
Best Regards.
Ma Xinjian
[View Less]
Hi Linus,
Please pull the following Kselftest update for Linux 5.7-rc3.
This kselftest update for Linux 5.7-rc3 consists of fixes to runner
scripts and individual test run-time bugs. Includes fixes to tpm2
and memfd test run-time regressions.
diff is attached.
thanks,
-- Shuah
----------------------------------------------------------------
The following changes since commit 8f3d9f354286745c751374f5f1fcafee6b3f3136:
Linux 5.7-rc1 (2020-04-12 12:35:55 -0700)
are available in the Git …
[View More]repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
tags/linux-kselftest-5.7-rc3
for you to fetch changes up to b87080eab4c1377706c113fc9c0157f19ea8fed1:
selftests/ipc: Fix test failure seen after initial test run
(2020-04-14 10:24:28 -0600)
----------------------------------------------------------------
linux-kselftest-5.7-rc3
This kselftest update for Linux 5.7-rc3 consists of fixes to runner
scripts and individual test run-time bugs. Includes fixes to tpm2
and memfd test run-time regressions.
----------------------------------------------------------------
Andrea Righi (1):
kselftest/runner: allow to properly deliver signals to tests
Colin Ian King (1):
selftests/harness: fix spelling mistake "SIGARLM" -> "SIGALRM"
Jarkko Sakkinen (1):
Revert "Kernel selftests: tpm2: check for tpm support"
Sandipan Das (2):
selftests: vm: Do not override definition of ARCH
selftests: vm: Fix 64-bit test builds for powerpc64le
Shuah Khan (1):
selftests: Fix memfd test run-time regression
Thadeu Lima de Souza Cascardo (1):
selftests/seccomp: allow clock_nanosleep instead of nanosleep
Tyler Hicks (1):
selftests/ipc: Fix test failure seen after initial test run
Xiao Yang (1):
selftests/ftrace: Add CONFIG_SAMPLE_FTRACE_DIRECT=m kconfig
tools/testing/selftests/ftrace/config | 1 +
tools/testing/selftests/ipc/msgque.c | 2 +-
tools/testing/selftests/kselftest/runner.sh | 2 +-
tools/testing/selftests/kselftest_harness.h | 6 +++---
tools/testing/selftests/memfd/Makefile | 3 ++-
tools/testing/selftests/seccomp/seccomp_bpf.c | 14 ++++++++------
tools/testing/selftests/tpm2/test_smoke.sh | 13 ++-----------
tools/testing/selftests/tpm2/test_space.sh | 9 +--------
tools/testing/selftests/vm/Makefile | 4 ++--
tools/testing/selftests/vm/run_vmtests | 2 +-
10 files changed, 22 insertions(+), 34 deletions(-)
----------------------------------------------------------------
[View Less]
In this workflow:
$ make ARCH=um defconfig && make ARCH=um -j8
[snip]
$ make ARCH=um mrproper
[snip]
$ make ARCH=um defconfig O=./build_um && make ARCH=um -j8 O=./build_um
[snip]
CC scripts/mod/empty.o
In file included from ../include/linux/types.h:6,
from ../include/linux/mod_devicetable.h:12,
from ../scripts/mod/devicetable-offsets.c:3:
../include/uapi/linux/types.h:5:10: fatal error: asm/types.h: No such file or directory
5 |…
[View More] #include <asm/types.h>
| ^~~~~~~~~~~~~
compilation terminated.
make[2]: *** [../scripts/Makefile.build:100: scripts/mod/devicetable-offsets.s] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/home/iha/sdb/opensource/lkmp/linux-kselftest.git/Makefile:1140: prepare0] Error 2
make[1]: Leaving directory '/home/iha/sdb/opensource/lkmp/linux-kselftest.git/build_um'
make: *** [Makefile:180: sub-make] Error 2
The cause of the error was because arch/$(SUBARCH)/include/generated files
weren't properly cleaned by `make ARCH=um mrproper`.
Fixes: a788b2ed81ab ("kbuild: check arch/$(SRCARCH)/include/generated
before out-of-tree build").
Reported-by: Theodore Ts'o <tytso(a)mit.edu>
Signed-off-by: Vitor Massaru Iha <vitor(a)massaru.org>
Reviewed-by: Brendan Higgins <brendanhiggins(a)google.com>
Tested-by: Brendan Higgins <brendanhiggins(a)google.com>
Suggested-by: Masahiro Yamada <masahiroy(a)kernel.org>
Link: https://groups.google.com/forum/#!msg/kunit-dev/QmA27YEgEgI/hvS1kiz2CwAJ
---
v2:
* Explains what this PATCH does and the importance as suggested
by Brendan Higgins.
v3:
* This problem only affects ARCH=um builds then arch/um/Makefile has
been changed as suggested by Masahiro Yamada;
* And with that the description has also been changed, and also to explain
missing points and correct the tags as suggested by Masahiro Yamada:
- Fix missing command `make ARCH=um mrproper`;
- Add build error message;
- Add "Fixes" tag instead of "This bug was ...";
- Add "Link" tag instead of "Related bug ...";
- Add Reported-by and Suggested-by;
---
arch/um/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/um/Makefile b/arch/um/Makefile
index d2daa206872d..275f5ffdf6f0 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -140,6 +140,7 @@ export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE)
# When cleaning we don't include .config, so we don't include
# TT or skas makefiles and don't clean skas_ptregs.h.
CLEAN_FILES += linux x.i gmon.out
+MRPROPER_DIRS += arch/$(SUBARCH)/include/generated
archclean:
@find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \
--
2.25.1
[View Less]