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

The Neovim process has crashed when open .xm file #722

Closed
peter-lyr opened this issue Jan 13, 2023 · 10 comments · Fixed by #725
Closed

The Neovim process has crashed when open .xm file #722

peter-lyr opened this issue Jan 13, 2023 · 10 comments · Fixed by #725
Labels
bug Something isn't working

Comments

@peter-lyr
Copy link

Description

The Neovim process has crashed when open .xm file.
It's ok if I rename the .xm file to .txt.

Neovim version

0.8.0, 0.8.2

Operating system and version

Windows 10

Expected behavior

.xm file opened successfully and I can edit it.

Actual behavior

The Neovim process has crashed.
image

Minimal config

local status, gitsigns = pcall(require, "gitsigns")
if not status then
  return
end

-- 打开.xm文件意外退出是以下导致的
gitsigns.setup({})

Steps to reproduce

  1. unzip nvim-win64 to my %home%.
  2. clone https://github.com/lewis6991/gitsigns.nvim to share\nvim\runtime\pack\packer\start
  3. double click bin\nvim-qt.exe to open it.
  4. drag my app.xm file to it.
  5. it crashed.

image
image

Gitsigns debug messages

I can't see any debug messages.

@peter-lyr peter-lyr added the bug Something isn't working label Jan 13, 2023
@lewis6991
Copy link
Owner

Sorry, there's no information here I can use to look into anything. If Neovim crashes, it is usually a problem with Neovim itself and with such cases a backtrace is required to investigate anything.

@lewis6991 lewis6991 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 13, 2023
@peter-lyr
Copy link
Author

Thanks, Neovim crashes if the .xm file is in a git working directory. But when I copy the same .xm file to somewhere else, it will not crash.

@lewis6991
Copy link
Owner

Can you share a minimal .xm files that crashes?

@peter-lyr
Copy link
Author

It woud crash even though I delete all lines in the file named app.xm.
app.zip

@lewis6991
Copy link
Owner

Ok, it crashed for me too.

It is having trouble because the encoding of the file is utf-16le.

@lewis6991 lewis6991 reopened this Jan 13, 2023
@ianhomer
Copy link

ianhomer commented Jan 19, 2023

Perhaps related to vim.iconv change ee61b32 - I have a utf-16le file that is crashing out nvim. When I roll back to the commit before that neovim doesn't crash.

Been trying to find the fix, but not quite there, although if I do change line 367 in git.lua to either

stdout[i] = l

or

stdout[i] = vim.iconv(string.gsub(l, '%c', ''), encoding, 'utf-8')

then neovim doesn't crash when loading the utf-16le file, although gitsigns shows the sign for all lines in the file, i.e. it thinks all lines have changed.

gitsigns works for other files though with this change in. Any suggestions? Things I can try / test?

edit: note that neither airblade/vim-gitguttern nor mhinz/vim-signify render git signs for this utf-16le file. Perhaps a first step may be to disable gitsigns for utf-16le files (as opposed to crashing out)

@lewis6991
Copy link
Owner

I've raised neovim/neovim#21924 to re-implement iconv to handle utf-16 better.

lewis6991 added a commit that referenced this issue Jan 20, 2023
- also add BOM stripping

Fixes: #722
lewis6991 added a commit that referenced this issue Jan 20, 2023
- also add BOM stripping

Fixes: #722
@lewis6991
Copy link
Owner

#725 should work around the issue for now, but I do plan to fix vim.iconv properly so the diff works properly.

@ianhomer
Copy link

ianhomer commented Jan 20, 2023

Thank you. That stabilises it for me. No crash on opening up a utf-16le file

@peter-lyr
Copy link
Author

Thanks! It's OK for me too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants