Repository navigation
Fix possible crash due to ThreadGroup use-after-free (for async INSERTs/MVs/EXPLAIN ANALYZE) - #114940
Conversation
Co-Authored-By: Mikhail Filimonov <[email protected]>
v2: Update test for enqueue-time `ThreadGroup` capture v3: Add tests for borrowed ThreadGroup lifetime and enqueue-time group capture Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Co-Authored-By: Mikhail Filimonov <[email protected]>
…Ts/MVs/EXPLAIN ANALYZE) Co-Authored-By: Mikhail Filimonov <[email protected]>
|
Workflow [PR], commit [9a7db21] Summary: ❌
AI ReviewSummaryThis PR fixes borrowed Final Verdict✅ No findings. The patch looks ready from a code-review standpoint. LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 102/103 (99.03%) · Uncovered code |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units290 translation units recompiled, 2959 s compile time in total, 290 of them have a recent master baseline. Median compile-time ratio to the baselines is ×1.08 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio. |
|
Found it today also. Thanks that you fix it. That was dangerous code which worked untill it did not. |
3afb5f7
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix possible crash due to ThreadGroup use-after-free (for async INSERTs/MVs/EXPLAIN ANALYZE)
@filimonov "Borrowed ThreadGroup objects used by materialized view and async insert flush paths point their performance_counters and memory_tracker to the parent query group, so they are valid only while that parent group is alive. Async callbacks could capture such a borrowed group and later attach it on a pool thread after the parent query group had finished."
Eventually we have to store parent's
ThreadGroupPtrto account things properly, initial fix #108988 tries to avoid this, but this breaks propagating counters to queriesThanks to @filimonov for original fix #108988
This supersedes #109891 it became too complex
Version info
26.8.1.1471(included in26.8and later)