Hide Forgot
Created attachment 1802648 [details] nvim -v output Description of problem: nvim crashes on aarch64 with Lua issues. Version-Release number of selected component (if applicable): 0.5.0-2.fc34 How reproducible: 100% Steps to Reproduce: 1. dnf install neovim 2. nvim -v Actual results: Output (attached) contains error "E5106: Error while creating vim module: vim.lua:85: bad argument #1 to 'insert' (table expected, got nil)" Expected results: No errors Additional info: Launching nvim and pressing any key crashes nvim with the following being printed: "PANIC: unprotected error in call to Lua API (bad argument #-1 (function expected, got nil))" Clean build from neovim GitHub repo is possible and results in no issues.
Created attachment 1802713 [details] backtrace backtrace when launching nvim and hitting enter
Upstream builds against luajit instead of lua 5.4.3, as does the Fedora package for x86_64 where this bug doesn't manifest. But building against the system `luajit-2.1.0-0.19beta3.fc34` by adding `aarch64` to the bcond stanze at the top of the spec file fails, despite upstream also using what claims to be 2.1.0-beta3. Perhaps the next step is to figure out what the difference is there; the Fedora luajit has a lot of arch-specific patches. ``` cd /src/neovim-0.5.0/aarch64-redhat-linux-gnu/src/nvim && /usr/bin/luajit /src/neovim-0.5.0/src/nvim/generators/gen_declarations.lua /src/neovim-0.5.0/src/nvim/api/tabpage.c /src/neovim-0.5.0/aarch64-redhat-linux-gnu/src/nvim/auto/api/tabpage.c.generated.h /src/neovim-0.5.0/aarch64-redhat-linux-gnu/include/api/tabpage.h.generated.h /src/neovim-0.5.0/aarch64-redhat-linux-gnu/src/nvim/auto/api/tabpage.i /usr/bin/luajit: bad light userdata pointer stack traceback: [C]: in function 'match' /src/neovim-0.5.0/src/nvim/generators/gen_declarations.lua:252: in main chunk [C]: at 0xaaaaddd512d0 gmake[2]: *** [src/nvim/CMakeFiles/nvim.dir/build.make:124: src/nvim/auto/api/tabpage.c.generated.h] Error 1 ```
Ive been digging around and confirm the above with building against Luajit (by adding aarch64). Upstream pull from a newer version of Luajit : https://github.com/neovim/neovim/blob/master/third-party/CMakeLists.txt#L159 I believe this issue is with Luajit on aarch64 (https://github.com/LuaJIT/LuaJIT/pull/230) which was fixed in https://github.com/LuaJIT/LuaJIT/commit/e9af1abec542e6f9851ff2368e7f196b6382a44c or at some other point between packaged Luajit and HEAD. Neovim previously had calls to lightuserdata which caused issues on aarch64 but these were removed ( https://github.com/neovim/neovim/pull/7880). Building neovim on aarch64 causes these to be pulled in from Luajit/lua.h causing the compilation issue(not 100% sure). ~/rpmbuild/SPECS grep -r "lightuserdata" ../BUILD/neovim-0.5.0 * ../BUILD/neovim-0.5.0/aarch64-redhat-linux-gnu/src/nvim/auto/api/buffer.i:extern void (lua_pushlightuserdata) (lua_State *L, void *p); ../BUILD/neovim-0.5.0/aarch64-redhat-linux-gnu/src/nvim/auto/api/deprecated.i:extern void (lua_pushlightuserdata) (lua_State *L, void *p); Building Luajit with source from HEAD and no additional patches allows successful neovim compilation but additionally fixes the crash/error reported.
luajit doesn't work on aarch64. However we should build neovim against lua 5.1 in this case as neovim only supports 5.1. I've already prepared lua5.1-bit32 but need commit rights for the repo. Once I have builds for that, we can fix neovim. It looks like there is a bit of development on luajit but there haven't been a release in years. There was a moonjit approach to fix that but this is also dead.
FEDORA-2021-a441f55415 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-a441f55415
FEDORA-2021-a441f55415 has been pushed to the Fedora 35 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2021-fb71ca974a has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-fb71ca974a
Could you please test the fedora update mentioned in comment #7 and give positive karma for the bug if it works for you?
Changes in comment #7 fix the issues I originally encountered, thank you.
Thanks for testing!
FEDORA-2021-fb71ca974a has been pushed to the Fedora 34 stable repository. If problem still persists, please make note of it in this bug report.
I can confirm the package is available in Fedora 34 updates and addresses the issue. Thanks for fixing!