/usr/sbin/mysqld: error while loading shared libraries: libaio.so.1: failed to map segment from shared object

Asked by defaria

Can't load mysqld! I get:

Wizard Earth:/usr/sbin/mysqld
/usr/sbin/mysqld: error while loading shared libraries: libaio.so.1: failed to map segment from shared object
Wizard Earth:ldd /usr/sbin/mysqld
 linux-vdso.so.1 (0x00007fff20286000)
 libaio.so.1 => /lib/x86_64-linux-gnu/libaio.so.1 (0x00007f6e01e7d000)
 liblz4.so.1 => /usr/lib/x86_64-linux-gnu/liblz4.so.1 (0x00007f6e01c61000)
 libnuma.so.1 => /usr/lib/x86_64-linux-gnu/libnuma.so.1 (0x00007f6e01a56000)
 libwrap.so.0 => /lib/x86_64-linux-gnu/libwrap.so.0 (0x00007f6e0184c000)
 libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f6e01614000)
 libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6e01410000)
 libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f6e011f3000)
 librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f6e00feb000)
 libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f6e00dcc000)
 libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f6e00a43000)
 libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6e006a5000)
 libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6e0048d000)
 libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6e0009c000)
 /lib64/ld-linux-x86-64.so.2 (0x00007f6e0207f000)
 libnsl.so.1 => /lib/x86_64-linux-gnu/libnsl.so.1 (0x00007f6dffe82000)
Wizard Earth:ll /lib/x86_64-linux-gnu/libaio.so.1
lrwxrwxrwx 1 root root 15 Apr 1 20:39 /lib/x86_64-linux-gnu/libaio.so.1 -> libaio.so.1.0.1
Wizard Earth:file /lib/x86_64-linux-gnu/libaio.so.1.0.1
/lib/x86_64-linux-gnu/libaio.so.1.0.1: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=db3dea353c4a5dca42e6a9dce25eb7325366784e, stripped

Googling yields that /tmp doesn't have exec and instructs you to remount /tmp with exec. However /tmp isn't mounted on my system and /tmp isn't a separate file system. Others say to create a new directory and set TMPDIR. Neither of these solutions solves anything for me.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu mysql-5.7 Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

What is the output of:

lsb_release -a; uname -a; ls -ll /tmp

Thanks

Revision history for this message
defaria (andrew-defaria) said :
#2

Sorry. Here ya go:

Earth:lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
Earth:uname -a
Linux earth 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Earth:ll /tmp
total 60
drwxrwxrwt 9 root root 4096 May 3 07:33 ./
drwxr-xr-x 29 root root 4096 Apr 25 10:04 ../
drwx------ 2 andrew defaria 4096 May 3 07:30 .com.google.Chrome.C6Ujyj/
-rw------- 1 andrew defaria 16757 May 2 08:00 .com.google.Chrome.FhrGKb
drwx------ 2 andrew defaria 4096 May 2 07:54 .com.google.Chrome.geS0O9/
drwxrwxrwt 2 root root 4096 May 2 07:52 .font-unix/
drwxrwxrwt 2 root root 4096 May 2 07:53 .ICE-unix/
drwxrwxrwt 2 root root 4096 May 2 07:52 .Test-unix/
-r--r--r-- 1 gdm gdm 11 May 2 07:53 .X1024-lock
drwxrwxrwt 2 root root 4096 May 2 07:53 .X11-unix/
drwxrwxrwt 2 root root 4096 May 2 07:52 .XIM-unix/
Earth:

Revision history for this message
Larry Irwin (lrirwin) said :
#3

Other instances of this error involve mixed 32 and 64 bit objects. Maybe check using:
file /lib/x86_64-linux-gnu/libaio.so.1
(or if that is a symlink, check the linked file...)
And see if libaio is 32 bit somehow?

Revision history for this message
defaria (andrew-defaria) said :
#4

Earth:ll /lib/x86_64-linux-gnu/libaio.so.1
lrwxrwxrwx 1 root root 15 Apr 1 20:39 /lib/x86_64-linux-gnu/libaio.so.1 -> libaio.so.1.0.1
Earth:file /lib/x86_64-linux-gnu/libaio.so.1.0.1
/lib/x86_64-linux-gnu/libaio.so.1.0.1: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=db3dea353c4a5dca42e6a9dce25eb7325366784e, stripped
Earth:

libaio.so.1.0.1 is indeed 64 bit. You ask "see if libaio is 32 bit somehow" - How? I looked around in Synaptic but didn't see anything about 32 bit WRT the libaio package. Indeed the installed files pretty much just those two files (the symlink and the actual .so) into the /lib/x86_64-linux-gnu, which should only have 64 bit stuff right? And the file commans verifies this.

Revision history for this message
Larry Irwin (lrirwin) said :
#5

Just needed to check - I compile and cross-compile sometimes and every now and then pointers get fouled up...
libz has create more compatibility issues than others...

So - I've got exactly the same versions running on my laptop - and the same (huge) / filesystem...
Linux lrinotebook 4.15.0-48-generic #51~16.04.1-Ubuntu SMP Fri Apr 5 12:01:12 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

/usr/sbin/mysqld Ver 8.0.16 for Linux on x86_64 (MySQL Community Server - GPL)

