Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
2.3.4, 3.1.7
-
None
-
None
-
None
-
Any
Description
In a MariaDB client memory allocation routine:
gptr alloc_root(MEM_ROOT *mem_root, size_t Size)
...
get_size= MAX(Size+ALIGN_SIZE(sizeof(USED_MEM)),
(mem_root->block_size & ~1) * (mem_root->block_num >> 2));
The problem is that if DB connection is open for a long time e.g. weeks, block_num incremented with every alloc_root call an gets quite high and get_size becomes bigger and bigger reaching finally 4GB for 32bit processes causing MariaDB application shutdown.
Workarounded it by changing alloc_root code to:
get_size= MAX(Size+ALIGN_SIZE(sizeof(MA_USED_MEM)),
(mem_root->block_size & ~1) * 1024 );
Looks working but not sure whether it is a correct solution.