FTBFS: mariadb fails to start due to MEMLOCK limit under 256 MB

Bug #2038500 reported by Otto Kekäläinen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mariadb (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

This bug report is basically about the same issue as https://bugs.launchpad.net/ubuntu/+source/mariadb-10.6/+bug/1970634, but since that one was fixed with a workaround (https://salsa.debian.org/mariadb-team/mariadb-server/-/commit/8d20ca979cf422d3a507283b86c2547d78559179), we need this new bug report to track the underlying issue.

I tested today removing the workaround commit and uploaded to https://launchpad.net/~mysql-ubuntu/+archive/ubuntu/mariadb-10.11/+builds?build_text=&build_state=all and was able to confirm that this still happens on archs s390x and ppc64el:

2023-10-05 1:40:12 0 [Warning] mariadbd: io_uring_queue_init() failed with ENOMEM: try larger memory locked limit, ulimit -l, or https://mariadb.com/kb/en/systemd/#configuring-limitmemlock under systemd (262144 bytes required)
231005 1:40:12 [ERROR] mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
Server version: 10.11.5-MariaDB-2~bpo23.10.1~1696467303.580e555cdeb.debian. source revision:
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=0
max_threads=153
thread_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 468037 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x0 thread_stack 0x49000
/<<PKGBUILDDIR>>/builddir/sql/mariadbd(my_print_stacktrace+0x2a)[0x2aa3b42450a]
src/mariadb-1:10(handle_fatal_signal)[0x2aa3af8a900]
[0x3fffa475b86]
/lib/s390x-linux-gnu/libc.so.6(+0x9e09a)[0x3ff9ad9e09a]
/lib/s390x-linux-gnu/libc.so.6(gsignal+0x20)[0x3ff9ad4aa90]
/lib/s390x-linux-gnu/libc.so.6(abort+0x10c)[0x3ff9ad2a4ec]
/<<PKGBUILDDIR>>/builddir/sql/mariadbd(+0xfc5000)[0x2aa3b545000]
/<<PKGBUILDDIR>>/builddir/sql/mariadbd(+0xfc5c32)[0x2aa3b545c32]
/lib/s390x-linux-gnu/libgcc_s.so.1(+0xb2b2)[0x3ff9a88b2b2]
/lib/s390x-linux-gnu/libgcc_s.so.1(_Unwind_RaiseException+0x19c)[0x3ff9a88b65c]
/lib/s390x-linux-gnu/libstdc++.so.6(__cxa_throw+0x56)[0x3ff9b0cffd6]
/<<PKGBUILDDIR>>/builddir/sql/mariadbd(+0xe31168)[0x2aa3b3b1168]
src/mariadb-1:10(tpool::thread_pool_generic::create_native_aio(int))[0x2aa3b3adc34]
bits/unique_ptr.h:208(std::__uniq_ptr_impl<tpool::aio, std::default_delete<tpool::aio> >::reset(tpool::aio*))[0x2aa3ab356dc]
src/mariadb-1:10(os_aio_init())[0x2aa3ab4130a]
src/mariadb-1:10(innodb_init(void*) [clone .lto_priv.0])[0x2aa3b2276f0]
src/mariadb-1:10(ha_initialize_handlerton(st_plugin_int*))[0x2aa3af8b9fa]
src/mariadb-1:10(plugin_do_initialize(st_plugin_int*, unsigned int&))[0x2aa3ad192e0]
src/mariadb-1:10(plugin_initialize(st_mem_root*, st_plugin_int*, int*, char**, bool))[0x2aa3ad1d622]
src/mariadb-1:10(plugin_init(int*, char**, int))[0x2aa3ad23a2e]
src/mariadb-1:10(init_server_components())[0x2aa3abcebde]
src/mariadb-1:10(mysqld_main(int, char**))[0x2aa3abdbc02]
/lib/s390x-linux-gnu/libc.so.6(+0x2aacc)[0x3ff9ad2aacc]
/lib/s390x-linux-gnu/libc.so.6(__libc_start_main+0xae)[0x3ff9ad2abce]
/<<PKGBUILDDIR>>/builddir/sql/mariadbd(+0x60e8f0)[0x2aa3ab8e8f0]
The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
information that should help you find out what is causing the crash.
Writing a core file...
Working directory at /<<PKGBUILDDIR>>/builddir/mysql-test/var/install.db
Resource Limits:
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size unlimited unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 64242 64242 processes
Max open files 1024 1024 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 64242 64242 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
Kernel version: Linux version 5.4.0-163-generic (buildd@bos01-s390x-017) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)) #180-Ubuntu SMP Tue Sep 5 13:23:29 UTC 2023

