[MDEV-9441] Non-blocking API missing on non-x86 platforms Created: 2016-01-21  Updated: 2016-02-01  Resolved: 2016-02-01

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 5.5, 10.0, 10.1
Fix Version/s: 5.5.48, 10.0.24, 10.1.12

Type: Bug Priority: Major
Reporter: Kristian Nielsen Assignee: Kristian Nielsen
Resolution: Duplicate Votes: 0
Labels: asyn


 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



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

Hm, looks like this was already reported as MDEV-9112

Comment by Kristian Nielsen [ 2016-02-01 ]

Duplicate of MDEV-9112

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