Skip to content

fix: race condition on TrackProcesses called before probes are loaded#49

Merged
RonFed merged 1 commit into
mainfrom
fix_trackPIDs_race
Apr 23, 2026
Merged

fix: race condition on TrackProcesses called before probes are loaded#49
RonFed merged 1 commit into
mainfrom
fix_trackPIDs_race

Conversation

@RonFed

@RonFed RonFed commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator

The detector's TrackProcesses function can be called before the eBPF probes are fully loaded.
This caused a panic in

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x4f65f8]

goroutine 73 [running]:
github.com/odigos-io/runtime-detector/internal/probe.(*Probe).TrackPIDs(0x786408335ba8?, {0x786408676b60, 0x2, 0x786408676b60?})
	/go/pkg/mod/github.com/odigos-io/runtime-detector@v0.0.24/internal/probe/probe.go:413 +0x28
github.com/odigos-io/runtime-detector.(*Detector).TrackProcesses(0x7864082625e8?, {0x786408676b60?, 0x2b10d48?, 0x7864078bd900?})
	/go/pkg/mod/github.com/odigos-io/runtime-detector@v0.0.24/detector.go:364 +0x28

This PR adds support for this case by checking if the probes are loaded or not, and if they are not - save the tracked processes passed by the called in a pending slice - which will be added to the eBPF maps once the probes are loaded.

CORE-930

@RonFed RonFed merged commit 39d199f into main Apr 23, 2026
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants