[MDEV-26533] MariaDB 10.5 and 10.6 crashes with key_buffer_size greater than 4Gb on Windows 64bit Created: 2021-09-03  Updated: 2021-09-06  Resolved: 2021-09-05

Status: Closed
Project: MariaDB Server
Component/s: Platform Windows, Storage Engine - MyISAM
Affects Version/s: 10.5.11, 10.5.12, 10.6.4
Fix Version/s: 10.5.13, 10.6.5

Type: Bug Priority: Major
Reporter: Detlev Patz Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 0
Labels: 4GB, 64bit, key_buffer_size, ulong, windows
Environment:

Windows 64 Server or WIn10


Issue Links:
Problem/Incident
is caused by MDEV-18851 modernise Linux Large Page support (m... Closed
Relates
relates to MDEV-9256 aria_chk does not repair tables Closed

 Description   

When setting the key_buffer_size for ISAM tables to a value larger than 4GB mariadb uses only 4GB and crashes if it would actually need more than 4GB.
You can easily check that in Task-Manager (in german it's "Zugesicherte Groesse", not sure whats it on english windows).
Compare with versions before 10.5 where it was working fine (10.4.21 for example).

When you do something that would use more than 4GB (in my case creating index after import for a very large table) it crashes with "mysqld got exception 0xc0000005 ;"

from Error-log:
Server version: 10.5.12-MariaDB-log
key_buffer_size=0
read_buffer_size=131072
max_used_connections=2
max_threads=65537
thread_count=3
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 5398 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Interesting is the "key_buffer_size=0". It actually was set to 8GB here. When setting it to 7GB it crashes with "key_buffer_size=3221225472".

It looks like mariadb uses a 32bit variable somewhere. On Linux or on Windows with Versions before 10.5 it's working fine.

I tried 10.6.4 and it has the same bug. Earlier versions (i tried 10.4.21, 10.3.31, 10.2.40) were working fine.

Please fix.


Generated at Thu Feb 08 09:46:01 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.