On armhf multiple tests run, but many also fail on MariaDB crashing on signal 7 and signal 11, and they seem unrealted.

On amd64 the root cause of the failure is likely the same, but error looks like this:

023-10-05 1:33:49 0 [Warning] mariadbd: io_uring_queue_init() failed with errno 2
231005 1:33:49 [ERROR] mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
Server version: 10.11.5-MariaDB-2~bpo23.10.1~1696467303.580e555cdeb.debian. source revision:
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=0
max_threads=153
thread_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 468037 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x0 thread_stack 0x49000
/<<PKGBUILDDIR>>/builddir/sql/mariadbd(my_print_stacktrace+0x30)[0x56255dd925f0]
src/mariadb-1:10(handle_fatal_signal)[0x56255d978129]
/lib/x86_64-linux-gnu/libc.so.6(+0x42910)[0x7eff9a1d6910]
/lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x11b)[0x7eff9a22d99b]
/lib/x86_64-linux-gnu/libc.so.6(raise+0x16)[0x7eff9a1d6866]
/lib/x86_64-linux-gnu/libc.so.6(abort+0xd7)[0x7eff9a1ba8b7]
unwind-dw2.o:0(_Unwind_RaiseException.cold)[0x56255d56dbf6]
/<<PKGBUILDDIR>>/builddir/sql/mariadbd(+0xf37e13)[0x56255de9ae13]
/lib/x86_64-linux-gnu/libgcc_s.so.1(+0x19a59)[0x7eff99eefa59]
/lib/x86_64-linux-gnu/libgcc_s.so.1(_Unwind_RaiseException+0x311)[0x7eff99ef0181]
/lib/x86_64-linux-gnu/libstdc++.so.6(__cxa_throw+0x3b)[0x7eff9a54512b]
/<<PKGBUILDDIR>>/builddir/sql/mariadbd(+0x5f44f0)[0x56255d5574f0]
src/mariadb-1:10(tpool::thread_pool_generic::create_native_aio(int))[0x56255dd34c02]
bits/unique_ptr.h:208(std::__uniq_ptr_impl<tpool::aio, std::default_delete<tpool::aio> >::reset(tpool::aio*))[0x56255d51ef27]
src/mariadb-1:10(os_aio_init())[0x56255d538332]
src/mariadb-1:10(innodb_init(void*) [clone .lto_priv.0])[0x56255dbde499]
src/mariadb-1:10(ha_initialize_handlerton(st_plugin_int*))[0x56255d979266]
src/mariadb-1:10(plugin_do_initialize(st_plugin_int*, unsigned int&))[0x56255d7228e3]
src/mariadb-1:10(plugin_initialize(st_mem_root*, st_plugin_int*, int*, char**, bool))[0x56255d7260a2]
src/mariadb-1:10(plugin_init(int*, char**, int))[0x56255d72cb77]
src/mariadb-1:10(init_server_components())[0x56255d5f075b]
src/mariadb-1:10(mysqld_main(int, char**))[0x56255d5fc665]
/lib/x86_64-linux-gnu/libc.so.6(+0x280d0)[0x7eff9a1bc0d0]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x89)[0x7eff9a1bc189]
/<<PKGBUILDDIR>>/builddir/sql/mariadbd(_start+0x25)[0x56255d5b5945]
The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
information that should help you find out what is causing the crash.
Writing a core file...
Working directory at /<<PKGBUILDDIR>>/builddir/mysql-test/var/install.db
Resource Limits:
Limit Soft Limit Hard Limit Units
Max cpu time unlimited unlimited seconds
Max file size unlimited unlimited bytes
Max data size unlimited unlimited bytes
Max stack size 8388608 unlimited bytes
Max core file size unlimited unlimited bytes
Max resident set unlimited unlimited bytes
Max processes 63853 63853 processes
Max open files 1024 1024 files
Max locked memory 65536 65536 bytes
Max address space unlimited unlimited bytes
Max file locks unlimited unlimited locks
Max pending signals 63853 63853 signals
Max msgqueue size 819200 819200 bytes
Max nice priority 0 0
Max realtime priority 0 0
Max realtime timeout unlimited unlimited us
Core pattern: |/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E
Kernel version: Linux version 5.4.0-163-generic (buildd@lcy02-amd64-067) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)) #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023

Otto Kekäläinen (otto)
affects: mariadb-10.6 (Ubuntu) → mariadb (Ubuntu)
Changed in mariadb (Ubuntu):
status: New → Confirmed
Revision history for this message
Otto Kekäläinen (otto) wrote :
Otto Kekäläinen (otto)
Changed in mariadb (Ubuntu):
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.