aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJun-ichi TAKIMOTO <Jun-T@users.noreply.github.com>2022-05-21 12:18:17 +0900
committerGitHub <noreply@github.com>2022-05-20 20:18:17 -0700
commitafa99f42b3ff45ef240e60bc8b428b8cda7ddd6e (patch)
tree1e1f98192111957f0c9385f9283cb8f851474c73 /src
parentb3453ea4a6b6518cccd6922fbcaa64a0aa47c743 (diff)
downloadrneovim-afa99f42b3ff45ef240e60bc8b428b8cda7ddd6e.tar.gz
rneovim-afa99f42b3ff45ef240e60bc8b428b8cda7ddd6e.tar.bz2
rneovim-afa99f42b3ff45ef240e60bc8b428b8cda7ddd6e.zip
fix(unittests): coredump when running unit tests #18663
fs_init() must be called before early_init() in init/helpers.lua If I run 'make unittest' on my Mac (macOS 10.14/Mojave or 12/Big Sur, intel CPU), every test produce a core dump. Call sequence in the core is: early_init() main.c:197 set_init_1() option.c:508 runtimepath_default() runtime.c:1205 get_lib_dir() runtime.c:1175 os_isdir() fs.c:137 os_getperm() fs.c:777 os_stat() fs.c:761 fs_loop_lock() fs.c:72 uv_mutex_lock(&fs_loop_mutex) thread.c:352 abort() .deps/build/src/libuv/src/unix/thread.c: void uv_mutex_lock(uv_mutex_t* mutex) { if (pthread_mutex_lock(mutex)) abort(); // line 352 } So pthread_mutex_lock(&fs_loop_mutex) failed. The reason seems to be simple. fs_init() was not called and fs_loop_mutex has not been initialized. fs_init() was moved out from early_init() in main.c by b87867e69e94d9784468a126f21c721446f080de, but unit/helpers.lua was not updated accordingly.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/os/fs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/os/fs.h b/src/nvim/os/fs.h
new file mode 100644
index 0000000000..b03090dfee
--- /dev/null
+++ b/src/nvim/os/fs.h
@@ -0,0 +1,7 @@
+#ifndef NVIM_OS_FS_H
+#define NVIM_OS_FS_H
+
+#ifdef INCLUDE_GENERATED_DECLARATIONS
+# include "os/fs.h.generated.h"
+#endif
+#endif // NVIM_OS_FS_H