From 22278eb8234fcd7606e1844196cac446603aaf62 Mon Sep 17 00:00:00 2001 From: yang yuan Date: Wed, 8 Sep 2021 17:52:33 +0800 Subject: [PATCH] fix 'sanity check failed' error --- proc_master.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/proc_master.go b/proc_master.go index 2fd1451..bb5cb87 100644 --- a/proc_master.go +++ b/proc_master.go @@ -15,6 +15,7 @@ import ( "path/filepath" "runtime" "strconv" + "strings" "sync" "syscall" "time" @@ -282,13 +283,17 @@ func (mp *master) fetch() { } } }() + tokenOut, err := cmd.CombinedOutput() returned = true if err != nil { mp.warnf("failed to run temp binary: %s (%s) output \"%s\"", err, tmpBinPath, tokenOut) return } - if tokenIn != string(tokenOut) { + tokenOutStr := string(tokenOut) + tokenOutStrs := strings.Split(tokenOutStr, "\n") + tokenOutNew := tokenOutStrs[len(tokenOutStrs)-1] + if tokenIn != tokenOutNew { mp.warnf("sanity check failed") return }