Skip to content
This repository was archived by the owner on Apr 1, 2020. It is now read-only.

OSX - 0.3.6 - Crash on MacOS earlier than 10.12 #2354

Open
bryphe opened this issue Jun 24, 2018 · 22 comments
Open

OSX - 0.3.6 - Crash on MacOS earlier than 10.12 #2354

bryphe opened this issue Jun 24, 2018 · 22 comments

Comments

@bryphe
Copy link
Member

bryphe commented Jun 24, 2018

Oni Version: 0.3.6
Neovim Version (Linux only): 0.3.0
Operating System: OSX

Issue:
Crash on start on OSX, depending on some configurations. This shows as a misleading "Unable to start Neovim error".

This issue was reported on Twitter here: https://twitter.com/appelgriebsch/status/1010942999210151937 and

However, in the dev tools, we see:
image

It appears that there is a crash in or around here:

private async _checkAndFixIfBlocked(): Promise<void> {

The purpose of this _checkAndFixIfBlocked is to handle the case where there was an error spinning up nvim while loading the config - you'd get a blank screen and a 'Press enter to continue` prompt, which was really confusing for users if their config was incompatible - so we tried to provide a better experience by capturing the error and showing a notification.

We don't see the nvim_get_mode call return in this case, so it seems likely that our call to nvim_get_mode is crashing the process. cc @justinmk - maybe you have some ideas here too, if anything changed?

** Workaround: **

Until this is fixed, there are a couple of options:

  • Disable the init.vim - ideally, we could figure out what cases are causing this.
  • Downgrade to an earlier version of nvim - you can set the debug.neovimPath to point to an 0.2.2 version of nvim.

Steps to reproduce:

@CrossR was able to reproduce this on OSX with his configuration: https://github.com/CrossR/dotfiles/blob/master/neovim/.config/nvim/init.vim

In addition to fixing this issue, we should also introduce a regression test that validates against a more in-depth config like @CrossR 's

@bryphe
Copy link
Member Author

bryphe commented Jun 24, 2018

Also, in theory, this test should be catching stuff like this:
https://github.com/onivim/oni/blob/master/test/ci/Neovim.InvalidInitVimHandlingTest.ts

@bryphe
Copy link
Member Author

bryphe commented Jun 24, 2018

One other detail - @CrossR mentioned his config works fine on Windows, and this issue does not repro. So it could be an OSX-only issue, although @CrossR has some pieces of his config that are non-windows specific - so those could also be a culprit.

@appelgriebsch
Copy link

It also crashes on my system w/o having a custom init.vim file...

screen shot 2018-06-24 at 20 29 27

Looks like the bundled NeoVim binary needs OSX 10.12 to work...

screen shot 2018-06-24 at 20 35 48

As I'm stick to 10.11 El Capitan this won't work for me... :(

@bryphe
Copy link
Member Author

bryphe commented Jun 24, 2018

Thanks for the details, @appelgriebsch !

@CrossR saw it might be related to this issue: neovim/neovim#8524

@bryphe
Copy link
Member Author

bryphe commented Jun 24, 2018

We should have our CI build test against earlier OSX versions to help guard against this in the future - https://docs.travis-ci.com/user/reference/osx/#OS-X-Version

@bryphe bryphe changed the title OSX - 0.3.6 - Crash on start with some configs OSX - 0.3.6 - Crash on MacOS earlier than 10.12 Jun 24, 2018
@leebrinton
Copy link

I am running OS X 10.11. I have a working install of neovim (from macports) at /opt/local/bin/nvim. I tried setting the environment variable ONI_NEOVIM_PATH to the macports neovim, as recommended for a Linux install, but it did not work. Is there a way to make this work for OS X ?

@dmytro-y-dev
Copy link

dmytro-y-dev commented Jun 27, 2018

Same for me, OS X 10.10.5. ONI_NEOVIM_PATH env variable is ignored. I compiled new neovim by using brew install neovim and then executed next commands to replace nvim binary with symlink to working neovim:

cd /Applications/Oni.app/Contents/Resources/app/node_modules/oni-neovim-binaries/bin/nvim-osx64/bin
rm nvim
ln -s $(which nvim) /Applications/Oni.app/Contents/Resources/app/node_modules/oni-neovim-binaries/bin/nvim-osx64/bin/nvim

The thing is that prebuilt neovim binary 0.3.0 also crashes on my machine with same error message as mentioned above.

@CrossR
Copy link
Member

CrossR commented Jun 30, 2018

The quickest fix for this is to download nvim 0.2.2 from neovim: https://github.com/neovim/neovim/releases/tag/v0.2.2

Then add to your config.js the following. I did this by just editing the file in vim (its stored in ~/.config/oni/config.js, and an example one can be found here if you don't have one.)

    "debug.neovimPath": "/Users/ryan/Desktop/nvim-osx64/bin/nvim",

You'll want to do it in the config.js not config.tsx since the .tsx one won't be compiled until Oni runs.

That at least gets Oni to launch. I'm having issues with both the nightly release from today as well as the included binary in the release, and building from source. 0.2.2 works fine.

@bryphe
Copy link
Member Author

bryphe commented Jun 30, 2018

Downgrading to 0.2.2 sounds like the safest approach for now!

I see two next steps here:

  1. Set up our Mac builds so that we test against an earlier Mac version too, so we can check this in CI
  2. Actually respect the ONI_NEOVIM_PATH environment variable on all platforms, so that it is easier to tweak this

@CrossR
Copy link
Member

CrossR commented Jul 2, 2018

I've added the CI server settings to my CI PR, using 10.11. We could potentially use 10.10 instead however.

@CrossR
Copy link
Member

CrossR commented Jul 2, 2018

And the CI build on 10.11 failed due to not being able to load neovim.

The build on 10.12 can be seen here and seems to be doing okay (though the mac CI is flaky at the moment, so it could still fail, but neovim is at least usable.)

@jordan-arenstein
Copy link
Contributor

jordan-arenstein commented Jul 17, 2018

On macOS 10.14 (Mojave) beta, it looks like the neovim binaries (0.3.0, 0.3.1) downloaded from the neovim github releases raise a segmentation fault. Cannot run from the command line, however the same process I'm using (./nvim-osx64/bin/nvim) works for <0.2.2.

There must be some issue with the github releases, because copying and pasting the 0.3.0 release from homebrew into node_modules/oni-neovim-binaries/bin/nvim-osx64/bin allows Oni to run fine.

@CrossR
Copy link
Member

CrossR commented Jul 26, 2018

I've not tried on macOS 10.14 yet, but it looks like with the latest release of NeoVim being merged, 10.11 is working: https://travis-ci.org/onivim/oni/builds/408413986.

@MarcoLosito
Copy link

Same issue here with OSX 10.11 and nvim 0.3.0 and 0.3.1 (tried both).
Fixed (as explained above) by adding this file https://github.com/onivim/oni/blob/master/configuration/config.default.js in
.config/oni/
and adding my nvim path in the "module.exports" section.

"debug.neovimPath": "/usr/local/bin/nvim",

@CrossR
Copy link
Member

CrossR commented Jul 31, 2018

I've been checking on random CI tests since the merge of neovim 0.3.1, and all so far have been passing on 10.11, so I think its fixed on that now on master. (Not all the builds are passing, but that is more the fault of the flaky CI tests on mac).

When I tried on 10.14, I was still getting errors unfortunately, so we may still have an issue there.

@kevinchiu
Copy link

kevinchiu commented Oct 20, 2018

Reproduced with version 0.3.7 on macOS 10.14 from fresh install via release DMG. No local neovim installed, using packaged version.
screen shot 2018-10-20 at 6 21 02 am

@samwightt
Copy link

Same thing happening with me but I have a local neovim as well as a init.vim.

@mikolajpp
Copy link

Latest mojave 10.14.2 here, same issue. Neovim runs fine from terminal, crashes when under onivim.

@bryphe
Copy link
Member Author

bryphe commented Dec 14, 2018

I'm able to reproduce this now after upgrading to mojave. Trying to track this down, a few observations:

  • Running Oni from the command line (open Oni.app) works
  • Running Oni from Finder does not work and exhibits this same failure

Because it works from the command line, a locally built Oni works with yarn launch and yarn start. The problem is not with the Neovim binary bundled in Oni.

I see that there is a difference in the PATH passed to the app via process.env.Path in the command line / Finder case - perhaps that difference is impacting this.

@bryphe
Copy link
Member Author

bryphe commented Dec 14, 2018

Finally found the issue with mojave - it's related to this Neovim issue:
neovim/neovim@57acfce

It seems that the LANG environment variable isn't provided by default when launching from Finder in Mojave, and so that crash was getting hit. Locally, if I had that environment variable to spawn Neovim, life is good again.

@mikolajpp
Copy link

However, trying to launch oni from the terminal and verifying that LANG is indeed set still result in the crash for me. Do we have any workaround for this?

@mikolajpp
Copy link

Ok, suddenly it works now. Here is what has worked for me.

  1. Paste
export LC_ALL=en_US.UTF-8  
export LANG=en_US.UTF-8

into ~/.profile

  1. Source the profile file
. ~/.profile

from ~/.bash_login

  1. Logout, and verify in the terminal with locale command that LANG is not empty.
  2. Launch oni from terminal.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

10 participants