Bug #1945: assertion failed: store_swapin.cc:47: "e->mem_status == NOT_IN_MEMORY"
There seems to be a race condition which may leave small objects (<4KB) in an
inconsistent internal state where Squid thinks the object is kept in memory
but part of it has been freed..
This patch closes this race condition.
/*
- * $Id: store.cc,v 1.617 2007/08/27 12:50:43 hno Exp $
+ * $Id: store.cc,v 1.618 2007/08/30 19:26:10 hno Exp $
*
* DEBUG: section 20 Storage Manager
* AUTHOR: Harvest Derived
void
StoreEntry::trimMemory()
{
+ /*
+ * DPW 2007-05-09
+ * Bug #1943. We must not let go any data for IN_MEMORY
+ * objects. We have to wait until the mem_status changes.
+ */
+ if (mem_status == IN_MEMORY)
+ return;
+
if (mem_obj->policyLowestOffsetToKeep() == 0)
/* Nothing to do */
return;
- assert (mem_obj->policyLowestOffsetToKeep() > 0);
-
if (!swapOutAble()) {
/*
* Its not swap-able, and we're about to delete a chunk,