------------------------------------------------------------ revno: 13963 revision-id: squid3@treenet.co.nz-20151218125046-zcy17mbytb0h0c0d parent: squid3@treenet.co.nz-20151218124401-2ov1v9a13jtwmscs author: Alex Rousskov committer: Amos Jeffries branch nick: 3.5 timestamp: Sat 2015-12-19 01:50:46 +1300 message: Fix startup crash with a misconfigured (too-small) shared memory cache Controller condition for allocating MemStore is slightly different from MemStore condition for allocating MemStore::map, resulting in MemStore without a map. Until that discrepancy is fixed, be careful when dereferencing MemStore::map. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20151218125046-zcy17mbytb0h0c0d # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # testament_sha1: 7ee29a1b96bfe1d43679dafa9973e0f4359929e0 # timestamp: 2015-12-18 12:55:35 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.5 # base_revision_id: squid3@treenet.co.nz-20151218124401-\ # 2ov1v9a13jtwmscs # # Begin patch === modified file 'src/MemStore.cc' --- src/MemStore.cc 2015-01-13 09:13:49 +0000 +++ src/MemStore.cc 2015-12-18 12:50:46 +0000 @@ -725,7 +725,7 @@ if (e.mem_obj && e.mem_obj->memCache.index >= 0) { map->freeEntry(e.mem_obj->memCache.index); disconnect(e); - } else { + } else if (map) { // the entry may have been loaded and then disconnected from the cache map->freeEntryByKey(reinterpret_cast(e.key)); }