Fix: Setting memory cache size greater than 2GB causes a segfault.
authorMuhammad Usama <muhammad.usama@percona.com>
Fri, 30 Sep 2022 20:33:12 +0000 (01:33 +0500)
committerMuhammad Usama <muhammad.usama@percona.com>
Fri, 30 Sep 2022 20:51:27 +0000 (01:51 +0500)
The problem was in the block_address() function that returns the memory address
for a given cache block, It was using 32bit integers to calculate the offset of
the block within the shared memory space that is only good until the 2GB limit.

src/query_cache/pool_memqcache.c

index e5e3b3061bb6270d7dcf42f25015d92320e29739..4ffc40c279b8325fe2a2bcf0296f23a45917a6fb 100644 (file)
@@ -3025,7 +3025,7 @@ block_address(int blockid)
        char       *p;
 
        p = pool_memory_cache_address() +
-               blockid * pool_config->memqcache_cache_block_size;
+               (uint64)blockid * pool_config->memqcache_cache_block_size;
        return p;
 }