Bug #119954 libaio1.so loading shared library fails in binary tarball b/c it is renamed to libaio1t64
Submitted: 26 Feb 21:13 Modified: 28 Feb 14:39
Reporter: Oli Sennhauser Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.4.8 OS:Ubuntu (Ubuntu 24.04.3 LTS)
Assigned to: CPU Architecture:x86 (n.a.)
Tags: binary distribution, Debian, libaio, tarball, ubuntu

[26 Feb 21:13] Oli Sennhauser
Description:
MySQL 8.4.8 server does NOT start on recent Debian and Ubuntu distributions when binary tarball is used, because it does NOT find the libaio1.so:

$ /home/dba/product/mysql-8.4.8/bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory.

$ ldd
...
libaio.so.1 => not found

How to repeat:
But the libaio library is installed:

$ dpkg -l | grep libaio
ii  libaio1t64:amd64              0.3.113-6build1.1                 amd64        Linux kernel AIO access library - shared library

The reason is, that the libaio1.so library has been renamed in recent Debian and Ubuntu distros to libaio1t64.so

/usr/lib/x86_64-linux-gnu/libaio.so.1t64.0.2
/usr/lib/x86_64-linux-gnu/libaio.so.1t64

deb11/deb12: libaoi1, deb13: libaio1t64
Rocky8/9/10: libaio
ubuntu2204: libaio1, ubuntu2404: libaio1t64 (2604 probably as well)

Suggested fix:
Compile binary tarball in a way that it finds libaio1t64

Workaround:

cd /usr/lib/x86_64-linux-gnu
ln -s libaio.so.1t64 libaio.so.1

Database can be started...
[27 Feb 6:02] Daniël van Eeden
https://wiki.debian.org/ReleaseGoals/64bit-time

The rename was done as part of the Debian wide effort for a 64-bit time
[28 Feb 11:54] MySQL Verification Team
I'm not sure this is a bug, but maybe build team can comment.
The "Linux - Generic" binaries will run on most linuxes which I think wouldn't have the libaio1t64?
[28 Feb 14:39] Oli Sennhauser
It does NOT work (any more) as expected. So how do you call it then if not a bug? A feature request?

As I NOT mentioned above it works/worked on: Debian11, Debian12, Rocky 8 - 10 and Ubuntu 24.04 (or at least it should work).
And it does NOT work (any more) on Debian 13, Ubuntu 24.04 and possibly also 26.04.

Those are the most frequent seen distributions in enterprises over here in Europe.
[28 Feb 17:05] Daniël van Eeden
I think this was caused by the rename of the library in Debian/Ubuntu.

Fixing this for Debian/Ubuntu systems by simply using libaio.so.1t64 in the binary packages might break this for other Linux distros.

The .deb package (downloads or APT) works as that uses the right versions for every OS. And so do the container images. However the binary packages are often more flexible.

The generic binary packages are already provided in different flavors of GLIBC.

Some possible ways forward:
1. Add an extra t64 flavor of the binary packages
2. Ask Debian/Ubuntu to create a libaio1 or libaio1-compat package with libaio.so.1
3. Bundle a libaio.so.1 with the binary package.
4. Add a step to the documentation to use `patchelf` to patch the library name (assuming these are compatible)

# ./bin/mysqld --version
./bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
# patchelf --replace-needed libaio.so.1 libaio.so.1t64 bin/mysqld
# ./bin/mysqld --version
/mysql-8.4.8-linux-glibc2.28-x86_64/bin/mysqld  Ver 8.4.8 for Linux on x86_64 (MySQL Community Server - GPL)
[28 Feb 17:08] Daniël van Eeden
I DO think this is a bug. as the binary tarball packages now no longer work on some very popular Linux distros.

This can be fixed either by MySQL release engineering, MySQL documentation or by Ubuntu/Debian.