Skip to content

Commit

Permalink
Fixes panic on Go instrumentation
Browse files Browse the repository at this point in the history
On ELF parse error, we return the list of missing fields, assuming that
we would stop the instrumentation. There is an edge case error on which
the missing fields set is empty so Beyla keeps with the instrumentation,
but the returned list of fields is nil.
  • Loading branch information
mariomac authored and rafaelroquetto committed Dec 20, 2024
1 parent b268205 commit 915de07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/internal/goexec/structmembers.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ func structMemberOffsetsFromDwarf(data *dwarf.Data) (FieldOffsets, map[GoOffset]
log.Debug("inspecting fields for struct type", "type", typeName)
if err := readMembers(reader, structMember.fields, expectedReturns, fieldOffsets); err != nil {
log.Debug("error reading DWARF info", "type", typeName, "error", err)
return nil, expectedReturns
return fieldOffsets, expectedReturns
}
}
}
Expand Down

0 comments on commit 915de07

Please sign in to comment.