From: Alex Rousskov Date: Sat, 12 Aug 2023 18:28:37 +0000 (+0000) Subject: Fix cbdata assertion in carpInit() (#1454) X-Git-Tag: SQUID_7_0_1~370 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6240f5809146d3b6dcfcfd7b40e14c70ecb9af9a;p=thirdparty%2Fsquid.git Fix cbdata assertion in carpInit() (#1454) ... after commit e7959b5 FATAL: assertion failed: cbdata.cc:276: "c->locks > 0" We cannot test cbdata validity of CachePeer pointers stored in Config.peers because Config.peers own CachePeer objects. By definition, owners should not lock their objects and do not need to test object validity: Owners determine the lifetime of those objects! Naturally, unlocked objects must not be tested for validity by others because to test an object validity one has to have a lock that preserves object metadata even after the object is invalidated (by its owner). --- diff --git a/src/carp.cc b/src/carp.cc index 3313a0b93d..7d747d2b3a 100644 --- a/src/carp.cc +++ b/src/carp.cc @@ -59,9 +59,6 @@ carpInit(void) RawCachePeers rawCarpPeers; for (auto p = Config.peers; p; p = p->next) { - if (!cbdataReferenceValid(p)) - continue; - if (!p->options.carp) continue;