fix(perf): purge inherited mappings on execve to fix unknown symbols#392
Conversation
Merging this PR will not alter performance
|
Greptile SummaryThis PR fixes incorrect symbolication when a child process (e.g. a benchmark forked from
Confidence Score: 5/5Safe to merge; the change is narrowly scoped to purging stale per-PID mappings on execve and cannot affect PIDs that don't exec. The fix correctly intercepts COMM records with is_execve, gates the purge behind pid_filter.should_include so only tracked processes are affected, and relies on the chronological ordering already required by the rest of the parsing loop. The new unit test covers the exact collision scenario and verifies isolation between PIDs. No correctness issues found. No files require special attention. Important Files Changed
|
9bf1fdd to
791f1d8
Compare
A child forked from a parent (e.g. bash) inherits the parent's memory mappings. When it then execve's its own binary, the inherited PIE mappings remain and can collide with the new binary's mappings at the same base address, leading to wrong symbolication and unknown symbols. Handle COMM records flagged as execve and purge the exec'ing process's inherited mappings so only its post-exec mappings are used. Refs COD-2779
791f1d8 to
a54f0af
Compare
Purge a process's inherited memory mappings when it execve's a new binary, so wall-time symbolication doesn't resolve frames against the wrong module.
A child forked from a parent (e.g. bash) inherits the parent's memory
mappings. When it then execve's its own binary, the inherited PIE
mappings remain and can collide with the new binary's mappings at the
same base address, leading to wrong symbolication and unknown symbols.
Handle COMM records flagged as execve and purge the exec'ing process's
inherited mappings so only its post-exec mappings are used.
Timing-aware module mapping would be a more general fix but is larger in scope; tracked separately in COD-1377.
Refs COD-2779