]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix cbdata assertion in carpInit() (#1454)
authorAlex Rousskov <rousskov@measurement-factory.com>
Sat, 12 Aug 2023 18:28:37 +0000 (18:28 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 13 Aug 2023 21:59:38 +0000 (21:59 +0000)
... 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).

src/carp.cc

index 3313a0b93dd1b9163ba927970c6c089c0caf5162..7d747d2b3a44fd3e0d3ed17999d0598b59fa28c4 100644 (file)
@@ -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;