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:46:08 +0000 (01:46 +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 41a87f755e471fc4d24e879ee201fd390a0257f6..e8e9d28b5fa81c0e7a8859d1c05143ae63cd4dac 100644 (file)
@@ -2861,7 +2861,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;
 }