From: robertc <> Date: Sat, 2 Sep 2006 04:19:35 +0000 (+0000) Subject: Address bug 951 by changing the assert to a debug statement. This may cause X-Git-Tag: SQUID_3_0_PRE5~163 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2a2d937f49648104a14753bb9ea97eff2a3cd4bb;p=thirdparty%2Fsquid.git Address bug 951 by changing the assert to a debug statement. This may cause memory leaks but will no longer take squid down presumptively. We still not have the right information to reproduce it, but it should at worst leak memory. --- diff --git a/src/ESIInclude.cc b/src/ESIInclude.cc index 56f2a0b664..380fc22c28 100644 --- a/src/ESIInclude.cc +++ b/src/ESIInclude.cc @@ -1,6 +1,6 @@ /* - * $Id: ESIInclude.cc,v 1.9 2006/05/05 23:57:40 wessels Exp $ + * $Id: ESIInclude.cc,v 1.10 2006/09/01 22:19:35 robertc Exp $ * * DEBUG: section 86 ESI processing * AUTHOR: Robert Collins @@ -534,7 +534,32 @@ ESIInclude::subRequestDone (ESIStreamContext::Pointer stream, bool success) if (flags.finished || flags.failed) { /* Kick ESI Processor */ - debug (86,5)("ESIInclude %p SubRequest %p completed, kicking processor , status %s\n", this, stream.getRaw(), flags.finished ? "OK" : "FAILED"); + debugs (86, 5, "ESIInclude " << this << + " SubRequest " << stream.getRaw() << + " completed, kicking processor , status " << + (flags.finished ? "OK" : "FAILED")); + /* There is a race condition - and we have no reproducible test case - + * during a subrequest the parent will get set to NULL, which is not + * meant to be possible. Rather than killing squid, we let it leak + * memory but complain in the log. + * + * Someone wanting to debug this could well start by running squid with + * a hardware breakpoint set to this location. + * Its probably due to parent being set to null - by a call to + * 'this.finish' while the subrequest is still not completed. + */ + if (parent.getRaw() == NULL) { + debugs (86, 0, "ESIInclude::subRequestDone: Sub request completed " + "after finish() called and parent unlinked. Unable to " + "continue handling the request, and may be memory leaking. " + "See http://www.squid-cache.org/bugs/show_bug.cgi?id=951 - we " + "are looking for a reproducible test case. This will require " + "an ESI template with includes, probably with alt-options, " + "and we're likely to need traffic dumps to allow us to " + "reconstruct the exact tcp handling sequences to trigger this " + "rather elusive bug."); + return; + } assert (parent.getRaw()); if (!flags.failed) {