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

mariadb-10.1.17 fails to build on Alpine Linux armhf

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.1.17
    • 10.1.18, 10.0.28
    • Compiling
    • None
    • Alpine Linux, armhf, 3.4-stable, gcc 5.3.0, musl libc.

    Description

      10.1.14 built fine but when upgrading to 10.1.17 for the security fixes it fails with:
       
      [ 75%] Building C object storage/maria/CMakeFiles/aria.dir/ma_control_file.c.o
      [ 75%] Building C object storage/maria/CMakeFiles/aria.dir/ma_loghandler.c.o
      [ 75%] Building CXX object storage/mroonga/CMakeFiles/mroonga.dir/lib/mrn_match_escalation_threshold_scope.cpp.o
      [ 75%] Building CXX object storage/mroonga/CMakeFiles/mroonga.dir/lib/mrn_path_mapper.cpp.o
      /home/buildozer/aports/main/mariadb/src/mariadb-10.1.17/sql/signal_handler.cc: In function 'void handle_fatal_signal(int)':
      /home/buildozer/aports/main/mariadb/src/mariadb-10.1.17/sql/signal_handler.cc:285:21: error: 'thd' was not declared in this scope
           my_write_stderr(thd->query(), MY_MIN(65536U, thd->query_length()));
                           ^
      libmysqld/CMakeFiles/sql_embedded.dir/build.make:590: recipe for target 'libmysqld/CMakeFiles/sql_embedded.dir/__/sql/signal_handler.cc.o' failed
      make[2]: *** [libmysqld/CMakeFiles/sql_embedded.dir/__/sql/signal_handler.cc.o] Error 1
      CMakeFiles/Makefile2:10207: recipe for target 'libmysqld/CMakeFiles/sql_embedded.dir/all' failed
      make[1]: *** [libmysqld/CMakeFiles/sql_embedded.dir/all] Error 2
      make[1]: *** Waiting for unfinished jobs....
      

      This happens only on armhf. x86 and x86_64 builds just fine.

      Attachments

        Issue Links

          Activity

            Seems it was introduced here:

            commit 7d4a7d8c5861e6587176052ea71c30ab12a49084
            Author: Vicențiu Ciorbaru <vicentiu@mariadb.org>
            Date:   Mon May 30 22:33:34 2016 +0300
             
                [MDEV-9127] Crash reporter often fails to show the query that crashed
                
                Addreses are not necessarily between heap_start && heap_end. Malloc
                calls using mmap can place pointers outside these bounds. In this case,
                we'll warn the user that the query pointer is potentially invalid.
                However, we'll attempt to print the data anyway after we're done
                printing everything else.
            

            Probably just needs a patch like this:

            diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc
            index 9dd3e53..f72eb67 100644
            --- a/sql/signal_handler.cc
            +++ b/sql/signal_handler.cc
            @@ -64,13 +64,13 @@ extern "C" sig_handler handle_fatal_signal(int sig)
               struct tm tm;
             #ifdef HAVE_STACKTRACE
               THD *thd;
            -#endif
               /*
                  This flag remembers if the query pointer was found invalid.
                  We will try and print the query at the end of the signal handler, in case
                  we're wrong.
               */
               bool print_invalid_query_pointer= false;
            +#endif
             
               if (segfaulted)
               {
            @@ -276,6 +276,7 @@ extern "C" sig_handler handle_fatal_signal(int sig)
                   "\"mlockall\" bugs.\n");
               }
             
            +#ifdef HAVE_STACKTRACE
               if (print_invalid_query_pointer)
               {
                 my_safe_printf_stderr(
            @@ -285,6 +286,7 @@ extern "C" sig_handler handle_fatal_signal(int sig)
                 my_write_stderr(thd->query(), MY_MIN(65536U, thd->query_length()));
                 my_safe_printf_stderr("\n\n");
               }
            +#endif
             
             #ifdef HAVE_WRITE_CORE
               if (test_flags & TEST_CORE_ON_SIGNAL)
            

            knielsen Kristian Nielsen added a comment - Seems it was introduced here: commit 7d4a7d8c5861e6587176052ea71c30ab12a49084 Author: VicenÈ›iu Ciorbaru <vicentiu@mariadb.org> Date: Mon May 30 22:33:34 2016 +0300   [MDEV-9127] Crash reporter often fails to show the query that crashed Addreses are not necessarily between heap_start && heap_end. Malloc calls using mmap can place pointers outside these bounds. In this case, we'll warn the user that the query pointer is potentially invalid. However, we'll attempt to print the data anyway after we're done printing everything else. Probably just needs a patch like this: diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc index 9dd3e53..f72eb67 100644 --- a/sql/signal_handler.cc +++ b/sql/signal_handler.cc @@ -64,13 +64,13 @@ extern "C" sig_handler handle_fatal_signal(int sig) struct tm tm; #ifdef HAVE_STACKTRACE THD *thd; -#endif /* This flag remembers if the query pointer was found invalid. We will try and print the query at the end of the signal handler, in case we're wrong. */ bool print_invalid_query_pointer= false; +#endif if (segfaulted) { @@ -276,6 +276,7 @@ extern "C" sig_handler handle_fatal_signal(int sig) "\"mlockall\" bugs.\n"); } +#ifdef HAVE_STACKTRACE if (print_invalid_query_pointer) { my_safe_printf_stderr( @@ -285,6 +286,7 @@ extern "C" sig_handler handle_fatal_signal(int sig) my_write_stderr(thd->query(), MY_MIN(65536U, thd->query_length())); my_safe_printf_stderr("\n\n"); } +#endif #ifdef HAVE_WRITE_CORE if (test_flags & TEST_CORE_ON_SIGNAL)

            already fixed, will be in 10.0.18

            serg Sergei Golubchik added a comment - already fixed, will be in 10.0.18
            max Floris added a comment -

            Could you also apply the fix to the 10.1 git branch instead of just 10.0?
            Thanks.

            max Floris added a comment - Could you also apply the fix to the 10.1 git branch instead of just 10.0? Thanks.

            max, of course. All 10.0 fixes will be merged into 10.1 before the next 10.1 release.

            serg Sergei Golubchik added a comment - max , of course. All 10.0 fixes will be merged into 10.1 before the next 10.1 release.

            People

              serg Sergei Golubchik
              ncopa Natanael Copa
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.