Description:
I need to put some paths into LD_LIBRARY_PATH environment variable for things like asan and also new glibc which is not installed on this particular system.
This causes mysql_install_db to fail (trimmed) :
[ERROR] Child process: mysqld terminated prematurely with errno= 32
[ERROR] Failed to execute mysqld --bootstrap --datadir=./data --lc-messages-dir=./share --lc-messages=en_US --basedir=.
-- server log begin --
mysqld: error while loading shared libraries: libasan.so.1: cannot open shared object file: No such file or directory
-- server log end --
How to repeat:
let mysqld require something from LD_LIBRARY_PATH that is not installed on system.
Running mysqld manually works fine but spawning via mysql_install_db fails.
Suggested fix:
The last argument here is NULL, but it should be a pointer to the current environment variables?
int ret= posix_spawnp(&child, (const char *)execve_args[0], &spawn_action,
NULL, execve_args, NULL);