From: Alex Rousskov Date: Wed, 13 Apr 2016 22:36:12 +0000 (-0600) Subject: Bug 4493: theObject->sharedMemorySize() == theSegment.size() exception X-Git-Tag: SQUID_4_0_9~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5b92ba077dce4c0c2919ebe668e5e415f2e728c2;p=thirdparty%2Fsquid.git Bug 4493: theObject->sharedMemorySize() == theSegment.size() exception We should not expect the exact match because, as discovered during bug 3805 (r13947) fix, shared Segment::size() may exceed the originally requested RAM amount due to stat() page rounding done by OSes like OS X. Unfortunately, this rounding weakens the failed consistency check a lot. TODO: Store the exact requested size and check against that as well. --- diff --git a/src/ipc/mem/Pointer.h b/src/ipc/mem/Pointer.h index da183b158b..ec0fe149fb 100644 --- a/src/ipc/mem/Pointer.h +++ b/src/ipc/mem/Pointer.h @@ -165,7 +165,7 @@ Object::Object(const char *const id): theSegment(id) theSegment.open(); Must(theSegment.mem()); theObject = reinterpret_cast(theSegment.mem()); - Must(static_cast(theObject->sharedMemorySize()) == theSegment.size()); + Must(static_cast(theObject->sharedMemorySize()) <= theSegment.size()); } template