* [Tarantool-patches] [PATCH 01/11] build: introduce openbsd build target
2020-05-12 12:32 [Tarantool-patches] [PATCH 00/11] Add OpenBSD support sergeyb
@ 2020-05-12 12:32 ` sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 02/11] build: test pthread_stackseg_np() on OpenBSD sergeyb
` (11 subsequent siblings)
12 siblings, 0 replies; 15+ messages in thread
From: sergeyb @ 2020-05-12 12:32 UTC (permalink / raw)
To: tarantool-patches; +Cc: o.piskunov
From: Sergey Bronnikov <sergeyb@tarantool.org>
Part of #4967
---
cmake/os.cmake | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/cmake/os.cmake b/cmake/os.cmake
index cf6eac10d..905be61df 100644
--- a/cmake/os.cmake
+++ b/cmake/os.cmake
@@ -69,6 +69,10 @@ elseif (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "NetBSD")
set(TARGET_OS_NETBSD 1)
find_package_message(PLATFORM "Building for NetBSD" "${CMAKE_SYSTEM_NAME}")
+elseif (${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
+ set(TARGET_OS_OPENBSD 1)
+ set(TARGET_OS_FREEBSD 1)
+ find_package_message(PLATFORM "Building for OpenBSD" "${CMAKE_SYSTEM_NAME}")
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(TARGET_OS_DARWIN 1)
--
2.23.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Tarantool-patches] [PATCH 02/11] build: test pthread_stackseg_np() on OpenBSD
2020-05-12 12:32 [Tarantool-patches] [PATCH 00/11] Add OpenBSD support sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 01/11] build: introduce openbsd build target sergeyb
@ 2020-05-12 12:32 ` sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 03/11] build: skip linking with -ldl " sergeyb
` (10 subsequent siblings)
12 siblings, 0 replies; 15+ messages in thread
From: sergeyb @ 2020-05-12 12:32 UTC (permalink / raw)
To: tarantool-patches; +Cc: o.piskunov
From: Sergey Bronnikov <sergeyb@tarantool.org>
Part of #4967
---
cmake/thread.cmake | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/cmake/thread.cmake b/cmake/thread.cmake
index 29b1da5f2..d51e6212e 100644
--- a/cmake/thread.cmake
+++ b/cmake/thread.cmake
@@ -32,6 +32,17 @@ function (do_pthread_checks)
${INCLUDE_MISC_PTHREAD_HEADERS}
int main() { pthread_attr_t a; pthread_getattr_np(pthread_self(), &a); }
" HAVE_PTHREAD_GETATTR_NP)
+ # pthread_stackseg_np - OpenBSD
+ check_c_source_compiles("
+ #include <pthread.h>
+ #ifdef __OpenBSD__
+ #include <sys/signal.h>
+ #include <pthread_np.h>
+ #endif
+ ${INCLUDE_MISC_PTHREAD_HEADERS}
+ stack_t ss;
+ int main() { pthread_stackseg_np(pthread_self(), &ss);
+ " HAVE_PTHREAD_STACKSEG_NP)
# pthread_attr_get_np - xBSD/macOS
check_c_source_compiles("
#include <pthread.h>
--
2.23.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Tarantool-patches] [PATCH 03/11] build: skip linking with -ldl on OpenBSD
2020-05-12 12:32 [Tarantool-patches] [PATCH 00/11] Add OpenBSD support sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 01/11] build: introduce openbsd build target sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 02/11] build: test pthread_stackseg_np() on OpenBSD sergeyb
@ 2020-05-12 12:32 ` sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 04/11] Fix building of tt_pthread_attr_getstack() " sergeyb
` (9 subsequent siblings)
12 siblings, 0 replies; 15+ messages in thread
From: sergeyb @ 2020-05-12 12:32 UTC (permalink / raw)
To: tarantool-patches; +Cc: o.piskunov
From: Sergey Bronnikov <sergeyb@tarantool.org>
OpenBSD includes DL library in a base system
Part of #4967
---
cmake/BuildMisc.cmake | 2 +-
cmake/FindCURL.cmake | 2 +-
cmake/FindICU.cmake | 2 +-
src/CMakeLists.txt | 8 +++++---
test/unit/CMakeLists.txt | 16 ++++++++++------
5 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/cmake/BuildMisc.cmake b/cmake/BuildMisc.cmake
index 0c571f326..b4a3ca1fc 100644
--- a/cmake/BuildMisc.cmake
+++ b/cmake/BuildMisc.cmake
@@ -39,7 +39,7 @@ macro(libmisc_build)
else()
set(GOMP_LIBRARY gomp)
endif()
- target_link_libraries(misc ${GOMP_LIBRARY} pthread dl)
+ target_link_libraries(misc ${GOMP_LIBRARY} pthread)
endif()
unset(misc_src)
diff --git a/cmake/FindCURL.cmake b/cmake/FindCURL.cmake
index 6193a58ad..fa20717aa 100644
--- a/cmake/FindCURL.cmake
+++ b/cmake/FindCURL.cmake
@@ -35,7 +35,7 @@ set(DL_LIB_NAME dl)
find_library(Z_LIBRARY NAMES ${Z_LIB_NAME})
find_library(NGHTTP2_LIBRARY NAMES ${NGHTTP2_LIB_NAME})
find_library(PTHREAD_LIBRARY NAMES ${PTHREAD_LIB_NAME})
-find_library(DL_LIBRARY NAMES ${DL_LIB_NAME})
+#find_library(DL_LIBRARY NAMES ${DL_LIB_NAME})
if(DEFINED CURL_ROOT)
set(CURL_FIND_OPTS NO_CMAKE NO_CMAKE_SYSTEM_PATH)
diff --git a/cmake/FindICU.cmake b/cmake/FindICU.cmake
index 2bb9a5d59..26f0683f3 100644
--- a/cmake/FindICU.cmake
+++ b/cmake/FindICU.cmake
@@ -50,7 +50,7 @@ include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ICU
REQUIRED_VARS ICU_INCLUDE_DIR ICU_LIBRARY_I18N ICU_LIBRARY_UC)
set(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR})
-set(ICU_LIBRARIES ${ICU_LIBRARY_I18N} ${ICU_LIBRARY_UC} ${ICU_LIBRARY_DATA} dl)
+set(ICU_LIBRARIES ${ICU_LIBRARY_I18N} ${ICU_LIBRARY_UC} ${ICU_LIBRARY_DATA})
mark_as_advanced(ICU_INCLUDE_DIR ICU_INCLUDE_DIRS
ICU_LIBRARY_I18N ICU_LIBRARY_UC ICU_LIBRARIES)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2b5ea1b87..79a1b45cc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -71,9 +71,11 @@ set_property(DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${lua_sources})
#
# Always links pthread and dl dynamically.
set(generic_libraries pthread)
-find_library(DL_LIBRARY NAMES dl)
-if(NOT "${DL_LIBRARY}" STREQUAL "DL_LIBRARY-NOTFOUND")
- set(generic_libraries ${generic_libraries} dl)
+if(NOT TARGET_OS_OPENBSD)
+ find_library(DL_LIBRARY NAMES dl)
+ if(NOT "${DL_LIBRARY}" STREQUAL "DL_LIBRARY-NOTFOUND")
+ set(generic_libraries ${generic_libraries} dl)
+ endif()
endif()
add_library(stat STATIC rmean.c latency.c histogram.c)
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
index 84eb066bd..3bdfc6bb1 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -5,6 +5,10 @@ endif()
file(GLOB all_sources *.c *.cc)
set_source_files_compile_flags(${all_sources})
+if(NOT TARGET_OS_OPENBSD)
+ set(LIB_DL "dl")
+endif()
+
include_directories(${PROJECT_SOURCE_DIR}/src)
include_directories(${PROJECT_BINARY_DIR}/src)
include_directories(${PROJECT_SOURCE_DIR}/src/box)
@@ -161,7 +165,7 @@ target_link_libraries(luaT_tuple_new.test unit box server core misc
add_executable(luaL_iterator.test luaL_iterator.c)
target_link_libraries(luaL_iterator.test unit server coll core misc
${CURL_LIBRARIES} ${LIBYAML_LIBRARIES} ${READLINE_LIBRARIES}
- ${ICU_LIBRARIES} ${LUAJIT_LIBRARIES} dl)
+ ${ICU_LIBRARIES} ${LUAJIT_LIBRARIES} ${LIB_DL})
add_executable(say.test say.c)
target_link_libraries(say.test core unit)
@@ -176,7 +180,7 @@ set(ITERATOR_TEST_SOURCES
set(ITERATOR_TEST_LIBS core tuple xrow unit)
add_executable(vy_mem.test vy_mem.c ${ITERATOR_TEST_SOURCES})
-target_link_libraries(vy_mem.test ${ITERATOR_TEST_LIBS} dl)
+target_link_libraries(vy_mem.test ${ITERATOR_TEST_LIBS} ${LIB_DL})
add_executable(vy_point_lookup.test
vy_point_lookup.c
@@ -198,7 +202,7 @@ add_executable(vy_point_lookup.test
${PROJECT_SOURCE_DIR}/src/box/schema_def.c
${PROJECT_SOURCE_DIR}/src/box/identifier.c
)
-target_link_libraries(vy_point_lookup.test core tuple xrow xlog unit dl)
+target_link_libraries(vy_point_lookup.test core tuple xrow xlog unit ${LIB_DL})
add_executable(column_mask.test
column_mask.c)
@@ -211,13 +215,13 @@ add_executable(vy_write_iterator.test
${PROJECT_SOURCE_DIR}/src/box/vy_write_iterator.c
${ITERATOR_TEST_SOURCES}
)
-target_link_libraries(vy_write_iterator.test xlog ${ITERATOR_TEST_LIBS} dl)
+target_link_libraries(vy_write_iterator.test xlog ${ITERATOR_TEST_LIBS} ${LIB_DL})
add_executable(vy_cache.test vy_cache.c ${ITERATOR_TEST_SOURCES})
-target_link_libraries(vy_cache.test ${ITERATOR_TEST_LIBS} dl)
+target_link_libraries(vy_cache.test ${ITERATOR_TEST_LIBS} ${LIB_DL})
add_executable(coll.test coll.cpp)
-target_link_libraries(coll.test coll unit misc dl)
+target_link_libraries(coll.test coll unit misc ${LIB_DL})
add_executable(tuple_bigref.test tuple_bigref.c)
target_link_libraries(tuple_bigref.test tuple unit)
--
2.23.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Tarantool-patches] [PATCH 04/11] Fix building of tt_pthread_attr_getstack() on OpenBSD
2020-05-12 12:32 [Tarantool-patches] [PATCH 00/11] Add OpenBSD support sergeyb
` (2 preceding siblings ...)
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 03/11] build: skip linking with -ldl " sergeyb
@ 2020-05-12 12:32 ` sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 05/11] sql: use mremap() " sergeyb
` (8 subsequent siblings)
12 siblings, 0 replies; 15+ messages in thread
From: sergeyb @ 2020-05-12 12:32 UTC (permalink / raw)
To: tarantool-patches; +Cc: o.piskunov
From: Sergey Bronnikov <sergeyb@tarantool.org>
Part of #4967
---
src/tt_pthread.h | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/tt_pthread.h b/src/tt_pthread.h
index 6bb19eb23..70f605091 100644
--- a/src/tt_pthread.h
+++ b/src/tt_pthread.h
@@ -37,9 +37,13 @@
#include <stdio.h>
#include <errno.h>
#include <pthread.h>
-#if HAVE_PTHREAD_NP_H
+#if HAVE_PTHREAD_NP_H || (__OpenBSD__)
#include <pthread_np.h>
#endif
+#if (__OpenBSD__)
+#include <signal.h>
+#include <sys/signal.h>
+#endif
#include "say.h"
/**
@@ -358,6 +362,11 @@ tt_pthread_attr_getstack(pthread_t thread, void **stackaddr, size_t *stacksize)
/* Old macOS */
*stacksize = pthread_get_stacksize_np(thread);
*stackaddr = pthread_get_stackaddr_np(thread);
+#elif (__OpenBSD__)
+ stack_t *sinfo = (stack_t*)malloc(sizeof(stack_t));
+ pthread_stackseg_np(thread, sinfo);
+ *stacksize = sinfo->ss_size;
+ *stackaddr = sinfo->ss_sp;
#else
#error Unable to get thread stack
#endif
--
2.23.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Tarantool-patches] [PATCH 05/11] sql: use mremap() on OpenBSD
2020-05-12 12:32 [Tarantool-patches] [PATCH 00/11] Add OpenBSD support sergeyb
` (3 preceding siblings ...)
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 04/11] Fix building of tt_pthread_attr_getstack() " sergeyb
@ 2020-05-12 12:32 ` sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 06/11] Include libgen.h when building " sergeyb
` (7 subsequent siblings)
12 siblings, 0 replies; 15+ messages in thread
From: sergeyb @ 2020-05-12 12:32 UTC (permalink / raw)
To: tarantool-patches; +Cc: o.piskunov
From: Sergey Bronnikov <sergeyb@tarantool.org>
Part of #4967
---
src/box/sql/os_unix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/box/sql/os_unix.c b/src/box/sql/os_unix.c
index 683a71d00..b351c5500 100644
--- a/src/box/sql/os_unix.c
+++ b/src/box/sql/os_unix.c
@@ -1102,7 +1102,7 @@ unixRemapfile(unixFile * pFd, /* File descriptor object */
/* Unmap any pages of the existing mapping that cannot be reused. */
if (nReuse != nOrig)
munmap(pReq, nOrig - nReuse);
- #if !defined(__APPLE__) && !defined(__FreeBSD__)
+ #if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__)
pNew = mremap(pOrig, nReuse, nNew, MREMAP_MAYMOVE);
#else
pNew = mmap(pReq, nNew - nReuse, flags, MAP_SHARED, h, nReuse);
--
2.23.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Tarantool-patches] [PATCH 06/11] Include libgen.h when building on OpenBSD
2020-05-12 12:32 [Tarantool-patches] [PATCH 00/11] Add OpenBSD support sergeyb
` (4 preceding siblings ...)
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 05/11] sql: use mremap() " sergeyb
@ 2020-05-12 12:32 ` sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 07/11] say: fix compilation " sergeyb
` (6 subsequent siblings)
12 siblings, 0 replies; 15+ messages in thread
From: sergeyb @ 2020-05-12 12:32 UTC (permalink / raw)
To: tarantool-patches; +Cc: o.piskunov
From: Sergey Bronnikov <sergeyb@tarantool.org>
Part of #4967
---
src/lua/init.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lua/init.c b/src/lua/init.c
index 5b4b5b463..a0b2fc775 100644
--- a/src/lua/init.c
+++ b/src/lua/init.c
@@ -31,7 +31,7 @@
#include "lua/init.h"
#include "lua/utils.h"
#include "main.h"
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(__OpenBSD__)
#include <libgen.h>
#endif
--
2.23.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Tarantool-patches] [PATCH 07/11] say: fix compilation on OpenBSD
2020-05-12 12:32 [Tarantool-patches] [PATCH 00/11] Add OpenBSD support sergeyb
` (5 preceding siblings ...)
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 06/11] Include libgen.h when building " sergeyb
@ 2020-05-12 12:32 ` sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 08/11] test: mute broken tests " sergeyb
` (5 subsequent siblings)
12 siblings, 0 replies; 15+ messages in thread
From: sergeyb @ 2020-05-12 12:32 UTC (permalink / raw)
To: tarantool-patches; +Cc: o.piskunov
From: Sergey Bronnikov <sergeyb@tarantool.org>
- define macros LOG_MAKEPRI() on OpenBSD as it is absent
- replace sigtimedwait() by sigwait() as latter is unsupported on OpenBSD
Part of #4967
---
src/lib/core/say.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/lib/core/say.c b/src/lib/core/say.c
index 8c000b4b1..7116883d4 100644
--- a/src/lib/core/say.c
+++ b/src/lib/core/say.c
@@ -434,10 +434,19 @@ log_pipe_init(struct log *log, const char *init_str)
struct timespec timeout;
timeout.tv_sec = 0;
timeout.tv_nsec = 1; /* Mostly to trigger preemption. */
+#if defined(__OpenBSD__)
+ int sig = 0;
+ sigwait(&mask, &sig);
+ if (sig ==SIGCHLD) {
+ diag_set(IllegalParams, "logger process died");
+ return -1;
+ }
+#else
if (sigtimedwait(&mask, NULL, &timeout) == SIGCHLD) {
diag_set(IllegalParams, "logger process died");
return -1;
}
+#endif
#endif
/* OK, let's hope for the best. */
sigprocmask(SIG_UNBLOCK, &mask, NULL);
@@ -945,6 +954,9 @@ say_format_syslog(struct log *log, char *buf, int len, int level, const char *fi
/* Format syslog header according to RFC */
int prio = level_to_syslog_priority(level);
+#if defined(__OpenBSD__)
+#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
+#endif
SNPRINT(total, snprintf, buf, len, "<%d>",
LOG_MAKEPRI(8 * log->syslog_facility, prio));
SNPRINT(total, strftime, buf, len, "%h %e %T ", &tm);
--
2.23.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Tarantool-patches] [PATCH 08/11] test: mute broken tests on OpenBSD
2020-05-12 12:32 [Tarantool-patches] [PATCH 00/11] Add OpenBSD support sergeyb
` (6 preceding siblings ...)
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 07/11] say: fix compilation " sergeyb
@ 2020-05-12 12:32 ` sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 09/11] Add README.OpenBSD sergeyb
` (4 subsequent siblings)
12 siblings, 0 replies; 15+ messages in thread
From: sergeyb @ 2020-05-12 12:32 UTC (permalink / raw)
To: tarantool-patches; +Cc: o.piskunov
From: Sergey Bronnikov <sergeyb@tarantool.org>
Part of #4967
---
test/app-tap/fail_main.skipcond | 7 +++++++
test/app-tap/http_client.skipcond | 4 ++++
test/app-tap/popen.skipcond | 7 +++++++
test/app/cmdline.skipcond | 7 +++++++
test/app/crypto.skipcond | 4 ++--
test/app/digest.skipcond | 4 ++--
test/app/fiber.skipcond | 7 +++++++
test/app/fiber_channel.skipcond | 7 +++++++
test/app/socket.skipcond | 26 +++-----------------------
test/box-py/args.test.py | 6 ++++++
test/box-tap/cfg.skipcond | 4 ++++
test/box/cfg.skipcond | 7 +++++++
test/box/net.box.skipcond | 4 ++--
test/box/net_msg_max.skipcond | 4 ++--
test/box/schema_reload.skipcond | 7 +++++++
test/box/tuple.skipcond | 7 +++++++
test/replication/sync.skipcond | 7 +++++++
test/wal_off/snapshot_stress.skipcond | 4 ++++
18 files changed, 92 insertions(+), 31 deletions(-)
create mode 100644 test/app-tap/fail_main.skipcond
create mode 100644 test/app-tap/popen.skipcond
create mode 100644 test/app/cmdline.skipcond
create mode 100644 test/app/fiber.skipcond
create mode 100644 test/app/fiber_channel.skipcond
create mode 100644 test/box/cfg.skipcond
create mode 100644 test/box/schema_reload.skipcond
create mode 100644 test/box/tuple.skipcond
create mode 100644 test/replication/sync.skipcond
diff --git a/test/app-tap/fail_main.skipcond b/test/app-tap/fail_main.skipcond
new file mode 100644
index 000000000..9c1ca22b1
--- /dev/null
+++ b/test/app-tap/fail_main.skipcond
@@ -0,0 +1,7 @@
+import platform
+
+# Disabled on OpenBSD due to fail #XXXX.
+if platform.system() == 'OpenBSD':
+ self.skip = 1
+
+# vim: set ft=python:
diff --git a/test/app-tap/http_client.skipcond b/test/app-tap/http_client.skipcond
index 48e17903e..108e776c4 100644
--- a/test/app-tap/http_client.skipcond
+++ b/test/app-tap/http_client.skipcond
@@ -4,4 +4,8 @@ import platform
if platform.system() == 'FreeBSD':
self.skip = 1
+# Disabled on OpenBSD due to fail #XXXX.
+if platform.system() == 'OpenBSD':
+ self.skip = 1
+
# vim: set ft=python:
diff --git a/test/app-tap/popen.skipcond b/test/app-tap/popen.skipcond
new file mode 100644
index 000000000..9c1ca22b1
--- /dev/null
+++ b/test/app-tap/popen.skipcond
@@ -0,0 +1,7 @@
+import platform
+
+# Disabled on OpenBSD due to fail #XXXX.
+if platform.system() == 'OpenBSD':
+ self.skip = 1
+
+# vim: set ft=python:
diff --git a/test/app/cmdline.skipcond b/test/app/cmdline.skipcond
new file mode 100644
index 000000000..9c1ca22b1
--- /dev/null
+++ b/test/app/cmdline.skipcond
@@ -0,0 +1,7 @@
+import platform
+
+# Disabled on OpenBSD due to fail #XXXX.
+if platform.system() == 'OpenBSD':
+ self.skip = 1
+
+# vim: set ft=python:
diff --git a/test/app/crypto.skipcond b/test/app/crypto.skipcond
index 48e17903e..9c1ca22b1 100644
--- a/test/app/crypto.skipcond
+++ b/test/app/crypto.skipcond
@@ -1,7 +1,7 @@
import platform
-# Disabled on FreeBSD due to flaky fail #4271.
-if platform.system() == 'FreeBSD':
+# Disabled on OpenBSD due to fail #XXXX.
+if platform.system() == 'OpenBSD':
self.skip = 1
# vim: set ft=python:
diff --git a/test/app/digest.skipcond b/test/app/digest.skipcond
index 48e17903e..9c1ca22b1 100644
--- a/test/app/digest.skipcond
+++ b/test/app/digest.skipcond
@@ -1,7 +1,7 @@
import platform
-# Disabled on FreeBSD due to flaky fail #4271.
-if platform.system() == 'FreeBSD':
+# Disabled on OpenBSD due to fail #XXXX.
+if platform.system() == 'OpenBSD':
self.skip = 1
# vim: set ft=python:
diff --git a/test/app/fiber.skipcond b/test/app/fiber.skipcond
new file mode 100644
index 000000000..9c1ca22b1
--- /dev/null
+++ b/test/app/fiber.skipcond
@@ -0,0 +1,7 @@
+import platform
+
+# Disabled on OpenBSD due to fail #XXXX.
+if platform.system() == 'OpenBSD':
+ self.skip = 1
+
+# vim: set ft=python:
diff --git a/test/app/fiber_channel.skipcond b/test/app/fiber_channel.skipcond
new file mode 100644
index 000000000..9c1ca22b1
--- /dev/null
+++ b/test/app/fiber_channel.skipcond
@@ -0,0 +1,7 @@
+import platform
+
+# Disabled on OpenBSD due to fail #XXXX.
+if platform.system() == 'OpenBSD':
+ self.skip = 1
+
+# vim: set ft=python:
diff --git a/test/app/socket.skipcond b/test/app/socket.skipcond
index 774b7e01a..9c1ca22b1 100644
--- a/test/app/socket.skipcond
+++ b/test/app/socket.skipcond
@@ -1,27 +1,7 @@
-
-# vim: set ft=python :
-import re
-import os.path
-import socket
-import os
-import tempfile
import platform
-test_dir = tempfile.mkdtemp(prefix='tarantool-test-socket')
-test_path = os.path.join(test_dir, 'socket')
-
-s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
-try:
- s.bind(test_path)
-except:
+# Disabled on OpenBSD due to fail #XXXX.
+if platform.system() == 'OpenBSD':
self.skip = 1
-s.close()
-
-if os.path.exists(test_path):
- os.remove(test_path)
- os.rmdir(test_dir)
-
-# Disabled on FreeBSD due to flaky fail #4271.
-if platform.system() == 'FreeBSD':
- self.skip = 1
+# vim: set ft=python:
diff --git a/test/box-py/args.test.py b/test/box-py/args.test.py
index f89c5bb09..c0fac9038 100644
--- a/test/box-py/args.test.py
+++ b/test/box-py/args.test.py
@@ -2,6 +2,12 @@ import sys
import os
import re
+# Disabled on OpenBSD due to fail #XXXX.
+import platform
+
+if platform.system() == 'OpenBSD':
+ self.skip = 1
+
# mask BFD warnings: https://bugs.launchpad.net/tarantool/+bug/1018356
sys.stdout.push_filter("unable to read unknown load command 0x2\d+", "")
server.test_option("--help")
diff --git a/test/box-tap/cfg.skipcond b/test/box-tap/cfg.skipcond
index 7950a5d93..33cafc12b 100644
--- a/test/box-tap/cfg.skipcond
+++ b/test/box-tap/cfg.skipcond
@@ -5,4 +5,8 @@ import platform
if platform.system() == 'FreeBSD':
self.skip = 1
+# Disabled on OpenBSD due to fail #XXXX:
+if platform.system() == 'OpenBSD':
+ self.skip = 1
+
# vim: set ft=python:
diff --git a/test/box/cfg.skipcond b/test/box/cfg.skipcond
new file mode 100644
index 000000000..9c1ca22b1
--- /dev/null
+++ b/test/box/cfg.skipcond
@@ -0,0 +1,7 @@
+import platform
+
+# Disabled on OpenBSD due to fail #XXXX.
+if platform.system() == 'OpenBSD':
+ self.skip = 1
+
+# vim: set ft=python:
diff --git a/test/box/net.box.skipcond b/test/box/net.box.skipcond
index 48e17903e..9c1ca22b1 100644
--- a/test/box/net.box.skipcond
+++ b/test/box/net.box.skipcond
@@ -1,7 +1,7 @@
import platform
-# Disabled on FreeBSD due to flaky fail #4271.
-if platform.system() == 'FreeBSD':
+# Disabled on OpenBSD due to fail #XXXX.
+if platform.system() == 'OpenBSD':
self.skip = 1
# vim: set ft=python:
diff --git a/test/box/net_msg_max.skipcond b/test/box/net_msg_max.skipcond
index 48e17903e..9c1ca22b1 100644
--- a/test/box/net_msg_max.skipcond
+++ b/test/box/net_msg_max.skipcond
@@ -1,7 +1,7 @@
import platform
-# Disabled on FreeBSD due to flaky fail #4271.
-if platform.system() == 'FreeBSD':
+# Disabled on OpenBSD due to fail #XXXX.
+if platform.system() == 'OpenBSD':
self.skip = 1
# vim: set ft=python:
diff --git a/test/box/schema_reload.skipcond b/test/box/schema_reload.skipcond
new file mode 100644
index 000000000..9c1ca22b1
--- /dev/null
+++ b/test/box/schema_reload.skipcond
@@ -0,0 +1,7 @@
+import platform
+
+# Disabled on OpenBSD due to fail #XXXX.
+if platform.system() == 'OpenBSD':
+ self.skip = 1
+
+# vim: set ft=python:
diff --git a/test/box/tuple.skipcond b/test/box/tuple.skipcond
new file mode 100644
index 000000000..9c1ca22b1
--- /dev/null
+++ b/test/box/tuple.skipcond
@@ -0,0 +1,7 @@
+import platform
+
+# Disabled on OpenBSD due to fail #XXXX.
+if platform.system() == 'OpenBSD':
+ self.skip = 1
+
+# vim: set ft=python:
diff --git a/test/replication/sync.skipcond b/test/replication/sync.skipcond
new file mode 100644
index 000000000..9c1ca22b1
--- /dev/null
+++ b/test/replication/sync.skipcond
@@ -0,0 +1,7 @@
+import platform
+
+# Disabled on OpenBSD due to fail #XXXX.
+if platform.system() == 'OpenBSD':
+ self.skip = 1
+
+# vim: set ft=python:
diff --git a/test/wal_off/snapshot_stress.skipcond b/test/wal_off/snapshot_stress.skipcond
index 48e17903e..108e776c4 100644
--- a/test/wal_off/snapshot_stress.skipcond
+++ b/test/wal_off/snapshot_stress.skipcond
@@ -4,4 +4,8 @@ import platform
if platform.system() == 'FreeBSD':
self.skip = 1
+# Disabled on OpenBSD due to fail #XXXX.
+if platform.system() == 'OpenBSD':
+ self.skip = 1
+
# vim: set ft=python:
--
2.23.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Tarantool-patches] [PATCH 09/11] Add README.OpenBSD
2020-05-12 12:32 [Tarantool-patches] [PATCH 00/11] Add OpenBSD support sergeyb
` (7 preceding siblings ...)
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 08/11] test: mute broken tests " sergeyb
@ 2020-05-12 12:32 ` sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 10/11] Mention OpenBSD as supported platorm sergeyb
` (3 subsequent siblings)
12 siblings, 0 replies; 15+ messages in thread
From: sergeyb @ 2020-05-12 12:32 UTC (permalink / raw)
To: tarantool-patches; +Cc: o.piskunov
From: Sergey Bronnikov <sergeyb@tarantool.org>
Part of #4967
---
README.OpenBSD | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
create mode 100644 README.OpenBSD
diff --git a/README.OpenBSD b/README.OpenBSD
new file mode 100644
index 000000000..29c7c17a4
--- /dev/null
+++ b/README.OpenBSD
@@ -0,0 +1,40 @@
+Target OS: OpenBSD 6.6 amd64
+
+1. Install necessary packages
+-----------------------------
+pkg_add git m4 curl cmake gmake autoconf automake
+export AUTOMAKE_VERSION=XXX
+export AUTOCONF_VERSION=YYY
+
+2. Download & build tarantool source code
+-----------------------------------------
+
+git clone git://github.com/tarantool/tarantool.git
+
+cd tarantool
+git submodule update --init --recursive
+mkdir build && cd build
+cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_BUNDLED_LIBCURL=OFF ..
+gmake -j
+
+3. Set up python 2.7
+--------------------
+
+Install testing dependences either from packages or from pip.
+
+3.1. From packages:
+-------------------
+pkg_add python-2.7.16 py-gevent py-yaml py-msgpack
+
+3.2. From pip:
+--------------
+pkg_add py-virtualenv
+virtualenv .venv
+source .venv/bin/activate
+pip install -r ../test-run/requirements.txt
+
+4. Run tarantool test suite
+---------------------------
+gmake test
+
+-- EOF
--
2.23.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Tarantool-patches] [PATCH 10/11] Mention OpenBSD as supported platorm
2020-05-12 12:32 [Tarantool-patches] [PATCH 00/11] Add OpenBSD support sergeyb
` (8 preceding siblings ...)
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 09/11] Add README.OpenBSD sergeyb
@ 2020-05-12 12:32 ` sergeyb
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 11/11][small] Add MAP_STACK to mmap() flags sergeyb
` (2 subsequent siblings)
12 siblings, 0 replies; 15+ messages in thread
From: sergeyb @ 2020-05-12 12:32 UTC (permalink / raw)
To: tarantool-patches; +Cc: o.piskunov
From: Sergey Bronnikov <sergeyb@tarantool.org>
Part of #4967
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index f9740952e..410163eb4 100644
--- a/README.md
+++ b/README.md
@@ -39,7 +39,7 @@ Key features of the database:
* the database is just a C extension to the
application server and can be turned off
-Supported platforms are Linux/x86 and FreeBSD/x86, Mac OS X.
+Supported platforms are Linux/x86, FreeBSD/x86 and OpenBSD/x86, Mac OS X.
Tarantool is ideal for data-enriched components of
scalable Web architecture: queue servers, caches,
--
2.23.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Tarantool-patches] [PATCH 11/11][small] Add MAP_STACK to mmap() flags
2020-05-12 12:32 [Tarantool-patches] [PATCH 00/11] Add OpenBSD support sergeyb
` (9 preceding siblings ...)
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 10/11] Mention OpenBSD as supported platorm sergeyb
@ 2020-05-12 12:32 ` sergeyb
2020-05-18 18:22 ` [Tarantool-patches] [PATCH 00/11] Add OpenBSD support Cyrill Gorcunov
2020-05-20 6:41 ` Kirill Yukhin
12 siblings, 0 replies; 15+ messages in thread
From: sergeyb @ 2020-05-12 12:32 UTC (permalink / raw)
To: tarantool-patches; +Cc: o.piskunov
From: Sergey Bronnikov <sergeyb@tarantool.org>
OpenBSD enabled enforcing that the user stack pointer pointed to a
region of memory that had been mapped as a stack, see [1] for the
details. The upshot of this is that when usermode software wants to
allocate a stack, the region it's going to use must be mapped with the
MAP_STACK flag; if not, entry to the kernel will trap this and generate
a signal to kill the process.
Part of [2]
[1] https://undeadly.org/cgi?action=article;sid=20180310000858
[2] https://github.com/tarantool/tarantool/issues/4967
---
small/features.c | 4 ++++
small/slab_arena.c | 7 +++++++
2 files changed, 11 insertions(+)
diff --git a/small/features.c b/small/features.c
index 3adadae..bece95a 100644
--- a/small/features.c
+++ b/small/features.c
@@ -72,7 +72,11 @@ test_dontdump(void)
* and work on it.
*/
+#if defined(__OpenBSD__)
+ ptr = mmap(NULL, size, PROT_READ, MAP_ANONYMOUS | MAP_PRIVATE | MAP_STACK, -1, 0);
+#else
ptr = mmap(NULL, size, PROT_READ, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+#endif
if (ptr == MAP_FAILED) {
/*
* We're out of memory, and cant guarantee anything.
diff --git a/small/slab_arena.c b/small/slab_arena.c
index 7661ef8..11b5364 100644
--- a/small/slab_arena.c
+++ b/small/slab_arena.c
@@ -95,6 +95,9 @@ mmap_checked(size_t size, size_t align, int flags)
flags = MAP_PRIVATE | MAP_ANONYMOUS;
else
flags = MAP_SHARED | MAP_ANONYMOUS;
+#if defined(__OpenBSD__)
+ flags |= MAP_STACK;
+#endif
/*
* All mappings except the first are likely to
@@ -160,7 +163,11 @@ slab_arena_flags_init(struct slab_arena *arena, int flags)
* map them to internal ones.
*/
if (!(flags & SLAB_ARENA_FLAG_MARK)) {
+#if defined(__OpenBSD__)
+ assert(flags & (MAP_PRIVATE | MAP_SHARED | MAP_STACK));
+#else
assert(flags & (MAP_PRIVATE | MAP_SHARED));
+#endif
if (flags == MAP_PRIVATE)
arena->flags = SLAB_ARENA_PRIVATE;
else
--
2.23.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Tarantool-patches] [PATCH 00/11] Add OpenBSD support
2020-05-12 12:32 [Tarantool-patches] [PATCH 00/11] Add OpenBSD support sergeyb
` (10 preceding siblings ...)
2020-05-12 12:32 ` [Tarantool-patches] [PATCH 11/11][small] Add MAP_STACK to mmap() flags sergeyb
@ 2020-05-18 18:22 ` Cyrill Gorcunov
2020-05-20 6:41 ` Kirill Yukhin
12 siblings, 0 replies; 15+ messages in thread
From: Cyrill Gorcunov @ 2020-05-18 18:22 UTC (permalink / raw)
To: Sergey Bronnikov; +Cc: Oleg Piskunov, tml
On Tue, May 12, 2020 at 3:33 PM <sergeyb@tarantool.org> wrote:
>
> From: Sergey Bronnikov <sergeyb@tarantool.org>
>
> This patch series brings OpenBSD support to Tarantool.
>
> notes:
> - testsuites test/vinyl, test/sql-tap and test/app are broken.
>
> Branch: https://github.com/tarantool/tarantool/tree/ligurio/openbsd_support
> GH: https://github.com/tarantool/tarantool/issues/4967
>
I don't see any obvious errors here. Looks ok to me.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Tarantool-patches] [PATCH 00/11] Add OpenBSD support
2020-05-12 12:32 [Tarantool-patches] [PATCH 00/11] Add OpenBSD support sergeyb
` (11 preceding siblings ...)
2020-05-18 18:22 ` [Tarantool-patches] [PATCH 00/11] Add OpenBSD support Cyrill Gorcunov
@ 2020-05-20 6:41 ` Kirill Yukhin
2020-05-20 12:23 ` Sergey Bronnikov
12 siblings, 1 reply; 15+ messages in thread
From: Kirill Yukhin @ 2020-05-20 6:41 UTC (permalink / raw)
To: sergeyb; +Cc: o.piskunov, tarantool-patches
Hello,
On 12 май 15:32, sergeyb@tarantool.org wrote:
> From: Sergey Bronnikov <sergeyb@tarantool.org>
>
> This patch series brings OpenBSD support to Tarantool.
>
> notes:
> - testsuites test/vinyl, test/sql-tap and test/app are broken.
LGTM.
I've checked your patchset into master.
--
Kirill Yukhin
^ permalink raw reply [flat|nested] 15+ messages in thread