]> 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)
committerSquid Anubis <squid-anubis@squid-cache.org>
Tue, 14 Nov 2023 18:40:50 +0000 (18:40 +0000)
commit6e73b4aa44b438d8fd2b0910dbb73f2da7bb105b
tree1c850ab190253bec8e6245881d5f3e163e273022
parent3728709bf085e1d94253fb5953c023d14941c243
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