[MDEV-18012] Supplied jemalloc results in immediate MariaDB Segfault on aarch64 Created: 2018-12-14  Updated: 2018-12-28  Resolved: 2018-12-28

Status: Closed
Project: MariaDB Server
Component/s: Compiling, Server
Affects Version/s: 10.0.37
Fix Version/s: 10.2.5

Type: Bug Priority: Major
Reporter: Gordan Bobic Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Environment:

AWS aarch64, Amazon Linux AMI (EL7)


Issue Links:
Relates
relates to MDEV-11059 don't build the server with jemalloc Closed

 Description   

mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
[Note] /usr/sbin/mysqld (mysqld 10.0.37-MariaDB) starting as process 30510 ...
<jemalloc>: Error in munmap(): Invalid argument
[ERROR] mysqld got signal 11 ;

This is likely to do with aarch64 on EL7 defaulting, against all sanity, to 64KB pages. Unfortunately, it is what it is.

AFAICT, it is directly related to this bug:
https://bugzilla.redhat.com/show_bug.cgi?id=1545539
Unfortunately, that bug long postdates EL7, so a better, working jemalloc will likely need to be supplied.

Also:
MariaDB supplied jemalloc is the same as EL7 aarch64 EPEL jemalloc (same version, broken in the same way).



 Comments   
Comment by Sergei Golubchik [ 2018-12-19 ]

Starting from 10.2 we no longer link the server with jemalloc, so upgrading to 10.2 should fix it.

Comment by Gordan Bobic [ 2018-12-19 ]

That's all well and good but the other 1000 or so servers my client has in production are 10.0, so unless this can be fixed that rather blows aarch64 out of the water for us.
Besides, 10.0 is still supported, is it not? Surely this means that 10.0 is broken for everyone on aarch64 RHEL/CentOS?

Comment by Daniel Black [ 2018-12-19 ]

What so insane about a 64K default? Would seem to me to make better use of TLB on a process that naturally uses lots of memory on hardware that has a lot of memory.

Does installing the EPEL jemalloc work compatibly?

10.0 supported to March 2019 https://mariadb.com/kb/en/library/changes-improvements-in-mariadb-100/

Comment by Gordan Bobic [ 2018-12-19 ]

EPEL jemalloc is identical to the rpm bundled with MariaDB, in fact I think the MariaDB supplied package is a copy from the EPEL repository, not a MariaDB build.

As for 64KB default page size, this link contains some of the most notable words from Linus Torvalds on the subject:
https://yarchive.net/comp/linux/page_sizes.html

TL;DR: if you need large pages, use huge pages. 64KB default pages just end up increasing memory wasteage in most cases.

Comment by Sergei Golubchik [ 2018-12-19 ]

Just as a side note, 10.0 is still suported, but only for about 3 more months: https://mariadb.org/about/maintenance-policy/
And with quarterly releases there can be only one new 10.0 release before the EOL.
Unless there will be a decision to extend 10.0 life span.

Comment by Gordan Bobic [ 2018-12-28 ]

Resolution says the fix is in 10.2.5. What about fixes for the still supported 10.0 and 10.1 branches, particularly since this bug was filed against 10.0?

Generated at Thu Feb 08 08:40:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.