From: Amos Jeffries Date: Sun, 26 Jul 2009 11:15:35 +0000 (+1200) Subject: Hack to resolve crash on shutdown from global String(",null,") X-Git-Tag: SQUID_3_2_0_1~842 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8536ad023490d40ac1eac83e2eb0467dd3d8da41;p=thirdparty%2Fsquid.git Hack to resolve crash on shutdown from global String(",null,") Not even close to the best solution. But it will get us a running 3.1 release which we need right about now. --- diff --git a/configure.in b/configure.in index fe160274ad..e4610e8988 100644 --- a/configure.in +++ b/configure.in @@ -34,7 +34,7 @@ new_configure_args="$ac_configure_args --with-squid=$ac_abs_confdir" ac_configure_args="$new_configure_args" -use_loadable_modules=1 +use_loadable_modules=0 AC_MSG_CHECKING(whether to use loadable modules) AC_ARG_ENABLE(loadable-modules, AC_HELP_STRING( [--disable-loadable-modules], [do not support loadable modules]) , @@ -51,6 +51,7 @@ AC_ARG_ENABLE(loadable-modules, AC_MSG_RESULT([$use_loadable_modules, implicitly]) ] ) +use_loadable_modules=0 AM_CONDITIONAL(USE_LOADABLE_MODULES, test $use_loadable_modules = yes) diff --git a/src/String.cc b/src/String.cc index 9fc2ad80a4..40eae2c59e 100644 --- a/src/String.cc +++ b/src/String.cc @@ -150,6 +150,7 @@ String::clean() PROF_start(StringClean); assert(this); + /* TODO if mempools has already closed this will FAIL!! */ if (defined()) memFreeString(size_, buf_); diff --git a/src/adaptation/History.cc b/src/adaptation/History.cc index c8775c5cdf..e7598dd4cd 100644 --- a/src/adaptation/History.cc +++ b/src/adaptation/History.cc @@ -7,7 +7,7 @@ #include "adaptation/History.h" /// impossible services value to identify unset theNextServices -const static String TheNullServices(",null,"); +const static char *TheNullServices = ",null,"; Adaptation::History::Entry::Entry(const String &sid, const timeval &when): service(sid), start(when), theRptm(-1), retried(false) @@ -33,7 +33,7 @@ int Adaptation::History::Entry::rptm() } -Adaptation::History::History(): theNextServices(TheNullServices) { +Adaptation::History::History(): theNextServices(String(TheNullServices)) { } int Adaptation::History::recordXactStart(const String &sid, const timeval &when, bool retrying) @@ -120,19 +120,19 @@ bool Adaptation::History::getXxRecord(String &name, String &value) const void Adaptation::History::updateNextServices(const String &services) { - if (theNextServices != TheNullServices) + if (theNextServices != String(TheNullServices)) debugs(93,3, HERE << "old services: " << theNextServices); debugs(93,3, HERE << "new services: " << services); - Must(services != TheNullServices); + Must(services != String(TheNullServices)); theNextServices = services; } bool Adaptation::History::extractNextServices(String &value) { - if (theNextServices == TheNullServices) + if (theNextServices == String(TheNullServices)) return false; value = theNextServices; - theNextServices = TheNullServices; // prevents resetting the plan twice + theNextServices = String(TheNullServices); // prevents resetting the plan twice return true; }