Fix use-after-free in recursive file search #1139
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.35) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.35 · 172 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.308
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #1139"
general
weight: 0.35
tsujan
Fixes #1115.
_fm_vfs_search_enumerator_next_file()kept a matched directory in astatic GFileInfo *recur_dir_matchafter returning it to the caller, without holding a reference, and read it again on the next call to recurse into it.PathEditJob) caused a use-after-free → crash ing_file_info_get_name.search:///whileDirListJobruns the same search) consumed or reset each other's pointer.DirListJobcould then receive an already freedGFileInfo→ crash ing_file_info_get_icon/FileInfo::setFromGFileInfo.Changes
FmVfsSearchEnumeratorand holds its own reference.g_clear_object()inclose()anddispose().Testing
I used a standalone ASan program built from
vfs-search.c(details in #1115) that enumerates a recursivesearch://URI where directories match, unrefs each info at once, and also runs two searches in parallel threads:g_file_info_get_nameon the first runfind), 20 parallel rounds with no ASan reports#1116 is complementary and still useful.