Bug #109429 Update the directories malloc-lib supports because ARM
Submitted: 19 Dec 2022 15:59 Modified: 19 Dec 2022 16:10
Reporter: Mark Callaghan Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0 OS:Linux
Assigned to: CPU Architecture:ARM

[19 Dec 2022 15:59] Mark Callaghan
Description:
Try to initialize mysqld on ARM with this in the [mysqld_safe] section of my.cnf:
    malloc-lib=/usr/lib/aarch64-linux-gnu/libjemalloc.so

And I get this error:
 mysqld_safe --malloc-lib must be located in one of the directories: /usr/lib /usr/lib64 /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu

How to repeat:
Initialize mysqld on ARM + Ubuntu 22.04 with ...

[mysqld]
sql_mode=no_engine_substitution,no_unsigned_subtraction
default_tmp_storage_engine=MyISAM
tmpdir=/data/m/my
#query_cache_size=0
#query_cache_type=0
# slow_query_log_file=/data/m/my/slow.log
long_query_time=5
# skip_log_bin
log_bin=/data/m/my/binlogs/bl
max_binlog_size=128M
server_id=77
binlog_format=ROW
datadir=/data/m/my/data

innodb_file_per_table=1

innodb_data_home_dir=/data/m/my/data
innodb_data_file_path=ibdata1:512M:autoextend
innodb_log_group_home_dir=/data/m/my/txlogs
slow_query_log=1

performance_schema=1
ssl=0
default_authentication_plugin=mysql_native_password
character_set_server=latin1
collation_server=latin1_swedish_ci
eq_range_index_dive_limit=10

innodb_fast_shutdown=1
innodb_doublewrite=1
innodb_buffer_pool_load_at_startup=OFF
innodb_buffer_pool_dump_at_shutdown=OFF
innodb_purge_threads=1

innodb_flush_log_at_trx_commit=2
sync_binlog=0

[mysqld_safe]
malloc-lib=/usr/lib/aarch64-linux-gnu/libjemalloc.so

Suggested fix:
Update mysqld_safe.sh

https://github.com/mysql/mysql-server/blob/a246bad76b9271cb4333634e954040a970222e0a/script...

--- scripts/mysqld_safe.sh      2022-09-13 16:15:16.000000000 +0000
+++ /home/ubuntu/d/my8031/bin/mysqld_safe       2022-12-19 15:49:51.089923040 +0000
@@ -360,7 +360,7 @@
 # running mysqld.  See ld.so for details.
 set_malloc_lib() {
   # This list is kept intentionally simple.
-  malloc_dirs="/usr/lib /usr/lib64 /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu"
+  malloc_dirs="/usr/lib /usr/lib64 /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu /usr/lib/aarch64-linux-gnu"
   malloc_lib="$1"

   # Allow --malloc-lib='' to override other settings
@@ -379,6 +379,7 @@
         /usr/lib64) ;;
         /usr/lib/i386-linux-gnu) ;;
         /usr/lib/x86_64-linux-gnu) ;;
+        /usr/lib/aarch64-linux-gnu) ;;
         *)
           log_error "--malloc-lib must be located in one of the directories: $malloc_dirs"
           exit 1
[19 Dec 2022 16:10] MySQL Verification Team
Hi Mr. Callaghan,

Thank you for your bug report.

Verified as reported.