/lib/x86_64-linux-gnu/libaio.so.1.0.1: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=e75b3bc7bf3d3e42b02512e19b72f23352d7484a, stripped

I haven't modified any of the config files in /etc/mysql.

Maybe check for corrupted files.
Here are the sums on my system:
root@lrinotebook:/etc/mysql# sum /usr/sbin/mysqld
55386 54000
root@lrinotebook:/etc/mysql# sum /lib/x86_64-linux-gnu/libaio.so.1.0.1
05420 6

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

Just some ideas:

1. Is there no additional text after " failed to map segment from shared object"?
Google hits with the same error message have additional information like "Cannot allocate memory" or "Permission denied" or "Operation not permitted" or similar.

2. Have you already tried reinstalling the involved packages, probably
sudo apt install --reinstall mysql-server-core-5.7 libaio1

Revision history for this message
Larry Irwin (lrirwin) said :
#7

@m-hampl - I'm pretty sure he's got mysql version 8 - it looked like his system was completely up-to-date...

Revision history for this message
defaria (andrew-defaria) said :
#8

Actually, your versions are not equal mine. My uname is different - Linux earth 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux. The general release is there but other parts are different.

Also your libaio.so.1.0.1 has a different BuildID[sha1]. Mine's =db3dea353c4a5dca42e6a9dce25eb7325366784e.

Finally the sum's on my files are different:

Earth:sum /usr/sbin/mysqld
50198 24364
Earth:sum /lib/x86_64-linux-gnu/libaio.so.1.0.1
43183 6
Earth:

The surprising part to me is that I have tried uninstalling mysql-server, mysql-client and even libaio comnpletely and reinstalling them. I'm getting stuff from official Ubuntu repos. Why then is there this problem?

Note: Originally I was developing a Docker container that uses MySQL (actually MariaDB). Then I noticed that I didn't have MySQL installed on my Docker host - my desktop (Earth) - so going with new stuff I decided to install MariaDB (server and client) and had a difficult time trying to get MariaDB server up and running. Sometimes it would barely come up and after a few minutes reporting "timeout" or something like that. Feeling flustered I flushed out all of the MariaDB stuff and decided to go back to good old MySQL stuff and installed mysql-server and mysql-client. That's when I started getting this problem.

For Manfred Hampl: I was getting some text at the end of this error message but the error message was slightly different. I don't remember it exactly but I saw things like Permission Denied or perhaps Operation not permitted. I think that was with MariaDB but it could have been with mysqld. I also experience dpkg configure complaining that there were databases in /var/lib/mysql and those databases were with a new (or perhaps different) DBMS like maybe MariaDB. So I decided to clean out everything, move /var/lib/mysql aside and see if I could just install the mysql stuff again. This is when I got stuck with this error and can get no further.

As noted above I've already tried reinstalling the relevant packages. Same error. Here it is again:

Earth:sudo apt install --reinstall mysql-server-core-5.7 libaio1
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 2 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/7,783 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 266382 files and directories currently installed.)
Preparing to unpack .../libaio1_0.3.110-5ubuntu0.1_amd64.deb ...
Unpacking libaio1:amd64 (0.3.110-5ubuntu0.1) over (0.3.110-5ubuntu0.1) ...
Preparing to unpack .../mysql-server-core-5.7_5.7.26-0ubuntu0.18.04.1_amd64.deb ...
Unpacking mysql-server-core-5.7 (5.7.26-0ubuntu0.18.04.1) over (5.7.26-0ubuntu0.18.04.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up libaio1:amd64 (0.3.110-5ubuntu0.1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Setting up mysql-server-core-5.7 (5.7.26-0ubuntu0.18.04.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Earth:/usr/sbin/mysqld
/usr/sbin/mysqld: error while loading shared libraries: libaio.so.1: failed to map segment from shared object
Earth:

Revision history for this message
Launchpad Janitor (janitor) said :
#9

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
defaria (andrew-defaria) said :
#10

Guess there's no solution.

Revision history for this message
Manfred Hampl (m-hampl) said :
#11

Maybe it is possible to find out some more details by debugging with strace.
Running the command

strace /usr/sbin/mysqld

will probably produce much output. The interesting part would not be the beginning, but the part just before the error message.

Revision history for this message
defaria (andrew-defaria) said :
#12

Ok, attempting to run mysqld under strace yielded some interesting things like it was attempting and supposedly succeeding to open /lib/x86_64-linux-gnu/libaio.so.1 and some remenants of mysqld starting up but it still failed. For kicks I decided to move the symlink:

Earth:ll /lib/x86_64-linux-gnu/libaio.so.1
lrwxrwxrwx 1 root root 15 Apr 1 20:39 /lib/x86_64-linux-gnu/libaio.so.1 -> libaio.so.1.0.1
Earth:

aside and copy the libaio.so.1.0.1 directly into /lib/x86_64-linux/gnu/libaio.so.1. This WORKED! However it seems like the wrong solution. I mean shouldn't the loader be able to traverse down a symlink?

I can post the strace output if you'd like. It is very long.

I guess I could mark this as solved but the solution seems ripe for problems down the line should libaio ever be re-installed.

Can you help with this problem?

Provide an answer of your own, or ask defaria for more information if necessary.

To post a message you must log in.