Skip to content

[Backport][main to 0.9] | Fix nullptr crash in eviction when cache directory is externally deleted (#1498) - #1504

Merged
lihuiba merged 1 commit into
release/0.9from
backport-pr-3b388a17cfe0aa774725915e2307f55a73edcec6-0.9
Jun 26, 2026
Merged

[Backport][main to 0.9] | Fix nullptr crash in eviction when cache directory is externally deleted (#1498)#1504
lihuiba merged 1 commit into
release/0.9from
backport-pr-3b388a17cfe0aa774725915e2307f55a73edcec6-0.9

Conversation

@photonlibos

Copy link
Copy Markdown
Collaborator

Fix nullptr crash in eviction when cache directory is externally deleted (#1498)

  • Fix nullptr crash in eviction when cache directory is externally deleted

When the cache directory is deleted while the cache pool is running,
open() returns nullptr during eviction. The code dereferences it without
a null check, causing a SIGSEGV. Add null checks in both evict(filename)
and the timer-driven eviction loop.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

  • Fix same nullptr crash in QuotaFilePool eviction paths

Apply the same null check for open() return value in
QuotaFilePool::evict() and QuotaFilePool::dirEviction(),
which have the identical bug as FileCachePool.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com


Co-authored-by: Claude Opus 4.6 noreply@anthropic.com
Generated by Backport Auto PR, by cherry-pick related commits.

Please review and decide whether to merge or close this backport PR.

…ted (#1498)

* Fix nullptr crash in eviction when cache directory is externally deleted

When the cache directory is deleted while the cache pool is running,
open() returns nullptr during eviction. The code dereferences it without
a null check, causing a SIGSEGV. Add null checks in both evict(filename)
and the timer-driven eviction loop.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix same nullptr crash in QuotaFilePool eviction paths

Apply the same null check for open() return value in
QuotaFilePool::evict() and QuotaFilePool::dirEviction(),
which have the identical bug as FileCachePool.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@photonlibos photonlibos added the bugfix A PR that should be back-ported to prior release branches (release/*) label Jun 25, 2026
@lihuiba
lihuiba merged commit 5860bb8 into release/0.9 Jun 26, 2026
19 of 25 checks passed
@photonlibos
photonlibos deleted the backport-pr-3b388a17cfe0aa774725915e2307f55a73edcec6-0.9 branch June 26, 2026 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix A PR that should be back-ported to prior release branches (release/*)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants