Repository navigation
Preserve fetch error text; synchronize the VFS last-error string - #19
Merged
Merged
Conversation
F4: Read1Page called job->Renew() - which clears job->errmsg - before throwing an exception built from job->errmsg, so read failures reached callers with an empty message. Capture the message before Renew(). C5: the VFS object's last_error_ std::string was written by Open and FullPathname from any thread with no synchronization (ThreadSanitizer caught write-vs-write through the string internals during a concurrent failed-open storm). Guard all accesses with a mutex via a SetLastError() helper; GetLastError() copies under the lock. No error text or result codes change. Verified: TSan A/B on the concurrency stress drivers (C5 traces gone, reads byte-exact); full Catch2 suite passes (36,338 assertions).
Wid-L-Hacker
added a commit
to Wid-L-Hacker/sqlite_zstd_vfs
that referenced
this pull request
Oct 25, 2026
mlin
pushed a commit
that referenced
this pull request
Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
F4: Read1Page called job->Renew(), which clears job->errmsg, before constructing an exception from job->errmsg. The exception reaching Read() therefore had an empty message. Capture the message before Renew().
C5: Open and FullPathname wrote the shared last_error_ string without synchronization; GetLastError read it unlocked. ThreadSanitizer caught concurrent writes during failed opens. Route writes through SetLastError(), copy under the mutex in GetLastError(), and log local strings. Existing error strings and explicit return codes are unchanged.
Verified: C5 reports disappeared in TSan A/B stress runs; successful reads matched expected data byte for byte. Full Catch2 suite: 36,338 assertions passed.