From b16e12fde736f7cad60cfe4d029ba9595ca8de0c Mon Sep 17 00:00:00 2001 From: Alessandro Arzilli Date: Wed, 6 Nov 2024 19:27:44 +0100 Subject: [PATCH] proc: do not ignore error return of funcCallEvalFuncExpr (#3850) This is probably the cause of the panic such as in issue #3848 and other similar issues, it is hard to be sure because we never get a proper reproducer but judging from the stack traces it should be this. Also it doesn't affect versions of Go that have the debug pinner. Fixes #3848 --- pkg/proc/fncall.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/proc/fncall.go b/pkg/proc/fncall.go index 02d4803f..5e925bb6 100644 --- a/pkg/proc/fncall.go +++ b/pkg/proc/fncall.go @@ -981,7 +981,10 @@ func callInjectionComplete2(callScope *EvalScope, bi *BinaryInfo, fncall *functi func (scope *EvalScope) evalCallInjectionSetTarget(op *evalop.CallInjectionSetTarget, stack *evalStack, thread Thread) { fncall := stack.fncallPeek() if !fncall.hasDebugPinner && (fncall.fn == nil || fncall.receiver != nil || fncall.closureAddr != 0) { - funcCallEvalFuncExpr(scope, stack, fncall) + stack.err = funcCallEvalFuncExpr(scope, stack, fncall) + if stack.err != nil { + return + } } stack.pop() // target function, consumed by funcCallEvalFuncExpr either above or in evalop.CallInjectionStart