]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 5317: FATAL attempt to read data from memory (#1579)
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 14 Nov 2023 18:40:37 +0000 (18:40 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Tue, 28 Nov 2023 01:03:38 +0000 (14:03 +1300)
commit6c29ec591b1c777fc9a66f810f0ce5bc5076bc40
treea96704e89fe1526d2063c690a5aae2f59aab3f9e
parent7e8eec79880cc207ba61b662eb8b93081101b62c
Bug 5317: FATAL attempt to read data from memory (#1579)

    FATAL: Squid has attempted to read data ... that is not present.

Recent commit 122a6e3 attempted to deliver in-memory response body bytes
to a Store-reading client that requested (at least) response headers.
That optimization relied on the old canReadFromMemory() logic, but that
logic results in false positives when the checked read offset falls into
a gap between stored headers and the first body byte of a Content-Range.
In that case, a false positive leads to a readFromMemory() call and a
FATAL mem_hdr::copy() error.

This workaround disables the above optimization without fixing
canReadFromMemory(). We believe that a readFromMemory() call that comes
right after response headers are delivered to the Store-reading client
will not suffer from the same problem because the client will supply the
read offset of the first body byte, eliminating the false positive.
src/store_client.cc