tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

mariadb startup fail on NetBSD 8.0



Hi

After upgrading to NetBSD 8.0, I experienced an unpleasant
mariadb startup failure. The error log says:

180804  4:52:54  InnoDB: Waiting for the background threads to start
180804  4:52:55 Percona XtraDB (http://www.percona.com) 5.5.55-MariaDB-38.8 started; log sequence number 439288452
180804  4:52:55 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
180804  4:52:55 [ERROR] Fatal error: Can't open and lock privilege tables: Got error 9 from storage engine
180804 04:52:55 mysqld_safe mysqld from pid file /var/mariadb/lego.pid ended

ktrace tells me the error 9 comes from an improper openat() usage:
  1881      1 mysqld   NAMI  "./mysql/host.MYI"
  1881      1 mysqld   RET   __lstat50 0
  1881      1 mysqld   CALL openat(0xffffffff,0xbf7fb91b,0x800100,0x8621250)
  1881      1 mysqld   RET   openat -1 errno 9 Bad file descriptor

host.MYI is fine and can be readen from the shell, but passing -1 
as the directory descriptor is the problem. I understand there
is something broken in mariadb code.

I have not tracked exactly what is wrong, but it is easy to convince
mariadb server code that we do not have openat() support. The 
mariadb patch bellow let mariadb server start up on NetBSD 8.0,
using plain open()

--- mysys/mysys_priv.h.orig
+++ mysys/mysys_priv.h
@@ -96,8 +96,12 @@
 #define O_PATH O_EXEC
 #endif
 #endif
 
+#if defined(__NetBSD__) && defined(O_PATH)
+#undef O_PATH
+#endif
+
 #ifdef O_PATH
 #define HAVE_OPEN_PARENT_DIR_NOSYMLINKS
 const char *my_open_parent_dir_nosymlinks(const char *pathname, int *pdfd);
 #define NOSYMLINK_FUNCTION_BODY(AT,NOAT)   

Before I dig deeper in mariadb code: anyone experienced the
same issue, or is it just at mine?

Should I commit the patch to pkgsrc?


-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index