]> git.ipfire.org Git - thirdparty/squid.git/commit - include/splay.h
Avoid "FATAL: Squid has attempted to read data from memory that is not present"
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 19 Mar 2014 04:04:52 +0000 (22:04 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Wed, 19 Mar 2014 04:04:52 +0000 (22:04 -0600)
commit97754f5abcae0b186d4a9f92bb7fd388e76ef8a5
tree2dd9ed7031bf48fe5e2acbe34ef6d96a72ee1b23
parent24fe24be38427ccba2471cea3d1e7813eeb48e08
Avoid "FATAL: Squid has attempted to read data from memory that is not present"
crashes. Improve related code.

Shared memory caching code was not checking whether the response is generally
cachable and, hence, tried to store responses that Squid already refused to
cache (e.g., release-requested entries). The shared memory cache should also
check that the response is contiguous because the disk store may not check
that (e.g., when disk caching id disabled).

The problem was exacerbated by the broken entry dump code accompanying the
FATAL message. The Splay tree iterator is evidently not iterating a portion of
the tree. I added a visitor pattern code to work around that, but did not try
to fix the Splay iterator iterator itself because, in part, the whole iterator
design felt inappropriate (storing and flattening the tree before iterating
it?) for its intended purpose. I could not check quickly enough where the
broken iterator is used besides mem_hdr::debugDump() so more bugs like this
are possible.

Optimized StoreEntry::checkCachable() a little and removed wrong TODO comment:
Disk-only mayStartSwapOut() should not accumulate "general" cachability checks
which are used by RAM caches as well.

Added more mem_hdr debugging and polished method descriptions.

Fixed NullStoreEntry::mayStartSwapout() spelling/case. It should override
StoreEntry::mayStartSwapOut().
include/splay.h
src/MemStore.cc
src/MemStore.h
src/Store.h
src/SwapDir.h
src/stmem.cc
src/store.cc
src/store_dir.cc
src/tests/stub_store.cc