[PATCH 4/5] tests default_vmlinux_btf: Cover the no args segfault too

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

  root@x1:/home/acme/git/pahole# pahole --running_kernel_vmlinux
  pahole: couldn't find a vmlinux that matches the running kernel
  HINT: Maybe you're inside a container or missing a debuginfo package?
  root@x1:/home/acme/git/pahole# tests/default_vmlinux_btf.sh
  Default BTF on a system without BTF: FAILED
  root@x1:/home/acme/git/pahole# pahole
  Segmentation fault (core dumped)
  root@x1:/home/acme/git/pahole#

Now to fix this one as well.

Reported-by: Matthias Schwarzott <zzam@xxxxxxxxxx>
Cc: Alan Maguire <alan.maguire@xxxxxxxxxx>
Cc: Andrii Nakryiko <andrii@xxxxxxxxxx>
Cc: Eduard Zingerman <eddyz87@xxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Song Liu <song@xxxxxxxxxx>
Cc: Yonghong Song <yonghong.song@xxxxxxxxx>
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
 tests/default_vmlinux_btf.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tests/default_vmlinux_btf.sh b/tests/default_vmlinux_btf.sh
index a9effa2d6d37e0ee..a855ca7587380934 100755
--- a/tests/default_vmlinux_btf.sh
+++ b/tests/default_vmlinux_btf.sh
@@ -17,5 +17,16 @@ if [ $nr_lines -eq 0 ] ; then
 	exit 1
 fi
 
+# There is also the case where no debugging info is available, be it DWARF of
+# BTF and it segfaults when calling just 'pahole', with no args, so check for
+# that as well
+#
+nr_lines=$(PAHOLE_VMLINUX_BTF_FILENAME=foobar pahole 2>&1 | wc -l)
+
+if [ $nr_lines -eq 0 ] ; then
+	echo "FAILED"
+	exit 1
+fi
+
 echo "Ok"
 exit 0
-- 
2.47.0





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux