Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1.22
-
None
-
OmniOS r151020 - Illumos derivative.
Solaris 11.3 (maybe earlier).
Description
MariaDB fails to start with error:
ERROR: 1030 Got error 8 "Exec format error" from storage engine MyISAM
|
This is due to openat() being called on a directory with the O_EXEC flag set.
The man page for openat() on these platforms specifies that:
O_EXEC Open ordinary file for execute only.
|
and returns:
ENOEXEC The O_EXEC access mode was specified and the file to be
|
opened is not an ordinary file.
|
Trace shows that this is occurring:
28152/27: openat(4294967295, "/data", O_EXEC|O_NOFOLLOW) Err#8 ENOEXEC
|
28152/27: write(2, " E R R O R : ", 7) = 7
|
My MariaDB files are under /data/mariadb/ — the parent directory is being opened with O_EXEC hence the failure.
The last working version that I've tried is 10.1.19
Attachments
Issue Links
- duplicates
-
MDEV-12618 mysys/mysys_priv.h shouldn't use O_EXEC as O_PATH on illumos
-
- Closed
-
Tried this quick patch and I can confirm that my server now works. This isn't the proper fix, just a quick test - the semantics of the various operating systems need taking into account.
--- mariadb-10.1.22.distrib/mysys/mysys_priv.h Sat Mar 11 19:09:10 2017
+++ mariadb-10.1.22/mysys/mysys_priv.h Mon Mar 20 13:27:02 2017
@@ -108,9 +108,13 @@
void my_error_unregister_all(void);
+#if !defined(O_PATH) && defined(O_SEARCH) /* Illumos */
+#define O_PATH O_SEARCH
+#else
#if !defined(O_PATH) && defined(O_EXEC) /* FreeBSD */
#define O_PATH O_EXEC
#endif
+#endif
#ifdef O_PATH