neovim / neovim

Vim-fork focused on extensibility and usability
https://neovim.io
Other
81.81k stars 5.6k forks source link

win: failed assertion "_osfile(fh) & FOPEN" during debugging #8472

Open justinmk opened 6 years ago

justinmk commented 6 years ago

Steps to reproduce using nvim -u NORC

  1. Using the Visual Studio 2017 build steps, build Nvim with the x86-Debug configuration.
  2. Use the Visual Studio debugger to start nvim.exe .
  3. The execution fails in fopen_noinh_readbin .. fdopen with an assertion error: _osfile(fh) & FOPEN .

Notes

There is this old libuv issue but the problem may just be a race.

Need more investigation.

janlazo commented 6 years ago

Does it happen in MINGW_32? It can't build helptags now because nvim.exe crashes immediately (commands for --cmd don't run).

rkolchmeyer commented 2 years ago

In case anyone else runs into this - I got past this by building with a Release configuration instead of a Debug configuration. I suspect what's happening is that the Debug build links against a debug UCRT (ucrtbased.dll), which conflicts with a release UCRT (ucrtbase.dll) that gets pulled in by the bundled uv.dll. I think file descriptors returned by ucrtbase.dll are invalid in ucrtbased.dll, resulting in the _osfile(fh) & FOPEN assertion error, but I am not certain.