Skip to content

branch-4.1:[fix](filecache) BlockFileCache use-after-free caused by destructor order (#61192)#62237

Merged
yiguolei merged 1 commit intoapache:branch-4.1from
freemandealer:pick-branch-4.1-pr-61192-20260408-193114
Apr 9, 2026
Merged

branch-4.1:[fix](filecache) BlockFileCache use-after-free caused by destructor order (#61192)#62237
yiguolei merged 1 commit intoapache:branch-4.1from
freemandealer:pick-branch-4.1-pr-61192-20260408-193114

Conversation

@freemandealer
Copy link
Copy Markdown
Contributor

Backport of #61192 to branch-4.1.

Original PR: #61192

No compile/test run for this pick.

…rder

- In BlockFileCache::initialize_unlocked(): _storage->init(this) is executed first, then _ttl_mgr is created via raw pointer from fs_storage->get_meta_store()
- Member variables order: _ttl_mgr (front), _storage (back)
- C++ reverse destructor order leads to _storage being destructed before _ttl_mgr
- Risk: *_ttl_mgr threads may access already-destructed _storage/_meta_store

Signed-off-by: zhengyu <zhangzhengyu@selectdb.com>
(cherry picked from commit 51120ba)
@freemandealer freemandealer requested a review from yiguolei as a code owner April 8, 2026 11:33
@hello-stephen
Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@freemandealer
Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen
Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 97.75% (87/89) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 53.01% (19848/37444)
Line Coverage 36.51% (186751/511449)
Region Coverage 32.83% (144894/441401)
Branch Coverage 33.97% (63539/187053)

@hello-stephen
Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 97.75% (87/89) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.11% (26797/36652)
Line Coverage 56.60% (288540/509752)
Region Coverage 54.04% (240671/445365)
Branch Coverage 55.69% (104465/187583)

@yiguolei
Copy link
Copy Markdown
Contributor

yiguolei commented Apr 9, 2026

skip buildall

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

PR approved by at least one committer and no changes requested.

@github-actions github-actions Bot added approved Indicates a PR has been approved by one committer. reviewed labels Apr 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

PR approved by anyone and no changes requested.

@yiguolei yiguolei merged commit a2b1bb6 into apache:branch-4.1 Apr 9, 2026
28 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants