Godot crashes when using an external editor (neovim)
Tested versions
- Reproducible in Godot 4.3-beta2, Godot4.3-rc1
System information
Godot v4.3.rc1 - Arch Linux #1 SMP PREEMPT_DYNAMIC Wed, 24 Jul 2024 22:25:43 +0000 - Wayland - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 1060 6GB (nvidia; 555.58.02) - AMD Ryzen 5 1600 Six-Core Processor (12 Threads)
Issue description
When I am editing a script utilizing neovim as an external editor, sometimes the Godot Editor crashes leaving the following Stack Trace:
ERROR: Cannot get class '@GDScript'.
at: _get_parent_class (core/object/class_db.cpp:320)
================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.3.rc1.official (e343dbbcc1030f04dc5833f1c19d267a17332ca9)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x3d1d0) [0x7691f1c2c1d0] (??:0)
[2] /home/alexcg/Descargas/Godot_v4.3-rc1_linux.x86_64() [0x5d005a] (??:0)
[3] /home/alexcg/Descargas/Godot_v4.3-rc1_linux.x86_64() [0x47fcd6d] (??:0)
[4] /home/alexcg/Descargas/Godot_v4.3-rc1_linux.x86_64() [0x4310194] (??:0)
[5] /home/alexcg/Descargas/Godot_v4.3-rc1_linux.x86_64() [0x23b359c] (??:0)
[6] /home/alexcg/Descargas/Godot_v4.3-rc1_linux.x86_64() [0x527520] (??:0)
[7] /home/alexcg/Descargas/Godot_v4.3-rc1_linux.x86_64() [0x420282] (??:0)
[8] /usr/lib/libc.so.6(+0x25e08) [0x7691f1c14e08] (??:0)
[9] /usr/lib/libc.so.6(__libc_start_main+0x8c) [0x7691f1c14ecc] (??:0)
[10] /home/alexcg/Descargas/Godot_v4.3-rc1_linux.x86_64() [0x43d42a] (??:0)
-- END OF BACKTRACE --
================================================================
Or this one:
Generated 'res://scripts/enemy/pathFollowers/defend_state_follow.gd' preview in 121737 usec
================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.3.rc1.official (e343dbbcc1030f04dc5833f1c19d267a17332ca9)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x3d1d0) [0x7100479111d0] (??:0)
[2] /home/alexcg/Descargas/Godot_v4.3-rc1_linux.x86_64() [0x5d005a] (??:0)
[3] /home/alexcg/Descargas/Godot_v4.3-rc1_linux.x86_64() [0x47fcd6d] (??:0)
[4] /home/alexcg/Descargas/Godot_v4.3-rc1_linux.x86_64() [0x4310194] (??:0)
[5] /home/alexcg/Descargas/Godot_v4.3-rc1_linux.x86_64() [0x23b359c] (??:0)
[6] /home/alexcg/Descargas/Godot_v4.3-rc1_linux.x86_64() [0x527520] (??:0)
[7] /home/alexcg/Descargas/Godot_v4.3-rc1_linux.x86_64() [0x420282] (??:0)
[8] /usr/lib/libc.so.6(+0x25e08) [0x7100478f9e08] (??:0)
[9] /usr/lib/libc.so.6(__libc_start_main+0x8c) [0x7100478f9ecc] (??:0)
[10] /home/alexcg/Descargas/Godot_v4.3-rc1_linux.x86_64() [0x43d42a] (??:0)
-- END OF BACKTRACE --
================================================================
In neovim, I get the following error:
LSP[gdscript]: Error READ_ERROR: "ECONNRESET"
Sometimes it crashes 2-3 minutes after start editing scripts, and sometimes it can be more than 2 hours without a crash. It doesn't seem to creash when using the built-in text editor. I have tried different versions of the glibc package, and different versions of the Godot Editor, and the crashes haven't stopped. I am getting the feeling that the crashes are more frequent when I am writing comments in the code and when I save the file, but I'm not entirely sure.
My configuration in the Godot Editor for using neovim as an external editor is the following:
text_editor/external/exec_path: nvim
text_editor/external/exec_flags: --server ./godothost --remote-send "<C-\><C-N>:n {file}<CR>{line}G{col}|"
I open neovim using: nvim --listen ./godothost
Neovim is configured to connect to the Godot Lenguage Server.
https://github.com/user-attachments/assets/185551fa-ab81-407f-aa55-1d1456dcf776
Steps to reproduce
- Open a Godot project
- Configure Godot to use an external editor
- Open neovim
- Start editing an script and saving the file
- Now Godot may crash
Minimal reproduction project (MRP)
N/A
Can you get a full backtrace by (compiling an editor binary](https://docs.godotengine.org/en/latest/contributing/development/compiling/compiling_for_linuxbsd.html) with the debug_symbols=yes SCons option, and running it until it crashes?
I've compiled it with the debug symbols enabled and used it until it crashed. This crash happened after writing a comment and saving the file:
================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.3.rc.custom_build (607b230ffe120b2757c56bd3d52a7a0d4e502cfe)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x3d1d0) [0x763f831a41d0] (??:0)
[2] /home/alexcg/Descargas/godot/bin/godot.linuxbsd.editor.x86_64(+0x37dfed8) [0x61d8dff01ed8] (/home/alexcg/Descargas/godot/scene/resources/mesh.cpp:1566 (discriminator 2))
[3] /home/alexcg/Descargas/godot/bin/godot.linuxbsd.editor.x86_64(+0x37e021f) [0x61d8dff0221f] (/home/alexcg/Descargas/godot/./core/templates/cowdata.h:477)
[4] /home/alexcg/Descargas/godot/bin/godot.linuxbsd.editor.x86_64(+0x7fe960) [0x61d8dcf20960] (/home/alexcg/Descargas/godot/./core/variant/typed_array.h:137)
[5] /home/alexcg/Descargas/godot/bin/godot.linuxbsd.editor.x86_64(+0x4fd88b2) [0x61d8e16fa8b2] (/home/alexcg/Descargas/godot/core/object/message_queue.cpp:221)
[6] /home/alexcg/Descargas/godot/bin/godot.linuxbsd.editor.x86_64(+0x4fd8b45) [0x61d8e16fab45] (/home/alexcg/Descargas/godot/core/object/message_queue.cpp:268)
[7] /home/alexcg/Descargas/godot/bin/godot.linuxbsd.editor.x86_64(+0x2abd504) [0x61d8df1df504] (/home/alexcg/Descargas/godot/scene/main/scene_tree.cpp:494)
[8] /home/alexcg/Descargas/godot/bin/godot.linuxbsd.editor.x86_64(+0x6a863b) [0x61d8dcdca63b] (/home/alexcg/Descargas/godot/main/main.cpp:4067 (discriminator 2))
[9] /home/alexcg/Descargas/godot/bin/godot.linuxbsd.editor.x86_64(+0x611141) [0x61d8dcd33141] (/home/alexcg/Descargas/godot/platform/linuxbsd/os_linuxbsd.cpp:962 (discriminator 1))
[10] /home/alexcg/Descargas/godot/bin/godot.linuxbsd.editor.x86_64(+0x5e8972) [0x61d8dcd0a972] (/home/alexcg/Descargas/godot/platform/linuxbsd/godot_linuxbsd.cpp:85)
[11] /usr/lib/libc.so.6(+0x25e08) [0x763f8318ce08] (??:0)
[12] /usr/lib/libc.so.6(__libc_start_main+0x8c) [0x763f8318cecc] (??:0)
[13] /home/alexcg/Descargas/godot/bin/godot.linuxbsd.editor.x86_64(+0x60df15) [0x61d8dcd2ff15] (??:?)
-- END OF BACKTRACE --
================================================================
My configuration in the Godot Editor for using neovim as an external editor is the following: text_editor/external/exec_path: nvim text_editor/external/exec_flags: --server ./godothost --remote-send "<C->:n {file}{line}G{col}|"
I open neovim using: nvim --listen ./godothost Neovim is configured to connect to the Godot Lenguage Server.
Is it supposed to work without installling any Godot plugin? I'm stuck there:
Sorry, I have just noticed that the markdown formatting must have changed the text of the options. The ones I am using are:
text_editor/external/exec_path: nvim
text_editor/external/exec_flags: --server ./godothost --remote-send "<C-\><C-N>:n {file}<CR>{line}G{col}|"
I have used this guide to get it to work, but supposedly you only need plugins if you want LSP and code completion. The last part of the guide explains how to setup Neovim as an external editor. Two things that may be important are that, you have to open neovim at the root of your project, and that if you are on Windows you might have to specify a IP:port combination when opening neovim, like "127.0.0.1:9696"
I experienced same editor crash with the same neovim settings on macOS godot 4.3 rc 2.
I have similar issues as @a-collado using Godot on linux with vscode. Crashes sometimes happen every 3-10 minutes. They started happening more the more typed entities I'm introducing to project. Crashes are happening while I'm editing files in vscode.
================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.2.2.stable.arch_linux
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x3d1d0) [0x7f009515d1d0] (??:0)
[2] /usr/bin/godot(+0x33c97c) [0x62b4dbac297c] (??:?)
[3] /usr/bin/godot(+0x2e16e0) [0x62b4dba676e0] (??:?)
[4] /usr/bin/godot(+0x3e98432) [0x62b4df61e432] (??:?)
[5] /usr/bin/godot(+0x2d3667) [0x62b4dba59667] (??:?)
[6] /usr/bin/godot(+0x2da850) [0x62b4dba60850] (??:?)
[7] /usr/bin/godot(+0x2da2bf) [0x62b4dba602bf] (??:?)
[8] /usr/bin/godot(+0x2dc4e5) [0x62b4dba624e5] (??:?)
[9] /usr/bin/godot(+0x2ddb89) [0x62b4dba63b89] (??:?)
[10] /usr/bin/godot(+0x2dee07) [0x62b4dba64e07] (??:?)
[11] /usr/bin/godot(+0x2eeff5) [0x62b4dba74ff5] (??:?)
[12] /usr/bin/godot(+0x2f9da4) [0x62b4dba7fda4] (??:?)
[13] /usr/bin/godot(+0x38b244) [0x62b4dbb11244] (??:?)
[14] /usr/bin/godot(+0x166e0ec) [0x62b4dcdf40ec] (??:?)
[15] /usr/bin/godot(+0x1669043) [0x62b4dcdef043] (??:?)
[16] /usr/bin/godot(+0x1696032) [0x62b4dce1c032] (??:?)
[17] /usr/bin/godot(+0x42137f) [0x62b4dbba737f] (??:?)
[18] /usr/bin/godot(+0x4159ac) [0x62b4dbb9b9ac] (??:?)
[19] /usr/bin/godot(+0x3c20321) [0x62b4df3a6321] (??:?)
[20] /usr/bin/godot(+0x3c10244) [0x62b4df396244] (??:?)
[21] /usr/bin/godot(+0x7907e3) [0x62b4dbf167e3] (??:?)
[22] /usr/bin/godot(+0x7997b5) [0x62b4dbf1f7b5] (??:?)
[23] /usr/bin/godot(+0x454f31) [0x62b4dbbdaf31] (??:?)
[24] /usr/bin/godot(+0x45549f) [0x62b4dbbdb49f] (??:?)
[25] /usr/bin/godot(+0x380b6c5) [0x62b4def916c5] (??:?)
[26] /usr/bin/godot(+0x42710e4) [0x62b4df9f70e4] (??:?)
[27] /usr/lib/libc.so.6(+0x9439d) [0x7f00951b439d] (??:0)
[28] /usr/lib/libc.so.6(+0x11949c) [0x7f009523949c] (??:0)
-- END OF BACKTRACE --
================================================================
Can you download a build with symbols and paste an actually useful backtrace?
@Zireael07 Sure, here:
================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.2.2.stable.custom_build (15073afe3856abd2aa1622492fe50026c7d63dc1)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] /usr/lib/libc.so.6(+0x3d1d0) [0x72206a3091d0] (??:0)
[2] bin/godot.linuxbsd.editor.x86_64(+0x895092) [0x55b95aeac092] (./core/templates/cowdata.h:81)
[3] bin/godot.linuxbsd.editor.x86_64(+0x7f934b) [0x55b95ae1034b] (modules/gdscript/gdscript_analyzer.cpp:312)
[4] bin/godot.linuxbsd.editor.x86_64(+0x7fbce7) [0x55b95ae12ce7] (modules/gdscript/gdscript_analyzer.cpp:570)
[5] bin/godot.linuxbsd.editor.x86_64(+0x82733f) [0x55b95ae3e33f] (modules/gdscript/gdscript_cache.cpp:77)
[6] bin/godot.linuxbsd.editor.x86_64(+0x7ea6a5) [0x55b95ae016a5] (modules/gdscript/gdscript_analyzer.cpp:3547)
[7] bin/godot.linuxbsd.editor.x86_64(+0x7ede95) [0x55b95ae04e95] (modules/gdscript/gdscript_analyzer.cpp:4031)
[8] bin/godot.linuxbsd.editor.x86_64(+0x7f101a) [0x55b95ae0801a] (modules/gdscript/gdscript_analyzer.cpp:2458)
[9] bin/godot.linuxbsd.editor.x86_64(+0x80e5a2) [0x55b95ae255a2] (modules/gdscript/gdscript_analyzer.cpp:3280)
[10] bin/godot.linuxbsd.editor.x86_64(+0x7f0fd5) [0x55b95ae07fd5] (modules/gdscript/gdscript_analyzer.cpp:2446)
[11] bin/godot.linuxbsd.editor.x86_64(+0x80e2d8) [0x55b95ae252d8] (./core/templates/cowdata.h:81)
[12] bin/godot.linuxbsd.editor.x86_64(+0x7f0fd5) [0x55b95ae07fd5] (modules/gdscript/gdscript_analyzer.cpp:2446)
[13] bin/godot.linuxbsd.editor.x86_64(+0x8154ab) [0x55b95ae2c4ab] (./core/templates/list.h:456)
[14] bin/godot.linuxbsd.editor.x86_64(+0x8175bb) [0x55b95ae2e5bb] (modules/gdscript/gdscript_analyzer.cpp:1797)
[15] bin/godot.linuxbsd.editor.x86_64(+0x819402) [0x55b95ae30402] (modules/gdscript/gdscript_analyzer.cpp:1777)
[16] bin/godot.linuxbsd.editor.x86_64(+0x81aa7b) [0x55b95ae31a7b] (modules/gdscript/gdscript_analyzer.cpp:1408)
[17] bin/godot.linuxbsd.editor.x86_64(+0x858b4a) [0x55b95ae6fb4a] (modules/gdscript/gdscript_editor.cpp:137)
[18] bin/godot.linuxbsd.editor.x86_64(+0x1ef3772) [0x55b95c50a772] (./core/templates/cowdata.h:415)
[19] bin/godot.linuxbsd.editor.x86_64(+0x1eb1458) [0x55b95c4c8458] (editor/plugins/script_editor_plugin.cpp:1914)
[20] bin/godot.linuxbsd.editor.x86_64(+0x1eb64f6) [0x55b95c4cd4f6] (editor/plugins/script_editor_plugin.cpp:2207)
[21] bin/godot.linuxbsd.editor.x86_64(+0x470c45c) [0x55b95ed2345c] (core/object/object.cpp:1130)
[22] bin/godot.linuxbsd.editor.x86_64(+0x46ff520) [0x55b95ed16520] (./core/string/string_name.h:192 (discriminator 1))
[23] bin/godot.linuxbsd.editor.x86_64(+0x47138ac) [0x55b95ed2a8ac] (./core/object/method_bind.h:264 (discriminator 1))
[24] bin/godot.linuxbsd.editor.x86_64(+0x4701ef7) [0x55b95ed18ef7] (core/object/object.cpp:775 (discriminator 1))
[25] bin/godot.linuxbsd.editor.x86_64(+0x442a059) [0x55b95ea41059] (core/variant/callable.cpp:69 (discriminator 1))
[26] bin/godot.linuxbsd.editor.x86_64(+0x46fa5b2) [0x55b95ed115b2] (core/object/message_queue.cpp:222)
[27] bin/godot.linuxbsd.editor.x86_64(+0x46fd86b) [0x55b95ed1486b] (core/object/message_queue.cpp:326)
[28] bin/godot.linuxbsd.editor.x86_64(+0x2708e4b) [0x55b95cd1fe4b] (scene/main/scene_tree.cpp:473)
[29] bin/godot.linuxbsd.editor.x86_64(+0x5eacc2) [0x55b95ac01cc2] (main/main.cpp:3640 (discriminator 2))
[30] bin/godot.linuxbsd.editor.x86_64(+0x57c771) [0x55b95ab93771] (platform/linuxbsd/os_linuxbsd.cpp:958 (discriminator 1))
[31] bin/godot.linuxbsd.editor.x86_64(+0x56c046) [0x55b95ab83046] (platform/linuxbsd/godot_linuxbsd.cpp:74)
[32] /usr/lib/libc.so.6(+0x25e08) [0x72206a2f1e08] (??:0)
[33] /usr/lib/libc.so.6(__libc_start_main+0x8c) [0x72206a2f1ecc] (??:0)
[34] bin/godot.linuxbsd.editor.x86_64(+0x579d35) [0x55b95ab90d35] (??:?)
-- END OF BACKTRACE --
================================================================
Update: looks like Godot crashes mostly when multiple files are being saved at the same time.
I have similar issues as @a-collado using Godot on linux with vscode. Crashes sometimes happen every 3-10 minutes. They started happening more the more typed entities I'm introducing to project. Crashes are happening while I'm editing files in vscode. ...........
I'm getting the crash using Cursor (fork of VSCode). I tried using a build from here https://github.com/Calinou/godot-debug-builds/releases to get debugging info but got nothing, something else I got to do for that to work? My last crash was when moving a line up multiple lines (line-by-line). I also have auto-saving on, so I guess the files got saved multiple times rapidly?
================================================================
CrashHandlerException: Program crashed
Engine version: Godot Engine v4.3.stable.custom_build (77dcf97d82cbfe4e4615475fa52ca03da645dbd8)Dumping the backtrace. Please include this when reporting the bug to the project developer.
[0] <couldn't map PC to fn name>
[1] <couldn't map PC to fn name>
[2] <couldn't map PC to fn name>
[3] <couldn't map PC to fn name>
[4] <couldn't map PC to fn name>
[5] <couldn't map PC to fn name>
[6] <couldn't map PC to fn name>
[7] <couldn't map PC to fn name>
[8] <couldn't map PC to fn name>
[9] <couldn't map PC to fn name>
[10] <couldn't map PC to fn name>
[11] <couldn't map PC to fn name>
[12] <couldn't map PC to fn name>
[13] <couldn't map PC to fn name>
[14] <couldn't map PC to fn name>
[15] <couldn't map PC to fn name>
[16] <couldn't map PC to fn name>
[17] <couldn't map PC to fn name>
[18] <couldn't map PC to fn name>
[19] <couldn't map PC to fn name>
[20] <couldn't map PC to fn name>
[21] <couldn't map PC to fn name>
[22] <couldn't map PC to fn name>
[23] <couldn't map PC to fn name>
[24] <couldn't map PC to fn name>
[25] <couldn't map PC to fn name>
[26] <couldn't map PC to fn name>
[27] <couldn't map PC to fn name>
[28] <couldn't map PC to fn name>
-- END OF BACKTRACE --
================================================================
I removed neovim from the title, as it seems to be not entirely related to the code editor itself.
The crashes seem to stop when no script files are open in godot
The issue seems to be gone in 4.4.dev4