]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 5008: SIGBUS in PagePool::level() with custom rock slot size (#515)
authorjijiwawa <33614409+jijiwawa@users.noreply.github.com>
Sat, 23 Nov 2019 10:24:41 +0000 (10:24 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sat, 23 Nov 2019 12:41:15 +0000 (12:41 +0000)
commit2a10e977ad4723b0b088dd6111732a1bea03245d
tree1ebd73ccf26f0b3d4a5ca611a1e9d3a8d1391123
parent84011c4813ca9949f949ecd90524fc468b5c1683
Bug 5008: SIGBUS in PagePool::level() with custom rock slot size (#515)

SMP Squids were crashing on arm64 due to incorrect memory alignment of
Ipc::Mem::PagePool::theLevels array. The relative position of the array
depends on the number of workers and the number of pages (influenced by
the cache capacity and slot size), so some configurations worked OK.

We have to manually align manually positioned fields inside shared
memory segments. Thankfully, C++11 provides alignment-computing APIs.
src/ipc/mem/PagePool.cc
src/ipc/mem/PagePool.h
src/ipc/mem/PageStack.cc
src/ipc/mem/PageStack.h