From: robertc <> Date: Mon, 20 Oct 2003 09:57:25 +0000 (+0000) Subject: make the error message on incorrect memory reads more useful X-Git-Tag: SQUID_3_0_PRE4~1183 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=17d97ab38fcac3bb6d5261db7da1ae93890627e1;p=thirdparty%2Fsquid.git make the error message on incorrect memory reads more useful --- diff --git a/src/stmem.cc b/src/stmem.cc index be16f6e933..63199d761e 100644 --- a/src/stmem.cc +++ b/src/stmem.cc @@ -1,6 +1,6 @@ /* - * $Id: stmem.cc,v 1.83 2003/09/29 10:24:01 robertc Exp $ + * $Id: stmem.cc,v 1.84 2003/10/20 03:57:25 robertc Exp $ * * DEBUG: section 19 Store Memory Primitives * AUTHOR: Harvest Derived @@ -202,6 +202,7 @@ mem_hdr::copyAvailable(mem_node *aNode, size_t location, size_t amount, char *ta void mem_hdr::debugDump() const { + debugs (19, 1, "mem_hdr::debugDump: lowest offset: " << lowestOffset() << " highest offset + 1: " << endOffset() << "."); std::ostringstream result; PointerPrinter foo(result, " - "); for_each (getNodes().begin(), getNodes().end(), foo); @@ -240,8 +241,7 @@ mem_hdr::copy(off_t offset, char *buf, size_t size) const debugs(19, 1, "memCopy: could not find offset " << offset << " in memory."); debugDump(); - /* we shouldn't ever ask for absent offsets */ - assert (0); + fatal("Squid has attempted to read data from memory that is not present. This is an indication of of (pre-3.0) code that hasn't been updated to deal with sparse objects in memory. Squid should coredump.allowing to review the cause. Immediately preceeding this message is a dump of the available data in the format [start,end). The [ means from the value, the ) means up to the value. I.e. [1,5) means that there are 4 bytes of data, at offsets 1,2,3,4.\n"); return 0; }