Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-7369

[PATCH] MariaDB build fails when XTRADB_STORAGE_ENGINE enabled

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.5.40, 5.5.41
    • Fix Version/s: 10.0.16, 5.5.42
    • Component/s: Compiling
    • Labels:
      None

      Description

      Using -DWITHOUT_XTRADB_STORAGE_ENGINE=1 there's no problem to build MariaDB 5.5.40 or .41. Without this switch I get following output:

      /usr/bin/ar: creating /home/builder/mariadb/src/mariadb-5.5.41/libmysqld/libmysqld.a
      [ 98%] Built target mysqlserver
      Scanning dependencies of target symlink_libmysqlclient_r.a
      Scanning dependencies of target libmysqld
      [ 98%] Generating libmysqlclient_r.a
      [ 98%] Built target symlink_libmysqlclient_r.a
      [ 99%] Building CXX object libmysqld/CMakeFiles/libmysqld.dir/libmysqld_exports_file.cc.o
      Scanning dependencies of target mysql_client_test_embedded
      [ 99%] Building C object libmysqld/examples/CMakeFiles/mysql_client_test_embedded.dir/__/__/tests/mysql_client_test.c.o
      Linking CXX shared library libmysqld.so
      libmysqld.a(srv0start.c.o): In function `innobase_start_or_create_for_mysql':
      /home/builder/mariadb/src/mariadb-5.5.41/storage/xtradb/srv/srv0start.c:1280: undefined reference to `os_stacktrace_print'
      collect2: error: ld returned 1 exit status
      libmysqld/CMakeFiles/libmysqld.dir/build.make:89: recipe for target 'libmysqld/libmysqld.so.18' failed
      make[2]: *** [libmysqld/libmysqld.so.18] Error 1
      CMakeFiles/Makefile2:7409: recipe for target 'libmysqld/CMakeFiles/libmysqld.dir/all' failed
      make[1]: *** [libmysqld/CMakeFiles/libmysqld.dir/all] Error 2
      make[1]: *** Waiting for unfinished jobs....
      Linking CXX static library libsql.a
      [ 99%] Built target sql
      Linking CXX executable mysql_client_test_embedded
      ../libmysqld.a(srv0start.c.o): In function `innobase_start_or_create_for_mysql':
      /home/builder/mariadb/src/mariadb-5.5.41/storage/xtradb/srv/srv0start.c:1280: undefined reference to `os_stacktrace_print'
      collect2: error: ld returned 1 exit status
      libmysqld/examples/CMakeFiles/mysql_client_test_embedded.dir/build.make:89: recipe for target 'libmysqld/examples/mysql_client_test_embedded' failed
      make[2]: *** [libmysqld/examples/mysql_client_test_embedded] Error 1
      CMakeFiles/Makefile2:7550: recipe for target 'libmysqld/examples/CMakeFiles/mysql_client_test_embedded.dir/all' failed
      make[1]: *** [libmysqld/examples/CMakeFiles/mysql_client_test_embedded.dir/all] Error 2
      Makefile:147: recipe for target 'all' failed
      make: *** [all] Error 2
      >>> ERROR: mariadb: all failed
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            elenst Elena Stepanova added a comment -

            We build the server with XtraDB successfully, so apparently it's not a common issue.
            Please provide your complete cmake command and information about environment – OS, compiler versions, etc.

            Also, are you trying to run an incremental build? If so, did you try to make clean, remove CMakeCache.txt and run a clean one?

            Show
            elenst Elena Stepanova added a comment - We build the server with XtraDB successfully, so apparently it's not a common issue. Please provide your complete cmake command and information about environment – OS, compiler versions, etc. Also, are you trying to run an incremental build? If so, did you try to make clean, remove CMakeCache.txt and run a clean one?
            Hide
            scadu Łukasz Jendrysik added a comment -

            cmake command:

            cmake . -DBUILD_CONFIG=mysql_release \
            	-DCMAKE_INSTALL_PREFIX=/usr \
            	-DSYSCONFDIR=/etc/mysql \
            	-DMYSQL_DATADIR=/var/lib/mysql \
                	-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock \
                	-DDEFAULT_CHARSET=utf8 \
                	-DDEFAULT_COLLATION=utf8_general_ci \
                	-DENABLED_LOCAL_INFILE=ON \
                	-DINSTALL_INFODIR=share/mysql/docs \
                	-DINSTALL_MANDIR=share/man \
                	-DINSTALL_PLUGINDIR=lib/mysql/plugin \
                	-DINSTALL_SCRIPTDIR=bin \
                	-DINSTALL_INCLUDEDIR=include/mysql \
                	-DINSTALL_DOCREADMEDIR=share/mysql \
                	-DINSTALL_SUPPORTFILESDIR=share/mysql \
                	-DINSTALL_MYSQLSHAREDIR=share/mysql \
                	-DINSTALL_DOCDIR=share/mysql/docs \
                	-DINSTALL_SHAREDIR=share/mysql \
                	-DWITH_READLINE=ON \
                	-DWITH_ZLIB=system \
                	-DWITH_SSL=system \
                	-DWITH_LIBWRAP=OFF \
                	-DWITH_EXTRA_CHARSETS=complex \
                	-DWITH_EMBEDDED_SERVER=ON \
                	-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
                	-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
                	-DWITH_INNOBASE_STORAGE_ENGINE=1 \
                	-DWITH_PARTITION_STORAGE_ENGINE=1 \
                	-DWITH_TOKUDB_STORAGE_ENGINE=1 \
            	-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \
                	-DWITHOUT_FEDERATED_STORAGE_ENGINE=1 \
                	-DWITHOUT_PBXT_STORAGE_ENGINE=1 \
            

            Host: Arch Linux i686, Linux 3.17.6, gcc 4.9.2
            Build chroot environment: Alpine Linux Edge x86, gcc 4.9.2, zlib 1.2.8, cmake 3.1.0, readline 6.3, libaio 0.3.110, jemalloc 3.6.0, glib 2.42, ncurses 5.9 and probably the most important: musl 1.1.5 (Alpine is a musl based distro).

            No, I'm doing a full build every time.

            Show
            scadu Łukasz Jendrysik added a comment - cmake command: cmake . -DBUILD_CONFIG=mysql_release \ -DCMAKE_INSTALL_PREFIX=/usr \ -DSYSCONFDIR=/etc/mysql \ -DMYSQL_DATADIR=/var/lib/mysql \ -DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock \ -DDEFAULT_CHARSET=utf8 \ -DDEFAULT_COLLATION=utf8_general_ci \ -DENABLED_LOCAL_INFILE=ON \ -DINSTALL_INFODIR=share/mysql/docs \ -DINSTALL_MANDIR=share/man \ -DINSTALL_PLUGINDIR=lib/mysql/plugin \ -DINSTALL_SCRIPTDIR=bin \ -DINSTALL_INCLUDEDIR=include/mysql \ -DINSTALL_DOCREADMEDIR=share/mysql \ -DINSTALL_SUPPORTFILESDIR=share/mysql \ -DINSTALL_MYSQLSHAREDIR=share/mysql \ -DINSTALL_DOCDIR=share/mysql/docs \ -DINSTALL_SHAREDIR=share/mysql \ -DWITH_READLINE=ON \ -DWITH_ZLIB=system \ -DWITH_SSL=system \ -DWITH_LIBWRAP=OFF \ -DWITH_EXTRA_CHARSETS=complex \ -DWITH_EMBEDDED_SERVER=ON \ -DWITH_ARCHIVE_STORAGE_ENGINE=1 \ -DWITH_BLACKHOLE_STORAGE_ENGINE=1 \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_PARTITION_STORAGE_ENGINE=1 \ -DWITH_TOKUDB_STORAGE_ENGINE=1 \ -DWITHOUT_EXAMPLE_STORAGE_ENGINE=1 \ -DWITHOUT_FEDERATED_STORAGE_ENGINE=1 \ -DWITHOUT_PBXT_STORAGE_ENGINE=1 \ Host: Arch Linux i686, Linux 3.17.6, gcc 4.9.2 Build chroot environment: Alpine Linux Edge x86, gcc 4.9.2, zlib 1.2.8, cmake 3.1.0, readline 6.3, libaio 0.3.110, jemalloc 3.6.0, glib 2.42, ncurses 5.9 and probably the most important: musl 1.1.5 (Alpine is a musl based distro). No, I'm doing a full build every time.
            Hide
            James-TR James Taylor added a comment -

            I'm having a look at the code... Would it be wise to add a conditional so this code is never reached under libc's other than GLIBC?

            Show
            James-TR James Taylor added a comment - I'm having a look at the code... Would it be wise to add a conditional so this code is never reached under libc's other than GLIBC?
            Hide
            James-TR James Taylor added a comment - - edited

            "os_stacktrace_print" is only declared if "#if defined (_linux_) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS"

            Pull Request: https://github.com/MariaDB/server/pull/14

            From 786033366991c1ea2b8a460585096ad8c6a18510 Mon Sep 17 00:00:00 2001
            From: James Taylor <james@jtaylor.id.au>
            Date: Sat, 27 Dec 2014 03:23:49 +0000
            Subject: [PATCH] Add fix for MDEV-7369
            
            See also https://mariadb.atlassian.net/browse/MDEV-7369
            ---
             storage/xtradb/include/os0stacktrace.h | 4 ++--
             storage/xtradb/srv/srv0start.cc        | 4 ++--
             2 files changed, 4 insertions(+), 4 deletions(-)
            
            diff --git a/storage/xtradb/include/os0stacktrace.h b/storage/xtradb/include/os0stacktrace.h
            index 58e9a52..e79347c 100644
            --- a/storage/xtradb/include/os0stacktrace.h
            +++ b/storage/xtradb/include/os0stacktrace.h
            @@ -20,7 +20,7 @@ this program; if not, write to the Free Software Foundation, Inc.,
             #ifndef os0stacktrace_h
             #define os0stacktrace_h
             
            -#ifdef __linux__
            +#if defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS
             #if HAVE_EXECINFO_H
             #include <execinfo.h>
             #endif
            @@ -40,5 +40,5 @@ os_stacktrace_print(
             	siginfo_t* info,     /*!< in: signal information */
             	void*      ucontext);/*!< in: signal context */
             
            -#endif /*  __linux__ */
            +#endif /* defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS */
             #endif /* os0stacktrace.h */
            diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc
            index 86bc8ce..c76cbb8 100644
            --- a/storage/xtradb/srv/srv0start.cc
            +++ b/storage/xtradb/srv/srv0start.cc
            @@ -1646,7 +1646,7 @@ innobase_start_or_create_for_mysql(void)
             	stacktrace feature. */
             
             	if (srv_use_stacktrace) {
            -#ifdef __linux__
            +#if defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS
             		 struct sigaction sigact;
             
             		 sigact.sa_sigaction = os_stacktrace_print;
            @@ -1659,7 +1659,7 @@ innobase_start_or_create_for_mysql(void)
             			 srv_use_stacktrace = FALSE;
             
             		 }
            -#endif /* __linux__ */
            +#endif /* defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS */
             	}
             
             #ifdef UNIV_DEBUG
            -- 
            2.2.0
            
            Show
            James-TR James Taylor added a comment - - edited "os_stacktrace_print" is only declared if "#if defined (_ linux _) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS" Pull Request: https://github.com/MariaDB/server/pull/14 From 786033366991c1ea2b8a460585096ad8c6a18510 Mon Sep 17 00:00:00 2001 From: James Taylor <james@jtaylor.id.au> Date: Sat, 27 Dec 2014 03:23:49 +0000 Subject: [PATCH] Add fix for MDEV-7369 See also https: //mariadb.atlassian.net/browse/MDEV-7369 --- storage/xtradb/include/os0stacktrace.h | 4 ++-- storage/xtradb/srv/srv0start.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/storage/xtradb/include/os0stacktrace.h b/storage/xtradb/include/os0stacktrace.h index 58e9a52..e79347c 100644 --- a/storage/xtradb/include/os0stacktrace.h +++ b/storage/xtradb/include/os0stacktrace.h @@ -20,7 +20,7 @@ this program; if not, write to the Free Software Foundation, Inc., #ifndef os0stacktrace_h #define os0stacktrace_h -#ifdef __linux__ +# if defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS # if HAVE_EXECINFO_H #include <execinfo.h> #endif @@ -40,5 +40,5 @@ os_stacktrace_print( siginfo_t* info, /*!< in: signal information */ void* ucontext);/*!< in: signal context */ -#endif /* __linux__ */ +#endif /* defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS */ #endif /* os0stacktrace.h */ diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc index 86bc8ce..c76cbb8 100644 --- a/storage/xtradb/srv/srv0start.cc +++ b/storage/xtradb/srv/srv0start.cc @@ -1646,7 +1646,7 @@ innobase_start_or_create_for_mysql(void) stacktrace feature. */ if (srv_use_stacktrace) { -#ifdef __linux__ +# if defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS struct sigaction sigact; sigact.sa_sigaction = os_stacktrace_print; @@ -1659,7 +1659,7 @@ innobase_start_or_create_for_mysql(void) srv_use_stacktrace = FALSE; } -#endif /* __linux__ */ +#endif /* defined (__linux__) && HAVE_BACKTRACE && HAVE_BACKTRACE_SYMBOLS */ } #ifdef UNIV_DEBUG -- 2.2.0
            Hide
            scadu Łukasz Jendrysik added a comment -

            @James Taylor, thanks for the patch!

            Show
            scadu Łukasz Jendrysik added a comment - @James Taylor, thanks for the patch!
            Hide
            James-TR James Taylor added a comment -

            It was a trivial fix once I found out where it was defined .

            All I did was copy the conditional to everywhere that used it

            Show
            James-TR James Taylor added a comment - It was a trivial fix once I found out where it was defined . All I did was copy the conditional to everywhere that used it
            Hide
            jplindst Jan Lindström added a comment -

            revno: 4398
            committer: Jan Lindström <jplindst@mariadb.org>
            branch nick: 5.5
            timestamp: Sun 2014-12-28 13:24:53 +0200
            message:
            MDEV-7369: MariaDB build fails when XTRADB_STORAGE_ENGINE enabled

            Patch by James Taylor.

            Show
            jplindst Jan Lindström added a comment - revno: 4398 committer: Jan Lindström <jplindst@mariadb.org> branch nick: 5.5 timestamp: Sun 2014-12-28 13:24:53 +0200 message: MDEV-7369 : MariaDB build fails when XTRADB_STORAGE_ENGINE enabled Patch by James Taylor.
            Hide
            jplindst Jan Lindström added a comment -

            revno: 4546
            committer: Jan Lindström <jplindst@mariadb.org>
            branch nick: 10.0-innodb
            timestamp: Sun 2014-12-28 13:44:30 +0200
            message:
            MDEV-7369: MariaDB build fails when XTRADB_STORAGE_ENGINE enabled

            Patch by James Taylor.

            Show
            jplindst Jan Lindström added a comment - revno: 4546 committer: Jan Lindström <jplindst@mariadb.org> branch nick: 10.0-innodb timestamp: Sun 2014-12-28 13:44:30 +0200 message: MDEV-7369 : MariaDB build fails when XTRADB_STORAGE_ENGINE enabled Patch by James Taylor.

              People

              • Assignee:
                jplindst Jan Lindström
                Reporter:
                scadu Łukasz Jendrysik
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: