[MDEV-10858] mariadb-10.1.17 fails to build on Alpine Linux armhf Created: 2016-09-21  Updated: 2016-09-26  Resolved: 2016-09-21

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.1.17
Fix Version/s: 10.1.18, 10.0.28

Type: Bug Priority: Major
Reporter: Natanael Copa Assignee: Sergei Golubchik
Resolution: Duplicate Votes: 0
Labels: None
Environment:

Alpine Linux, armhf, 3.4-stable, gcc 5.3.0, musl libc.


Attachments: File mariadb-10.1.17-r0.log    
Issue Links:
PartOf
includes MDEV-10531 Compilation issue introduced by MDEV-... Closed

 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.



 Comments   
Comment by Kristian Nielsen [ 2016-09-21 ]

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)

Comment by Sergei Golubchik [ 2016-09-21 ]

already fixed, will be in 10.0.18

Comment by Floris [ 2016-09-22 ]

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

Comment by Sergei Golubchik [ 2016-09-26 ]

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

Generated at Thu Feb 08 07:45:28 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.