From 647e704fedfc4148061124b35710eba563130079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Thu, 16 Jan 2020 16:02:04 +0100 Subject: [PATCH] Highlight error and add a hint to ptrace_scope One reason why the call to gdb might fail is that /proc/sys/kernel/yama/ptrace_scope is set to 1. We now give an corresponding hint when gdb fails. --- GetRuntimeAddresses/symbolyze/gdb_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GetRuntimeAddresses/symbolyze/gdb_test.go b/GetRuntimeAddresses/symbolyze/gdb_test.go index 3c1f543..2724f4d 100644 --- a/GetRuntimeAddresses/symbolyze/gdb_test.go +++ b/GetRuntimeAddresses/symbolyze/gdb_test.go @@ -115,5 +115,6 @@ func extractOffsetWithGdb(pid int, t *testing.T) (offset uint64, err error) { } } - return 0, fmt.Errorf("Symbol not found with gdb") + return 0, fmt.Errorf("Symbol not found with gdb.\n" + + "Maybe /proc/sys/kernel/yama/ptrace_scope must be set to 0? Or try to run the test as root!") }