Skip to content

Commit

Permalink
Add better logic for handling stack trace parsing errors (#33786)
Browse files Browse the repository at this point in the history
Signed-off-by: grantseltzer <[email protected]>
  • Loading branch information
grantseltzer authored Feb 7, 2025
1 parent fa33a49 commit ba9f4f1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/dynamicinstrumentation/uploader/stack_trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ func parseStackTrace(procInfo *ditypes.ProcessInfo, rawProgramCounters []uint64)
}

funcInfo, err := pcToLine(procInfo, rawProgramCounters[i])
if err != nil {
return stackTrace, fmt.Errorf("could not resolve pc to function info: %w", err)
if err != nil && len(stackTrace) == 0 {
return stackTrace, fmt.Errorf("no stack trace: %w", err)
} else if err != nil {
return stackTrace, nil
}
stackFrame := ditypes.StackFrame{Function: funcInfo.fn, FileName: funcInfo.file, Line: int(funcInfo.line)}
stackTrace = append(stackTrace, stackFrame)
Expand Down

0 comments on commit ba9f4f1

Please sign in to comment.