Skip to content

Commit

Permalink
pkg/proc/internal/ebpf: Fix uprobe address (go-delve#3894)
Browse files Browse the repository at this point in the history
The update of gilium/ebpf introduced a beaking change in it's API: The `offset` in the UprobeOptions is now relative to the added option `address`. Since `address` was only default initalized, the library did not use `address` and `offset` as address for the uprobe, but tried to calculate the offset itself based on the given symbol. Since we set the path of the executable as symbol, the library errored when trying to resolve it.

Fixes go-delve#3491
  • Loading branch information
3u13r authored Jan 3, 2025
1 parent 37422e6 commit 1dc394c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/proc/internal/ebpf/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (ctx *EBPFContext) AttachUprobe(pid int, name string, offset uint64) error
if ctx.executable == nil {
return errors.New("no eBPF program loaded")
}
l, err := ctx.executable.Uprobe(name, ctx.objs.tracePrograms.UprobeDlvTrace, &link.UprobeOptions{PID: pid, Offset: offset})
l, err := ctx.executable.Uprobe(name, ctx.objs.tracePrograms.UprobeDlvTrace, &link.UprobeOptions{PID: pid, Address: offset})
ctx.links = append(ctx.links, l)
return err
}
Expand Down

0 comments on commit 1dc394c

Please sign in to comment.