Neovim exits with `Abort trap: 6`
dhruvmanila opened this issue · comments
nvim --version
: (from good commit)
NVIM v0.6.0-dev+14-gdf33f30e8
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /Library/Developer/CommandLineTools/usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/Users/dhruvmanilawala/contributing/neovim/build/config -I/Users/dhruvmanilawala/contributing/neovim/src -I/Users/dhruvmanilawala/contributing/neovim/.deps/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include -I/usr/local/opt/gettext/include -I/Users/dhruvmanilawala/contributing/neovim/build/src/nvim/auto -I/Users/dhruvmanilawala/contributing/neovim/build/include
Compiled by dhruvmanilawala@mbp
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/Users/dhruvmanilawala/neovim/share/nvim"
Run :checkhealth for more info
nvim --version
: (from bad commit)
NVIM v0.6.0-dev+15-g3de777d25
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /Library/Developer/CommandLineTools/usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/Users/dhruvmanilawala/contributing/neovim/build/config -I/Users/dhruvmanilawala/contributing/neovim/src -I/Users/dhruvmanilawala/contributing/neovim/.deps/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/include -I/usr/local/opt/gettext/include -I/Users/dhruvmanilawala/contributing/neovim/build/src/nvim/auto -I/Users/dhruvmanilawala/contributing/neovim/build/include
Compiled by dhruvmanilawala@mbp
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/Users/dhruvmanilawala/neovim/share/nvim"
Run :checkhealth for more info
- Operating system/version: macOS Big Sur 11.3
- Terminal name/version: kitty 0.21.2 created by Kovid Goyal
$TERM
:tmux-256color
xterm-kitty
Steps to reproduce using git bisect
Neovim exits with Abort trap: 6
from this commit 3de777d which was found using git bisect
from 79fe9de (bad commit) to release-0.5
(good commit).
NOTE: Using brew install --HEAD neovim
works on the latest master.
Stacktrace
From the first bad commit 3de777d
Process: nvim [75152]
Path: /Users/USER/*/nvim
Identifier: nvim
Version: 0
Code Type: X86-64 (Native)
Parent Process: bash [74469]
User ID: 501
Date/Time: 2021-07-11 11:14:48.351 +0530
OS Version: macOS 11.3 (20E232)
Report Version: 12
Bridge OS Version: 3.0 (14Y908)
Anonymous UUID: A181BC59-3AFF-3C75-E620-6093F51B9673
Time Awake Since Boot: 8400 seconds
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Application Specific Information:
abort() called
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff202fe946 __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff2032d615 pthread_kill + 263
2 libsystem_c.dylib 0x00007fff20282411 abort + 120
3 libuv.1.dylib 0x0000000107561afa uv__signal_block_and_lock + 61
4 libuv.1.dylib 0x0000000107561568 uv__signal_start + 90
5 libuv.1.dylib 0x0000000107560439 uv_spawn + 473
6 libluv.1.dylib 0x000000010752d117 luv_spawn + 2135
7 nvim 0x0000000106fa994d lj_BC_FUNCC + 68
Thread 1:
0 libsystem_kernel.dylib 0x00007fff202fcc62 kevent + 10
1 nvim 0x0000000106f6f362 uv__io_poll + 1026 (kqueue.c:214)
2 nvim 0x0000000106f5e2c1 uv_run + 433 (core.c:375)
3 nvim 0x000000010735293e tui_main + 862
4 libsystem_pthread.dylib 0x00007fff2032d954 _pthread_start + 224
5 libsystem_pthread.dylib 0x00007fff203294a7 thread_start + 15
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000000 rbx: 0x000000010e250e00 rcx: 0x00007ffee8ca8e98 rdx: 0x0000000000000000
rdi: 0x0000000000000103 rsi: 0x0000000000000006 rbp: 0x00007ffee8ca8ec0 rsp: 0x00007ffee8ca8e98
r8: 0x0000000000000000 r9: 0x0000000000000008 r10: 0x000000010e250e00 r11: 0x0000000000000246
r12: 0x0000000000000103 r13: 0x0000000000000003 r14: 0x0000000000000006 r15: 0x0000000000000016
rip: 0x00007fff202fe946 rfl: 0x0000000000000246 cr2: 0x000000010756495a
Logical CPU: 0
Error Code: 0x02000148
Trap Number: 133
Thread 0 instruction stream not available.
Thread 0 last branch register state not available.
Binary Images:
0x106f54000 - 0x107407fff +nvim (0) <015A7DB5-EB84-35E7-9F48-77FF425DA9CF> /Users/USER/*/nvim
0x10750d000 - 0x107518fff +libintl.8.dylib (0) <F1C4D8E0-D7AF-3BAD-A329-B9AB3241CA2D> /usr/local/opt/gettext/lib/libintl.8.dylib
0x107527000 - 0x10753efff +libluv.1.dylib (0) <A3C71ED9-FA96-3E0B-B3FF-4CF08DBA2049> /usr/local/opt/luv/lib/libluv.1.dylib
0x107553000 - 0x10756efff +libuv.1.dylib (0) <D5160993-D08E-376C-A444-680108D4BC1E> /usr/local/opt/libuv/lib/libuv.1.dylib
0x107768000 - 0x10776ffff +libfzf.so (0) <F39F5E65-A221-3CE8-B44A-DF2DDD56287B> /Users/USER/*/libfzf.so
0x10e179000 - 0x10e214fff dyld (851.27) <7EAA668B-F906-3BAA-A980-139BBE6E8766> /usr/lib/dyld
0x7fff20065000 - 0x7fff20066fff libsystem_blocks.dylib (79) <1C8538C3-F2BE-3F02-89AE-E7052DE66D51> /usr/lib/system/libsystem_blocks.dylib
0x7fff20067000 - 0x7fff2009cfff libxpc.dylib (2038.100.48) <CFB56DA8-7462-3E8F-9CFB-20926C6A2BB5> /usr/lib/system/libxpc.dylib
0x7fff2009d000 - 0x7fff200b4fff libsystem_trace.dylib (1277.100.21) <1AAE1F8F-9F9D-3327-8A95-3A6887CED713> /usr/lib/system/libsystem_trace.dylib
0x7fff200b5000 - 0x7fff20152fff libcorecrypto.dylib (1000.100.38) <96A88875-7771-394E-A88E-389DCD02A935> /usr/lib/system/libcorecrypto.dylib
0x7fff20153000 - 0x7fff2017ffff libsystem_malloc.dylib (317.100.9) <029B5632-62B4-39F6-981C-BCA99C1FBF1D> /usr/lib/system/libsystem_malloc.dylib
0x7fff20180000 - 0x7fff201c4fff libdispatch.dylib (1271.100.5) <6B7B23E3-2FD4-3EA2-8A89-CE06244CCA98> /usr/lib/system/libdispatch.dylib
0x7fff201c5000 - 0x7fff201fefff libobjc.A.dylib (824) <929E3040-4605-3C14-885B-D742EF02F2CB> /usr/lib/libobjc.A.dylib
0x7fff201ff000 - 0x7fff20201fff libsystem_featureflags.dylib (28.60.1) <FEA91919-A5BB-3606-9445-F2077D90BF87> /usr/lib/system/libsystem_featureflags.dylib
0x7fff20202000 - 0x7fff2028afff libsystem_c.dylib (1439.100.3) <DF45CDEC-6B7E-3586-94B4-F3679A762661> /usr/lib/system/libsystem_c.dylib
0x7fff2028b000 - 0x7fff202e0fff libc++.1.dylib (905.6) <B027735F-B398-381C-84A7-606D7BBE4997> /usr/lib/libc++.1.dylib
0x7fff202e1000 - 0x7fff202f6fff libc++abi.dylib (905.6) <22AFC7FC-2DB6-3EF0-9CC0-EFFB9B65D5E2> /usr/lib/libc++abi.dylib
0x7fff202f7000 - 0x7fff20326fff libsystem_kernel.dylib (7195.101.1) <A78F60F4-ABD5-3646-93F9-1F1109C4552D> /usr/lib/system/libsystem_kernel.dylib
0x7fff20327000 - 0x7fff20332fff libsystem_pthread.dylib (454.100.8) <52F807B1-41A0-3D1E-AE89-115CA570863F> /usr/lib/system/libsystem_pthread.dylib
0x7fff20333000 - 0x7fff2036efff libdyld.dylib (851.27) <9F95C644-D1BD-38D9-9612-6188FE9EA53C> /usr/lib/system/libdyld.dylib
0x7fff2036f000 - 0x7fff20378fff libsystem_platform.dylib (254.80.2) <03429519-EBEA-3549-84A6-0FD426CB7373> /usr/lib/system/libsystem_platform.dylib
0x7fff20379000 - 0x7fff203a4fff libsystem_info.dylib (542.40.3) <C189F0D7-A430-328D-BD7F-7EB0FA023736> /usr/lib/system/libsystem_info.dylib
0x7fff203a5000 - 0x7fff20842fff com.apple.CoreFoundation (6.9 - 1775.118.101) <895AFD1C-0307-32B3-81CB-BA33DA368DE1> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x7fff22509000 - 0x7fff22768fff libicucore.A.dylib (66112) <478D57C3-FFF8-35E1-A64F-8490A616AB37> /usr/lib/libicucore.A.dylib
0x7fff22769000 - 0x7fff22772fff libsystem_darwin.dylib (1439.100.3) <28AB0CBC-61F6-3A01-BCE2-A53DA1AECB0F> /usr/lib/system/libsystem_darwin.dylib
0x7fff22b88000 - 0x7fff22b93fff libsystem_notify.dylib (279.40.4) <1AA89769-E07F-37CD-BBCF-6DBD345862EB> /usr/lib/system/libsystem_notify.dylib
0x7fff24b15000 - 0x7fff24b23fff libsystem_networkextension.dylib (1295.101.1) <33F45B5A-D346-3E7F-AB34-DFC4387E5A3C> /usr/lib/system/libsystem_networkextension.dylib
0x7fff24b82000 - 0x7fff24b98fff libsystem_asl.dylib (385) <4D4E0D4F-8B40-3ACC-85E1-16375966D6CC> /usr/lib/system/libsystem_asl.dylib
0x7fff2625c000 - 0x7fff26263fff libsystem_symptoms.dylib (1431.100.22) <226C631F-5380-395A-AA20-D686AEA05B9B> /usr/lib/system/libsystem_symptoms.dylib
0x7fff2825f000 - 0x7fff2826ffff libsystem_containermanager.dylib (318.100.4) <3BAF45DD-75D2-3D8A-845E-83A7058CBA08> /usr/lib/system/libsystem_containermanager.dylib
0x7fff28f72000 - 0x7fff28f75fff libsystem_configuration.dylib (1109.101.1) <49050F1E-3143-31B9-8B5C-FCCE4C6F23E5> /usr/lib/system/libsystem_configuration.dylib
0x7fff28f76000 - 0x7fff28f7afff libsystem_sandbox.dylib (1441.101.1) <24C8DF94-E258-3E24-AC96-2D1FB85F076A> /usr/lib/system/libsystem_sandbox.dylib
0x7fff29c6c000 - 0x7fff29c6efff libquarantine.dylib (119.40.2) <FABCD375-2FD7-3FF5-9A28-452D8A323D3E> /usr/lib/system/libquarantine.dylib
0x7fff2a217000 - 0x7fff2a21bfff libsystem_coreservices.dylib (127) <A1451528-AD1D-3E86-93A9-1340535FAF46> /usr/lib/system/libsystem_coreservices.dylib
0x7fff2a42b000 - 0x7fff2a472fff libsystem_m.dylib (3186.100.3) <2F75F75F-DB36-3841-988F-48A7237ED6E9> /usr/lib/system/libsystem_m.dylib
0x7fff2a473000 - 0x7fff2a473fff libcharset.1.dylib (59) <5B967C5A-B6AC-322F-B731-4D653B8462B8> /usr/lib/libcharset.1.dylib
0x7fff2a474000 - 0x7fff2a479fff libmacho.dylib (980) <D503EC4A-6B6A-39C4-8218-9F4B6147A5BF> /usr/lib/system/libmacho.dylib
0x7fff2a496000 - 0x7fff2a4a1fff libcommonCrypto.dylib (60178.100.1) <EA0C1728-C905-3A58-A285-C32ECF903BB4> /usr/lib/system/libcommonCrypto.dylib
0x7fff2a4a2000 - 0x7fff2a4acfff libunwind.dylib (201) <32F74246-BEB8-3249-8C51-CAD863EF158E> /usr/lib/system/libunwind.dylib
0x7fff2a4ad000 - 0x7fff2a4b4fff liboah.dylib (203.42) <E3126D8C-F1F5-3E30-B7A2-0EB1AB0AF12D> /usr/lib/liboah.dylib
0x7fff2a4b5000 - 0x7fff2a4bffff libcopyfile.dylib (173.40.2) <DDE4BE71-76BA-3CDC-B3B0-F5E0BADF8FF2> /usr/lib/system/libcopyfile.dylib
0x7fff2a4c0000 - 0x7fff2a4c7fff libcompiler_rt.dylib (102.2) <AD12DBB0-8D0B-3D71-800D-E591A3CBE0D8> /usr/lib/system/libcompiler_rt.dylib
0x7fff2a4c8000 - 0x7fff2a4cafff libsystem_collections.dylib (1439.100.3) <8B0EA86C-AFA8-3B51-916F-7ED9A42669A4> /usr/lib/system/libsystem_collections.dylib
0x7fff2a4cb000 - 0x7fff2a4cdfff libsystem_secinit.dylib (87.60.1) <18494A83-796C-33D5-A6D0-BD4E0C2BBFC4> /usr/lib/system/libsystem_secinit.dylib
0x7fff2a4ce000 - 0x7fff2a4d0fff libremovefile.dylib (49.101.1) <DC4523F8-F5FF-3837-BD58-0AA8763F8FDE> /usr/lib/system/libremovefile.dylib
0x7fff2a4d1000 - 0x7fff2a4d1fff libkeymgr.dylib (31) <1A66B854-350D-3064-A606-2D9BFE71C400> /usr/lib/system/libkeymgr.dylib
0x7fff2a4d2000 - 0x7fff2a4d9fff libsystem_dnssd.dylib (1310.100.10) <600B1851-C1D4-3ACF-BE2A-99E7E40E6FC0> /usr/lib/system/libsystem_dnssd.dylib
0x7fff2a4da000 - 0x7fff2a4dffff libcache.dylib (83) <ED7D7EB4-B248-33A9-9E6A-58F45EAB7602> /usr/lib/system/libcache.dylib
0x7fff2a4e0000 - 0x7fff2a4e1fff libSystem.B.dylib (1292.100.5) <89E331F9-9A00-3EA4-B49F-FA2B91AE9182> /usr/lib/libSystem.B.dylib
0x7fff2a4e2000 - 0x7fff2a4e5fff libfakelink.dylib (3) <3EDDC5DA-6FAD-3031-91C1-E3465C34E643> /usr/lib/libfakelink.dylib
0x7fff2a4e6000 - 0x7fff2a4e6fff com.apple.SoftLinking (1.0 - 1) <82988A53-B066-3D39-A314-CE3C5C3868DE> /System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking
0x7fff2a51f000 - 0x7fff2a60ffff libiconv.2.dylib (59) <FFC919B8-AA34-3C59-9927-DD1345EF3F32> /usr/lib/libiconv.2.dylib
0x7fff2ac88000 - 0x7fff2ac8bfff libutil.dylib (58.40.2) <E3FE02FF-2812-3A42-8AAC-248A20F5414B> /usr/lib/libutil.dylib
0x7fff2d8d6000 - 0x7fff2d8d6fff liblaunch.dylib (2038.100.48) <3C5E58AF-F753-378B-8E0C-F3C9BB82E04D> /usr/lib/system/liblaunch.dylib
0x7fff2fd5a000 - 0x7fff2fd5afff libsystem_product_info_filter.dylib (8.40.1) <4CCFBF85-6483-364F-A8D6-A5D2956BEC52> /usr/lib/system/libsystem_product_info_filter.dylib
External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by all processes on this machine:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
VM Region Summary:
ReadOnly portion of Libraries: Total=517.9M resident=0K(0%) swapped_out_or_unallocated=517.9M(100%)
Writable regions: Total=81.4M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=81.4M(100%)
VIRTUAL REGION
REGION TYPE SIZE COUNT (non-coalesced)
=========== ======= =======
Activity Tracing 256K 1
Kernel Alloc Once 8K 1
MALLOC 61.7M 35
MALLOC guard page 16K 4
MALLOC_LARGE (reserved) 860K 1 reserved VM address space (unallocated)
STACK GUARD 56.0M 2
Stack 16.0M 2
VM_ALLOCATE 2504K 22
__DATA 659K 55
__DATA_CONST 3229K 46
__DATA_DIRTY 95K 24
__LINKEDIT 500.1M 11
__OBJC_RO 70.2M 1
__OBJC_RW 2480K 2
__TEXT 17.8M 55
__UNICODE 588K 1
shared memory 8K 2
=========== ======= =======
TOTAL 732.2M 265
TOTAL, minus reserved VM space 731.3M 265
I was also experiencing this issue on macOS Big Sur 11.4 on aarch64-darwin with the exact same error backtrace. I was on commit 79fe9de, and I can confirm that reverting to a commit before 3de777d prevents the crash. I am building from source with development dependencies installed from MacPorts.
It seemed like the crash would specifically occur when invoking Lua code, for example running :PackerSync
or invoking telescope.nvim, but I haven't investigated the issue in detail, so I can't narrow the cause.
First, how are you building neovim
? Are you using the bundled deps? What is your compiler?
I cannot reproduce the crashes using make install
from the repo with all bundled deps and the standard clang 12.0.5
on either Intel or M1 macOS under iTerm2.
Ah, right sorry, forgot to mention that.
make clean && make distclean
make CMAKE_BUILD_TYPE=Release CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$HOME/neovim"
make install
Compiler information:
Apple clang version 12.0.5 (clang-1205.0.22.11)
Target: x86_64-apple-darwin20.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Also, Justin mentioned this on Gitter:
searching for uv__signal_block_and_lock yields #9274 . nothing recent though. create an issue and include your stacktrace
Without the extra INSTALL_PREFIX
, that is exactly what I do. Maybe it's your terminal -- can you try iTerm2 or the default Terminal.app?
Also, I see a tmux
in your $TERM
-- that is always a huge red flag. Are you using tmux?
Yes, I fixed that. Now, $TERM
: xterm-kitty
and yes, I am using tmux. I tried opening nvim
without tmux on kitty, on iTerm2 but I still get the error.
I just tried to rebuild Neovim on Terminal.app without tmux and I still get the same error. On Terminal.app, $TERM
gives me xterm-256color
.
Weird. I cannot reproduce this, and the changelog for libluv also doesn't point to any reasonable explanation. Something in your build environment must be different from mine. Can you verify the version of LibUV and LibLUV you are building with? Maybe try building from a fresh clone to make sure that there's no stale dependency lying around (make distclean
should take care of it, but at this point I'm grasping at straws).
(By the way, the reason homebrew's build behaves differently is because they build dynamically against lib(L)UV version 1.41.0.)
Can you verify the version of LibUV and LibLUV you are building with?
LibUV version: 1.34.2
By LibLUV you mean luv, right?: 1.40.0-0
Maybe try building from a fresh clone to make sure that there's no stale dependency lying around (make distclean should take care of it, but at this point I'm grasping at straws).
I tried it with the forked repo and also the upstream repo, but both gives me the same error :(
LibUV version:
1.34.2
By LibLUV you mean luv, right?:1.40.0-0
Yes. That should be what the build script specifies (and works for me).
I tried it with the forked repo and also the upstream repo, but both gives me the same error :(
Just to make sure, I just mean a fresh git clone https://github.com/neovim/neovim.git
.
So I have no idea why your build of neovim behaves differently than mine (and CI's, and most everyone else's).
What's your hardware?
Just to make sure, I just mean a fresh git clone https://github.com/neovim/neovim.git.
Yes, freshly cloned Neovim repo (although using SSH, but I don't think that should make a difference?)
What's your hardware?
MacBook Pro 15-inch 2017 Model
Processor 2.9GHz Quad-Core Intel Core i7
Memory 16 GB 2133 MHz LPDDR3
Is this the information you're asking for?
Yes, but that is reasonably similar to the machine I am sitting in front of just now. That can't be the explanation.
I guess there is nothing to it but bisecting luv
itself. You can replace the corresponding archive in third-party/CMakeLists.txt
with any commit ID and rebuild (after removing the .deps
first, e.g., via make clean
; leave the hash unchanged and the build will error with a message telling you the expected hash you can copy and paste) and see which commit breaks your setup. Maybe that will tell us something.
Right, thanks for the suggestion, I will try that now.
And I should be doing make clean && make distclean
for every build, right?
Easiest to check out the luv
repo separately and start git bisect
in there, taking each checked out revision as a candidate in the CMakeLists
.
And I should be doing
make clean && make distclean
for every build, right?
Yes, you want to make sure to rebuild with the changed dependency. (rm -rf .deps
should also be enough, but better safe than sorry.)
Ok, so I started bisecting between 1.34.1-1
(good) and 1.34.2-1
(bad). I am getting this error while building, there must've been some changes in the build steps in between:
[7/14] Performing install step for 'luv-static'
FAILED: build/src/luv-static-stamp/luv-static-install
cd /Users/dhruvmanilawala/contributing/neovim/.deps/build/src/luv-static-build && /usr/local/Cellar/cmake/3.20.5/bin/cmake --build . --target install --config Release && /usr/local/Cellar/cmake/3.20.5/bin/cmake -E touch /Users/dhruvmanilawala/contributing/neovim/.deps/build/src/luv-static-stamp/luv-static-install
ninja: error: unknown target 'install'
Yes, that is right; these versions introduced breaking changes to the build. See #14997 for what changes.
OK, found the issue (for me, at least). Neovim was crashing because it was mixing bundled and system dependencies. Specifically, it was using a system LibLUV with a bundled LibUV and LuaJIT:
-- Found LibUV: /Users/slice/src/lib/other-neovim/.deps/usr/lib/libuv.a (Required is at least version "1.28.0")
-- Found Msgpack: /Users/slice/src/lib/other-neovim/.deps/usr/lib/libmsgpackc.a (found suitable version "3.0.0", minimum required is "1.0.0")
-- Found LibLUV: /opt/local/lib/libluv.dylib (Required is at least version "1.30.0")
-- Found TreeSitter 0.6.3
-- Performing Test TS_HAS_SET_MATCH_LIMIT
-- Performing Test TS_HAS_SET_MATCH_LIMIT - Success
-- Found LuaJit: /Users/slice/src/lib/other-neovim/.deps/usr/lib/libluajit-5.1.a
I also got this warning whenever this happened:
ld: warning: dylib (/opt/local/lib/libluv.dylib) was built for newer macOS version (11.3) than being linked (11.0)
To fix, ensure that you don't have the deps installed locally at all. Since I use MacPorts, I do:
$ sudo port uninstall luajit luv-luajit lua51-lpeg lua51-mpack msgpack
which immediately fixed the build.
The root issue is that the build picked up luv-luajit
1.41.0 from MacPorts, which is newer than 1.40.0 (what Neovim wants). Maybe double check that Neovim is only using bundled dependencies.
Oh damn, great find. Yeah, it seems that the build is picking up the brew installed luv
instead of the one from the .deps
directory.
@clason Can you try this on your mac? Installing luv
from brew
and then rebuilding Neovim and checking if this can be reproduced.
-- Found LibUV: /Users/dhruvmanilawala/contributing/neovim/.deps/usr/lib/libuv.a (Required is at least version "1.28.0")
-- Found Msgpack: /Users/dhruvmanilawala/contributing/neovim/.deps/usr/lib/libmsgpackc.a (found suitable version "3.0.0", minimum required is "1.0.0")
--- Found LibLUV: /usr/local/lib/libluv.dylib (Required is at least version "1.30.0")
+-- Found LibLUV: /Users/dhruvmanilawala/contributing/neovim/.deps/usr/lib/libluv_a.a (Required is at least version "1.30.0")
-- Found TreeSitter 0.6.3
So, brew uninstall luv
fixes the issue.
Yes, I can reproduce that. This should not happen -- the build should never pick up system libraries unless you set BUNDLED=OFF
. And if it does, it should also pick up the corresponding system LibUV (it's the mismatch that's the problem, I assume).
@jamessan do you know what could be wrong with the CMake scripts here?
So,
brew uninstall luv
fixes the issue.
If you want to keep the brew install of nvim working then brew unlink luv
also seems to do the trick.
I ran into the exact same problem recently and the fix was the same: NixOS/nixpkgs#132433
I used objdump -p
to see which libraries the binary was loading at runtime and noticed that some libraries were coming from different sources.
I am not a Cmake expert, but here is what I've found.
When using the bundled dependencies, libluv gets built as a static library to .deps/usr/lib/libluv_a.a
. Notice the _a
suffix. This seems to be the reason that Cmake is preferring the system installation of libluv
if present. If I manually remove that _a
suffix and rename the file to .deps/usr/lib/libluv.a
then Cmake correctly picks up the bundled version of libluv, even with a system version present.
Okay I think I figured out the issue.
Here is the relevant log output with CMAKE_FIND_DEBUG_MODE
enabled:
CMake Debug Log at cmake/FindLibLUV.cmake:20 (find_library):
find_library called with the following settings:
VAR: LIBLUV_LIBRARY
NAMES: "luv"
"luv_a"
"libluv_a"
"luv.dylib"
Documentation: Path to a library.
Framework
Only Search Frameworks: 0
Search Frameworks Last: 0
Search Frameworks First: 1
AppBundle
Only Search AppBundle: 0
Search AppBundle Last: 0
Search AppBundle First: 1
CMAKE_FIND_USE_CMAKE_PATH: 1
CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
find_library considered the following locations:
/Users/andg/src/neovim/.deps/usr/lib/(lib)luv(\.tbd|\.dylib|\.so|\.a)
/Users/andg/src/neovim/.deps/usr/(lib)luv(\.tbd|\.dylib|\.so|\.a)
/Users/andg/.local/bin/(lib)luv(\.tbd|\.dylib|\.so|\.a)
/opt/homebrew/bin/(lib)luv(\.tbd|\.dylib|\.so|\.a)
/opt/homebrew/sbin/(lib)luv(\.tbd|\.dylib|\.so|\.a)
/usr/bin/(lib)luv(\.tbd|\.dylib|\.so|\.a)
/bin/(lib)luv(\.tbd|\.dylib|\.so|\.a)
/usr/sbin/(lib)luv(\.tbd|\.dylib|\.so|\.a)
/sbin/(lib)luv(\.tbd|\.dylib|\.so|\.a)
/Applications/VMware Fusion.app/Contents/Public/(lib)luv(\.tbd|\.dylib|\.so|\.a)
/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/lib/(lib)luv(\.tbd|\.dylib|\.so|\.a)
/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/usr/(lib)luv(\.tbd|\.dylib|\.so|\.a)
The item was found at
/opt/homebrew/lib/libluv.dylib
luv_a
is indeed listed under names, but because luv
is listed first CMake first searches all paths for a libluv
library, which it finds under /opt/homebrew
(or elsewhere on the system). If we swap the order in the CMake file and put luv_a
before luv
, then it correctly finds the bundled dependency first before looking for system libraries.
That's precisely where I was at, too, but that didn't seem to work for me. Let me test again.
EDIT Wrong clone 🤦🏻 (Curse you, frecency, for stabbing me in the back thusly!)
Yep, works.
Do you want to do the honors and PR that change?