fix(valgrind): use %p in log file path to avoid multi-process overwrite#381
fix(valgrind): use %p in log file path to avoid multi-process overwrite#381not-matthias wants to merge 3 commits into
Conversation
With --trace-children=yes, every process wrote to the same valgrind.log, so the last writer won. Use the %p (PID) placeholder so each process gets its own log file, matching the existing %p.out / %p.tgtrace out-files.
Merging this PR will not alter performance
|
Greptile SummaryThis PR fixes a log-overwrite race condition when valgrind is run with
Confidence Score: 5/5Safe to merge — the change is minimal and well-scoped, replacing a single hardcoded log path with a %p-keyed one and adding a matching directory scan on the failure path. The fix directly mirrors the existing %p.out / %p.tgtrace patterns already used for callgrind and tracegrind output files, so the approach is proven and consistent. The failure-path glob correctly constrains matches to valgrind.*.log and silently skips unreadable entries, which is appropriate for a diagnostic-only code path. No logic paths are broken or removed. No files require special attention. Important Files Changed
|
What?
With
--trace-children=yes, every (forked) process wrote to the samevalgrind.logfile, so the last writer won and earlier processes' logs were lost.This uses the
%p(PID) placeholder in--log-fileso each process gets its ownvalgrind.<pid>.log, matching the existing%p.out(callgrind) and%p.tgtrace(tracegrind) out-file patterns.Also drops the failure-path read of the now-nonexistent hardcoded
valgrind.log.Closes COD-2747