From a353ff5493dc9df2c887df91d7cfe985fa52299e Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 26 May 2021 09:51:04 +0200 Subject: pkg/host: better error message for missing syscalls --- pkg/host/syscalls_linux.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pkg/host') diff --git a/pkg/host/syscalls_linux.go b/pkg/host/syscalls_linux.go index a13af0caa..90b57a94e 100644 --- a/pkg/host/syscalls_linux.go +++ b/pkg/host/syscalls_linux.go @@ -104,7 +104,7 @@ func isSupportedKallsyms(c *prog.Syscall) (bool, string) { name = newname } if !kallsymsSyscallSet[name] { - return false, fmt.Sprintf("sys_%v is not present in /proc/kallsyms", name) + return false, fmt.Sprintf("sys_%v is not enabled in the kernel (not present in /proc/kallsyms)", name) } return true, "" } @@ -115,17 +115,18 @@ func isSupportedTrial(c *prog.Syscall) (bool, string) { case "exit", "pause": return true, "" } + reason := fmt.Sprintf("sys_%v is not enabled in the kernel (returns ENOSYS)", c.CallName) trialMu.Lock() defer trialMu.Unlock() if res, ok := trialSupported[c.NR]; ok { - return res, "ENOSYS" + return res, reason } cmd := osutil.Command(os.Args[0]) cmd.Env = []string{fmt.Sprintf("SYZ_TRIAL_TEST=%v", c.NR)} _, err := osutil.Run(10*time.Second, cmd) res := err != nil trialSupported[c.NR] = res - return res, "ENOSYS" + return res, reason } func init() { -- cgit mrf-deployment