neovim/test/unit
Jun-ichi TAKIMOTO afa99f42b3
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
b87867e69e, but unit/helpers.lua was not updated
accordingly.
2022-05-20 20:18:17 -07:00
..
api refactor(api): break out Vim script functions to its own file 2021-10-29 16:59:53 +02:00
charset chore: fix typos (#16816) 2022-01-04 11:07:40 -07:00
eval vim-patch:8.2.1473: items in a list given to :const can still be modified 2021-09-16 00:13:41 +01:00
fixtures fix(PVS/V1044): suppress warning 2022-05-17 22:26:25 +02:00
os test: correct order of arguments to eq() and neq() 2022-04-26 11:38:58 +08:00
viml feat: add support for global statusline 2022-03-18 00:21:41 +06:00
buffer_spec.lua vim-patch:8.2.0004: get E685 and E931 if buffer reload is interrupted 2022-04-08 08:54:07 +08:00
fileio_spec.lua unittests: Check core dumps in after_each, like in functests 2017-03-11 23:23:49 +03:00
formatc.lua test/unit/formatc: Fix parsing of most recent viml_parser_highlight 2017-10-16 03:03:34 +03:00
garray_spec.lua chore: fix typos (#16816) 2022-01-04 11:07:40 -07:00
helpers.lua fix(unittests): coredump when running unit tests #18663 2022-05-20 20:18:17 -07:00
keycodes_spec.lua refactor: rename keymap.{c,h} to keycodes.{c,h} (#18535) 2022-05-12 20:19:29 +08:00
marktree_spec.lua refactor(extmarks): use a more efficient representation 2022-01-15 22:08:12 +01:00
mbyte_spec.lua build/doc/CI: remove/update quickbuild references #11258 2019-10-19 18:04:08 -07:00
memory_spec.lua unittests: Check core dumps in after_each, like in functests 2017-03-11 23:23:49 +03:00
message_spec.lua unittests: Update test/unit/message_spec.lua 2017-03-11 23:26:33 +03:00
multiqueue_spec.lua unittests: Use more adequate names for some functions 2017-03-12 02:54:23 +03:00
option_spec.lua unittests: Check core dumps in after_each, like in functests 2017-03-11 23:23:49 +03:00
path_spec.lua test(unit): add unit tests for path_with_url 2022-01-24 13:01:35 +08:00
preload.lua unittests: Check core dumps in after_each, like in functests 2017-03-11 23:23:49 +03:00
preprocess.lua Revert "tests: unit: fix preprocess: pass -m32 for 32bit ABI (#11073)" 2021-08-16 00:02:22 -04:00
profile_spec.lua unittests: Do not import libnvim or headers in main process 2017-03-11 23:23:49 +03:00
rbuffer_spec.lua unittests: Use more adequate names for some functions 2017-03-12 02:54:23 +03:00
search_spec.lua refactor: move reverse_text to strings.c as it's a string operation 2022-05-20 16:11:54 +02:00
set.lua unittests: Move filtering cdefs to main process 2017-03-12 03:02:14 +03:00
strings_spec.lua refactor: move reverse_text to strings.c as it's a string operation 2022-05-20 16:11:54 +02:00
tempfile_spec.lua unittests: avoid using pattern matching on file names 2017-03-16 06:58:15 -04:00
testtest_spec.lua unittests: Collect traces 2017-04-01 12:25:10 +03:00
tui_spec.lua test,unit: Change test according to change of bg color response processing 2020-11-20 09:26:17 -05:00
undo_spec.lua refactor(undo): don't assume curbuf in u_compute_hash 2021-07-09 15:36:07 +02:00