Skip to content

Commit 708603a

Browse files
committed
fix(pipeline): release the package map the closure probe builds
closure_probe_surfaces runs cbm_parallel_extract to compute the changed files' fresh surfaces, and parallel extraction builds the process-global package map as a side effect. Both real extraction paths release it at an explicit ownership boundary; the probe borrowed the machinery without inheriting that contract, leaking one map per probed run. Found by the macOS leak lane added earlier in this branch -- the lane catching a defect introduced after it, which is the point of having it. Verified: the incremental suite is clean under LSan with the fix, and the same allocation site (cbm_pkgmap_build via merge_pkg_entries) no longer appears. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent a33a82f commit 708603a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/pipeline/pipeline_incremental.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,6 +1590,11 @@ static int closure_probe_surfaces(cbm_pipeline_t *p, const char *project,
15901590
if (cache) {
15911591
free_incremental_result_cache(cache, probe_count);
15921592
}
1593+
/* Parallel extraction builds the process-global package map; the probe
1594+
* owns it exactly as the real extraction paths do. Leaving it behind
1595+
* leaked one map per probed run (LSan, macOS CI). */
1596+
cbm_pkgmap_free(cbm_pipeline_get_pkgmap());
1597+
cbm_pipeline_set_pkgmap(NULL);
15931598
cbm_path_alias_collection_free(aliases);
15941599
cbm_gbuf_free(probe_gbuf);
15951600
return rc;

0 commit comments

Comments
 (0)