Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SIGKILL when run nvim executable during make with Apple Clang #13399

Closed
dive opened this issue Nov 27, 2020 · 25 comments
Closed

SIGKILL when run nvim executable during make with Apple Clang #13399

dive opened this issue Nov 27, 2020 · 25 comments
Labels
bug issues reporting wrong behavior build building and installing Neovim using the provided scripts platform:macos

Comments

@dive
Copy link

dive commented Nov 27, 2020

  • nvim --version: Not available
  • vim -u DEFAULTS (version: ) behaves differently?: Not available
  • Operating system/version: macOS v11.0.1 root:xnu-7195.50.7~2/RELEASE_ARM64_T8101 arm64
  • Terminal name/version: macOS Terminal.app v2.11 (440)
  • $TERM: shell v3.1.2, xterm-256color

-On Mac Mini M1 (Apple Silicon)- Does not relate to the issue.

Steps to reproduce using nvim -u NORC

  1. Checkout the repository on the master branch
  2. Install dependencies
  3. Run make

Actual behaviour

Compilation failed due to SIGKILL on nvim executable launch:

[2/4] Generating pack/dist/opt/vimball/doc/tags
FAILED: runtime/pack/dist/opt/vimball/doc/tags 
cd /Users/dive/Projects/github/neovim/build/runtime/pack/dist/opt/vimball && /opt/local/bin/cmake -E copy_directory /Users/dive/Projects/github/neovim/runtime/pack/dist/opt/vimball /Users/dive/Projects/github/neovim/build/runtime/pack/dist/opt/vimball && /Users/dive/Projects/github/neovim/build/bin/nvim -u NONE -i NONE -e --headless -c helptags\ doc -c quit
/bin/sh: line 1: 48650 Killed: 9               /Users/dive/Projects/github/neovim/build/bin/nvim -u NONE -i NONE -e --headless -c helptags\ doc -c quit
[3/4] Generating pack/dist/opt/matchit/doc/tags
FAILED: runtime/pack/dist/opt/matchit/doc/tags 
cd /Users/dive/Projects/github/neovim/build/runtime/pack/dist/opt/matchit && /opt/local/bin/cmake -E copy_directory /Users/dive/Projects/github/neovim/runtime/pack/dist/opt/matchit /Users/dive/Projects/github/neovim/build/runtime/pack/dist/opt/matchit && /Users/dive/Projects/github/neovim/build/bin/nvim -u NONE -i NONE -e --headless -c helptags\ doc -c quit
/bin/sh: line 1: 48651 Killed: 9               /Users/dive/Projects/github/neovim/build/bin/nvim -u NONE -i NONE -e --headless -c helptags\ doc -c quit
[4/4] Generating doc/tags
FAILED: runtime/doc/tags 
cd /Users/dive/Projects/github/neovim/build/runtime && /opt/local/bin/cmake -E remove doc/* && /opt/local/bin/cmake -E copy_directory /Users/dive/Projects/github/neovim/runtime/doc doc && /Users/dive/Projects/github/neovim/build/bin/nvim -u NONE -i NONE -e --headless -c helptags\ ++t\ doc -c quit
/bin/sh: line 1: 48656 Killed: 9               /Users/dive/Projects/github/neovim/build/bin/nvim -u NONE -i NONE -e --headless -c helptags\ ++t\ doc -c quit
ninja: build stopped: subcommand failed.
make: *** [nvim] Error 1

The nvim executable is there, but it fails with SIGKILL when you try to run it:

~/P/g/neovim $ file ./build/bin/nvim
./build/bin/nvim: Mach-O 64-bit executable arm64

~/P/g/neovim $ ./build/bin/nvim
fish: “./build/bin/nvim” terminated by signal SIGKILL (Forced quit)

Expected behaviour

The executable works as expected.

@dive dive added the bug issues reporting wrong behavior label Nov 27, 2020
@dive dive changed the title SIGKILL when run nvim executable during build on Apple Silicon SIGKILL when run nvim executable during make on Apple Silicon (arm64) Nov 27, 2020
@glacambre
Copy link
Member

Hard to tell what's going on without having the whole compilation log. Could you upload it somewhere?

@dive
Copy link
Author

dive commented Nov 27, 2020

lldb failed to run the process for some reason to check what is happening on launch. All the logs are empty as well.

~/P/g/neovim $ lldb ./build/bin/nvim
(lldb) target create "./build/bin/nvim"
Current executable set to '/Users/dive/Projects/github/neovim/build/bin/nvim' (arm64).
(lldb) process launch 
error: Malformed Mach-o file

On first sight, the binary looks fine.

~/P/g/neovim $ otool -h build/bin/nvim
Mach header
      magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
 0xfeedfacf 16777228          0  0x00           2    21       2128 0x00200085

...

~/P/g/neovim $ otool -L build/bin/nvim                                                                                                 
build/bin/nvim:                                                                                                                        
        /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.106.0)
        /opt/local/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.5.0)                                          
        /opt/local/lib/libiconv.2.dylib (compatibility version 9.0.0, current version 9.1.0)                                           
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.0.0)                                             
        /usr/lib/libutil.dylib (compatibility version 1.0.0, current version 1.0.0) 

@dive
Copy link
Author

dive commented Nov 27, 2020

Hard to tell what's going on without having the whole compilation log. Could you upload it somewhere?

@glacambre, sure - neovim_m1_make.log.

@mhartington
Copy link
Contributor

mhartington commented Nov 27, 2020

Running into the same issue here, though no on an M1.

$ make
cd .deps && \
                cmake -G 'Ninja'   \
                 /Users/mhartington/Github/neovim-org/neovim/third-party
-- Found GNU Make at /usr/bin/make
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/mhartington/Github/neovim-org/neovim/.deps
mkdir -p build
touch build/.ran-third-party-cmake
ninja  -C .deps
ninja: Entering directory `.deps'
[3/3] cd /Users/mhartington/Github/neovim-org/neovim/.deps && /usr/local/Cellar/cmake/3.18.1/bin/cmake -E touch .third-party
cd build && cmake -G 'Ninja' -DCMAKE_BUILD_TYPE=Debug  /Users/mhartington/Github/neovim-org/neovim
-- The C compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- CMAKE_INSTALL_PREFIX=/usr/local
-- CMAKE_BUILD_TYPE=Debug
-- MIN_LOG_LEVEL not specified, default is 1 (INFO)
-- Replacing -O3 in CMAKE_C_FLAGS_RELEASE with -O2
-- Performing Test HAS_ACCEPTABLE_FORTIFY
-- Performing Test HAS_ACCEPTABLE_FORTIFY - Failed
-- Unsupported _FORTIFY_SOURCE found, forcing _FORTIFY_SOURCE=1
-- Performing Test HAVE_EXECINFO_BACKTRACE
-- Performing Test HAVE_EXECINFO_BACKTRACE - Success
-- Performing Test HAVE_BUILTIN_ADD_OVERFLOW
-- Performing Test HAVE_BUILTIN_ADD_OVERFLOW - Success
-- Performing Test HAVE_WIMPLICIT_FALLTHROUGH_FLAG
-- Performing Test HAVE_WIMPLICIT_FALLTHROUGH_FLAG - Success
-- Performing Test HAS_WVLA_FLAG
-- Performing Test HAS_WVLA_FLAG - Success
-- Performing Test HAS_FSTACK_PROTECTOR_STRONG_FLAG
-- Performing Test HAS_FSTACK_PROTECTOR_STRONG_FLAG - Success
-- Performing Test HAS_FSTACK_PROTECTOR_FLAG
-- Performing Test HAS_FSTACK_PROTECTOR_FLAG - Success
-- Performing Test HAVE_FNO_COMMON
-- Performing Test HAVE_FNO_COMMON - Success
-- Performing Test HAS_DIAG_COLOR_FLAG
-- Performing Test HAS_DIAG_COLOR_FLAG - Success
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Looking for kstat_lookup in kstat
-- Looking for kstat_lookup in kstat - not found
-- Looking for kvm_open in kvm
-- Looking for kvm_open in kvm - not found
-- Looking for gethostbyname in nsl
-- Looking for gethostbyname in nsl - not found
-- Looking for perfstat_cpu in perfstat
-- Looking for perfstat_cpu in perfstat - not found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - not found
-- Looking for sendfile in sendfile
-- Looking for sendfile in sendfile - not found
-- Found LibUV: /Users/mhartington/Github/neovim-org/neovim/.deps/usr/lib/libuv.a (Required is at least version "1.28.0")
-- Found Msgpack: /Users/mhartington/Github/neovim-org/neovim/.deps/usr/lib/libmsgpackc.a (found suitable version "3.0.0", minimum required is "1.0.0")
-- Found LibLUV: /Users/mhartington/Github/neovim-org/neovim/.deps/usr/lib/libluv.a (Required is at least version "1.30.0")
-- Found TreeSitter 0.6.3
-- Found LuaJit: /Users/mhartington/Github/neovim-org/neovim/.deps/usr/lib/libluajit-5.1.a
-- Performing Test MSGPACK_HAS_FLOAT32
-- Performing Test MSGPACK_HAS_FLOAT32 - Success
-- Found UNIBILIUM 2.0.0
-- Performing Test UNIBI_HAS_VAR_FROM
-- Performing Test UNIBI_HAS_VAR_FROM - Success
-- Found LibTermkey: /Users/mhartington/Github/neovim-org/neovim/.deps/usr/lib/libtermkey.a (Required is at least version "0.18")
-- Found LIBVTERM 0.1.4
-- Found Iconv
-- Performing Test HAVE_WORKING_LIBINTL
-- Performing Test HAVE_WORKING_LIBINTL - Success
-- Looking for _nl_msg_cat_cntr
-- Looking for _nl_msg_cat_cntr - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Checking Lua interpreter: /Users/mhartington/Github/neovim-org/neovim/.deps/usr/bin/luajit
-- Using Lua interpreter: /Users/mhartington/Github/neovim-org/neovim/.deps/usr/bin/luajit
-- Performing Test HAS_WSTATIC_IN_INLINE
-- Performing Test HAS_WSTATIC_IN_INLINE - Success
-- Using NVIM_VERSION_MEDIUM from Git
-- Found Gettext: /usr/local/opt/gettext/bin/msgmerge (found version "0.21")
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of int
-- Check size of int - done
-- Check size of long
-- Check size of long - done
-- Check size of intmax_t
-- Check size of intmax_t - done
-- Check size of size_t
-- Check size of size_t - done
-- Check size of long long
-- Check size of long long - done
-- Check size of void *
-- Check size of void * - done
-- Looking for _NSGetEnviron
-- Looking for _NSGetEnviron - found
-- Looking for include file langinfo.h
-- Looking for include file langinfo.h - found
-- Looking for include file locale.h
-- Looking for include file locale.h - found
-- Looking for include file pwd.h
-- Looking for include file pwd.h - found
-- Looking for include file strings.h
-- Looking for include file strings.h - found
-- Looking for include file sys/wait.h
-- Looking for include file sys/wait.h - found
-- Looking for include file sys/utsname.h
-- Looking for include file sys/utsname.h - found
-- Looking for include file termios.h
-- Looking for include file termios.h - found
-- Looking for include file sys/uio.h
-- Looking for include file sys/uio.h - found
-- Looking for include file sys/sdt.h
-- Looking for include file sys/sdt.h - found
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for getpwent
-- Looking for getpwent - found
-- Looking for getpwnam
-- Looking for getpwnam - found
-- Looking for getpwuid
-- Looking for getpwuid - found
-- Looking for readv
-- Looking for readv - found
-- Looking for opendir
-- Looking for opendir - found
-- Looking for readlink
-- Looking for readlink - found
-- Looking for setpgid
-- Looking for setpgid - found
-- Looking for setsid
-- Looking for setsid - found
-- Looking for sigaction
-- Looking for sigaction - found
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for strncasecmp
-- Looking for strncasecmp - found
-- Looking for FD_CLOEXEC
-- Looking for FD_CLOEXEC - found
-- Looking for CODESET
-- Looking for CODESET - found
-- Looking for include file endian.h
-- Looking for include file endian.h - not found
-- Looking for include file sys/endian.h
-- Looking for include file sys/endian.h - not found
-- Performing Test HAVE_BE64TOH_MACROS
-- Performing Test HAVE_BE64TOH_MACROS - Failed
-- Looking for be64toh
-- Looking for be64toh - not found
-- Performing Test ORDER_BIG_ENDIAN
-- Performing Test ORDER_BIG_ENDIAN - Failed
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/mhartington/Github/neovim-org/neovim/build
touch build/.ran-cmake
ninja  -C build
ninja: Entering directory `build'
[315/319] Linking C executable bin/nvim
ld: warning: dylib (/usr/local/opt/gettext/lib/libintl.dylib) was built for newer macOS version (10.15) than being linked (10.14)
[317/319] Generating pack/dist/opt/matchit/doc/tags
FAILED: runtime/pack/dist/opt/matchit/doc/tags
cd /Users/mhartington/Github/neovim-org/neovim/build/runtime/pack/dist/opt/matchit && /usr/local/Cellar/cmake/3.18.1/bin/cmake -E copy_directory /Users/mhartington/Github/neovim-org/neovim/runtime/pack/dist/opt/matchit /Users/mhartington/Github/neovim-org/neovim/build/runtime/pack/dist/opt/matchit && /Users/mhartington/Github/neovim-org/neovim/build/bin/nvim -u NONE -i NONE -e --headless -c helptags\ doc -c quit
/bin/sh: line 1: 54817 Abort trap: 6           /Users/mhartington/Github/neovim-org/neovim/build/bin/nvim -u NONE -i NONE -e --headless -c helptags\ doc -c quit
[318/319] Generating pack/dist/opt/vimball/doc/tags
FAILED: runtime/pack/dist/opt/vimball/doc/tags
cd /Users/mhartington/Github/neovim-org/neovim/build/runtime/pack/dist/opt/vimball && /usr/local/Cellar/cmake/3.18.1/bin/cmake -E copy_directory /Users/mhartington/Github/neovim-org/neovim/runtime/pack/dist/opt/vimball /Users/mhartington/Github/neovim-org/neovim/build/runtime/pack/dist/opt/vimball && /Users/mhartington/Github/neovim-org/neovim/build/bin/nvim -u NONE -i NONE -e --headless -c helptags\ doc -c quit
/bin/sh: line 1: 54816 Abort trap: 6           /Users/mhartington/Github/neovim-org/neovim/build/bin/nvim -u NONE -i NONE -e --headless -c helptags\ doc -c quit
[319/319] Generating doc/tags
FAILED: runtime/doc/tags
cd /Users/mhartington/Github/neovim-org/neovim/build/runtime && /usr/local/Cellar/cmake/3.18.1/bin/cmake -E remove doc/* && /usr/local/Cellar/cmake/3.18.1/bin/cmake -E copy_directory /Users/mhartington/Github/neovim-org/neovim/runtime/doc doc && /Users/mhartington/Github/neovim-org/neovim/build/bin/nvim -u NONE -i NONE -e --headless -c helptags\ ++t\ doc -c quit
/bin/sh: line 1: 54818 Abort trap: 6           /Users/mhartington/Github/neovim-org/neovim/build/bin/nvim -u NONE -i NONE -e --headless -c helptags\ ++t\ doc -c quit
ninja: build stopped: subcommand failed.
make: *** [nvim] Error 1

Haven't changed my setup at all, just pulled in a few new commits so thinking the culprit is in there.

EDIT

Looks like 72d2984 is the culprit for me. @dive can you try to build from master at c0a6989d93d35811411155e43f37b2fc4658719e? This is the commit right before @bfredl's commit.

@dive
Copy link
Author

dive commented Nov 27, 2020

@mhartington, does not work as well, with the same problem

[313/315] Generating pack/dist/opt/matchit/doc/tags
FAILED: runtime/pack/dist/opt/matchit/doc/tags 
cd /Users/dive/Projects/github/neovim/build/runtime/pack/dist/opt/matchit && /opt/local/bin/cmake -E copy_directory /Users/dive/Projects/github/neovim/runtime/pack/dist/opt/matchit /Users/dive/Projects/github/neovim/build/runtime/pack/dist/opt/matchit && /Users/dive/Projects/github/neovim/build/bin/nvim -u NONE -i NONE -e --headless -c helptags\ doc -c quit
/bin/sh: line 1: 31171 Killed: 9               /Users/dive/Projects/github/neovim/build/bin/nvim -u NONE -i NONE -e --headless -c helptags\ doc -c quit
[314/315] Generating pack/dist/opt/vimball/doc/tags
FAILED: runtime/pack/dist/opt/vimball/doc/tags 
cd /Users/dive/Projects/github/neovim/build/runtime/pack/dist/opt/vimball && /opt/local/bin/cmake -E copy_directory /Users/dive/Projects/github/neovim/runtime/pack/dist/opt/vimball /Users/dive/Projects/github/neovim/build/runtime/pack/dist/opt/vimball && /Users/dive/Projects/github/neovim/build/bin/nvim -u NONE -i NONE -e --headless -c helptags\ doc -c quit
/bin/sh: line 1: 31170 Killed: 9               /Users/dive/Projects/github/neovim/build/bin/nvim -u NONE -i NONE -e --headless -c helptags\ doc -c quit
[315/315] Generating doc/tags
FAILED: runtime/doc/tags 
cd /Users/dive/Projects/github/neovim/build/runtime && /opt/local/bin/cmake -E remove doc/* && /opt/local/bin/cmake -E copy_directory /Users/dive/Projects/github/neovim/runtime/doc doc && /Users/dive/Projects/github/neovim/build/bin/nvim -u NONE -i NONE -e --headless -c helptags\ ++t\ doc -c quit
/bin/sh: line 1: 31172 Killed: 9               /Users/dive/Projects/github/neovim/build/bin/nvim -u NONE -i NONE -e --headless -c helptags\ ++t\ doc -c quit
ninja: build stopped: subcommand failed.
make: *** [nvim] Error 1
~/P/g/neovim $ git branch
* (HEAD detached at c0a6989d9)
  master
  v0.4.4

I can try to run bisect later today or tomorrow, will take some time.

@bfredl
Copy link
Member

bfredl commented Nov 27, 2020

That commit changes nothing. Except LTO quantum effects i suppose.

@clason
Copy link
Member

clason commented Nov 27, 2020

@dive Maybe you should add some information on how you build neovim. As far as I understand it, this PR: #12624 is required to build a working neovim on Apple silicon.

@clason clason added build building and installing Neovim using the provided scripts platform:macos labels Nov 27, 2020
@clason
Copy link
Member

clason commented Nov 27, 2020

@mhartington I can reproduce this on master, but only with a Debug build. Release and RelWithDebInfo works fine. Which would square with the single functional change in that PR, the added ILOG statement. And in fact, removing that line

ILOG("startup runtimepart/packpath value: %s", rtp);
fixes the debug build, too @bfredl ;)

(Doesn't explain why it's SIGKILLed, of course...)

@mhartington
Copy link
Contributor

@clason couldn't get Release/RelWithDebInfo to work either, but once line 497 in option.c is commented out, all works fine.

@dive
Copy link
Author

dive commented Nov 28, 2020

@dive Maybe you should add some information on how you build neovim. As far as I understand it, this PR: #12624 is required to build a working neovim on Apple silicon.

@clason, I follow the instruction to building Neovim, nothing fancy: checkout the master branch, install dependencies, run make. The command I use:

git clean -fdx && make clean && make distclean && make

# For Release version
git clean -fdx && make clean && make distclean && make CMAKE_BUILD_TYPE=Release

About #12624, I can confirm that it compiles just fine with the following steps:

git clone git@github.com:neovim/neovim && cd neovim
gh pr checkout 12624
echo "DEPS_CMAKE_FLAGS += -DCMAKE_OSX_DEPLOYMENT_TARGET=11.00" >> local.mk
make clean && make distclean && make SDKROOT=`xcrun --show-sdk-path`

@mhartington I can reproduce this on master, but only with a Debug build. Release and RelWithDebInfo works fine. Which would square with the single functional change in that PR, the added ILOG statement. And in fact, removing that line

ILOG("startup runtimepart/packpath value: %s", rtp);

fixes the debug build, too @bfredl ;)
(Doesn't explain why it's SIGKILLed, of course...)

I tried to comment out the line, does not help either on arm64.

@clason
Copy link
Member

clason commented Nov 28, 2020

@dive there are two different issues here:

  1. building on Apple silicon (which is not supported yet and requires the linked PR)
  2. the SIGKILL (at least in Debug mode if not others with Apple clang, but not related to ARM64) introduced by the shown line.

Do you still observe the crash when both building with the PR and with that line removed?

@dive
Copy link
Author

dive commented Nov 28, 2020

@dive there are two different issues here:

  1. building on Apple silicon (which is not supported yet and requires the linked PR)
  2. the SIGKILL (at least in Debug mode if not others) introduced by the shown line.

Do you still observe the crash when both building with the PR and with that line removed?

The build from the #12624 works just fine by default, but it has an outdated master without these recent changes you are talking about.

I pulled the master locally, and yeah, can confirm that the crash is there for the Debug configuration:

With neovim/src/nvim/option.c:497

~/P/g/neovim $ ./build/bin/nvim --version
fish: Job 3, “./build/bin/nvim” terminated by signal SIGABRT (Abort)

With commented out neovim/src/nvim/option.c:497

~/P/g/neovim $ ./build/bin/nvim --version
NVIM v0.5.0-604-gfedbf4549-dirty
Build type: Debug
LuaJIT 2.1.0-beta3
Compilation: /Volumes/Extended/Archives/Xcode_12.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -g -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=1 -I/Users/dive/Projects/github/neovim/build/config -I/Users/dive/Projects/github/neovim/src -I/Users/dive/Projects/github/neovim/.deps/usr/include -I/opt/local/include -I/Users/dive/Projects/github/neovim/build/src/nvim/auto -I/Users/dive/Projects/github/neovim/build/include
Compiled by dive@Artems-Mac-mini.local

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/share/nvim"

Run :checkhealth for more info

@clason
Copy link
Member

clason commented Nov 28, 2020

@dive Thanks for confirming (I cannot test Apple silicon myself).

So the root problem is a regression introduced by 72d2984 with Apple clang-1200.0.32.28, and not in fact related to ARM64. Would you mind editing the issue title to replace "Apple Silicon (arm64)" with "Apple clang" to make that clear?

I'll have to leave the question how to best fix it to @bfredl...

@dive dive changed the title SIGKILL when run nvim executable during make on Apple Silicon (arm64) SIGKILL when run nvim executable during make with Apple Clang Nov 28, 2020
@dive
Copy link
Author

dive commented Nov 28, 2020

@clason, glad to help. I have changed the title and description.
Feel free to ping me if you guys need any help to test it with Apple Silicon. And thanks for the help!

@jamessan
Copy link
Member

Can you try building with ASAN enabled and see if that provides a hint to what's going on?

$ rm -r build
$ make CMAKE_EXTRA_FLAGS="-DCLANG_ASAN_UBSAN=ON"
...
$ ./build/bin/nvim --version 2>asan.log

@clason
Copy link
Member

clason commented Nov 28, 2020

That leaves an empty log file?

@jamessan
Copy link
Member

That leaves an empty log file?

Only if ASAN doesn't detect anything. :)

@clason
Copy link
Member

clason commented Nov 28, 2020

So I guess it didn't ;)

@bfredl
Copy link
Member

bfredl commented Nov 28, 2020

Is there a complete traceback? it should already just skip logging if log file cannot be opened but there could be subtle difference in behavior between libc implementations..

@puremourning
Copy link
Contributor

ben@BenMBP neovim % lldb /Users/ben/Development/neovim/build/bin/nvim
(lldb) target create "/Users/ben/Development/neovim/build/bin/nvim"
Current executable set to '/Users/ben/Development/neovim/build/bin/nvim' (x86_64).
(lldb) run
Process 98287 launched: '/Users/ben/Development/neovim/build/bin/nvim' (x86_64)
Process 98287 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00007fff202f5462 libsystem_kernel.dylib`__pthread_kill + 10
libsystem_kernel.dylib`__pthread_kill:
->  0x7fff202f5462 <+10>: jae    0x7fff202f546c            ; <+20>
    0x7fff202f5464 <+12>: movq   %rax, %rdi
    0x7fff202f5467 <+15>: jmp    0x7fff202ef6a1            ; cerror_nocancel
    0x7fff202f546c <+20>: retq
Target 0: (nvim) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
  * frame #0: 0x00007fff202f5462 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff20323610 libsystem_pthread.dylib`pthread_kill + 263
    frame #2: 0x00007fff20276720 libsystem_c.dylib`abort + 120
    frame #3: 0x00000001003a8884 nvim`uv_mutex_lock(mutex=<unavailable>) at thread.c:331:5 [opt]
    frame #4: 0x0000000100193310 nvim`log_lock at log.c:101:3
    frame #5: 0x0000000100193481 nvim`logmsg(log_level=1, context=0x0000000000000000, func_name="set_init_1", line_num=497, eol=true, fmt="startup runtimepart/packpath value: %s") at log.c:131:3
    frame #6: 0x000000010021c860 nvim`set_init_1(clean_arg=false) at option.c:497:5
    frame #7: 0x00000001001a32a3 nvim`early_init(paramp=0x00007ffeefbff3b0) at main.c:193:3
    frame #8: 0x00000001001a36ea nvim`main(argc=1, argv=0x00007ffeefbff4e8) at main.c:246:3
    frame #9: 0x00007fff2033e631 libdyld.dylib`start + 1
    frame #10: 0x00007fff2033e631 libdyld.dylib`start + 1

@clason
Copy link
Member

clason commented Nov 28, 2020

@dive #13405 has fixed the reported issue on Intel, can you confirm this on ARM as well?

@dive
Copy link
Author

dive commented Nov 28, 2020

@clason, fixed within the #12624 PR. Still SIGKILLs in the master branch (cannot get the trace, lldb refuses to run the process with "Malformed Mach-o file" error).

@clason
Copy link
Member

clason commented Nov 28, 2020

@dive you need to locally rebase #12624 on master (git rebase master with that PR checked out).

@dive
Copy link
Author

dive commented Nov 28, 2020

@clason, that's what I did. #12624 on the top of the latest master branch works fine, the master branch without it still fails with the SIGKILL. But it is not a problem as I understand and due to one of the third-parties updated in the PR.

@clason
Copy link
Member

clason commented Nov 28, 2020

#12624 on the top of the latest master branch works fine

That's what I wanted to hear (the rest was expected), thank you! I'll close this issue now; the other PR with Apple Silicon support will get merged once the fallout from the needed dependency bump is sorted out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior build building and installing Neovim using the provided scripts platform:macos
Projects
None yet
Development

No branches or pull requests

7 participants