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

Non-blocking API missing on non-x86 platforms

    XMLWordPrintable

Details

    Description

      The non-blocking API is missing on non-x86 platforms. This is seen by error
      return from mysql_init(MYSQL_OPT_NONBLOCK, 0), and from null-pointer
      segfault on all subsequent non-blocking calls.

      The problem is that the HAVE_UCONTEXT_H check in CMake is propagated
      incorrectly to my_config.h, so my_context.h cannot see the availability of
      ucontext. ucontext is used as a fallback for platforms where no
      hand-crafted assembler version is available, such as ARM. Without ucontext
      fallback, the non-blocking API becomes disabled.

      A patch such as the following (tested on ARM) is needed:

      diff --git a/config.h.cmake b/config.h.cmake
      index 4030673..70b7518 100644
      --- a/config.h.cmake
      +++ b/config.h.cmake
      @@ -297,7 +297,7 @@
       #cmakedefine HAVE_THR_YIELD 1
       #cmakedefine HAVE_TIME 1
       #cmakedefine HAVE_TIMES 1
      -#cmakedefine HAVE_UCONTEXT 1
      +#cmakedefine HAVE_UCONTEXT_H 1
       #cmakedefine HAVE_VALLOC 1
       #cmakedefine HAVE_VIDATTR 1
       #define HAVE_VIO_READ_BUFF 1
      diff --git a/include/my_context.h b/include/my_context.h
      index 1bf13fd..976ed98 100644
      --- a/include/my_context.h
      +++ b/include/my_context.h
      @@ -31,7 +31,7 @@
       #define MY_CONTEXT_USE_X86_64_GCC_ASM
       #elif defined(__GNUC__) && __GNUC__ >= 3 && defined(__i386__)
       #define MY_CONTEXT_USE_I386_GCC_ASM
      -#elif defined(HAVE_UCONTEXT)
      +#elif defined(HAVE_UCONTEXT_H)
       #define MY_CONTEXT_USE_UCONTEXT
       #else
       #define MY_CONTEXT_DISABLE

      Attachments

        Activity

          People

            knielsen Kristian Nielsen
            knielsen Kristian Nielsen
            Votes:
            0 Vote for this issue
            Watchers:
            0 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.