godot: GDScript 2.0: Language server causes crash in GDScriptParser
Godot version
v4.0.dev.custom_build [f1b63dce7]
System information
Linux, x11, nvidia
Issue description
Language server seems to crash sometimes randomly, don’t have found clear reason why this happens. I crashes during code editing (I’m using Emacs with gdscript mode and lsp).
Latest commit from master is 092a2861277e7df87aec10516d713d0bf4adba79
================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.0.dev.custom_build (f1b63dce7121d9b3b2d2c7a1be0ad102207a4b9a)
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /usr/lib/libc.so.6(+0x3cda0) [0x7fa055859da0] (??:0)
[2] StringName::operator String() const (??:0)
[3] GDScriptParser::DataType::to_string() const (??:0)
[4] ExtendGDScriptParser::parse_function_symbol(GDScriptParser::FunctionNode const*, lsp::DocumentSymbol&) (??:0)
[5] ExtendGDScriptParser::parse_class_symbol(GDScriptParser::ClassNode const*, lsp::DocumentSymbol&) (??:0)
[6] ExtendGDScriptParser::update_symbols() (??:0)
[7] ExtendGDScriptParser::parse(String const&, String const&) (??:0)
[8] GDScriptWorkspace::parse_script(String const&, String const&) (??:0)
[9] GDScriptWorkspace::parse_local_script(String const&) (??:0)
[10] GDScriptWorkspace::get_parse_successed_script(String const&) (??:0)
[11] GDScriptWorkspace::resolve_document_links(String const&, List<lsp::DocumentLink, DefaultAllocator>&) (??:0)
[12] GDScriptTextDocument::documentLink(Dictionary const&) (??:0)
[13] void call_with_variant_args_ret_helper<__UnexistingClass, Array, Dictionary const&, 0ul>(__UnexistingClass*, Array (__UnexistingClass::*)(Dictionary const&), Variant const**, Variant&, Callable::CallError&, IndexSequence<0ul>) (??:0)
[14] void call_with_variant_args_ret_dv<__UnexistingClass, Array, Dictionary const&>(__UnexistingClass*, Array (__UnexistingClass::*)(Dictionary const&), Variant const**, int, Variant&, Callable::CallError&, Vector<Variant> const&) (??:0)
[15] MethodBindTR<Array, Dictionary const&>::call(Object*, Variant const**, int, Callable::CallError&) (??:0)
[16] Object::call(StringName const&, Variant const**, int, Callable::CallError&) (??:0)
[17] Object::callv(StringName const&, Array const&) (??:0)
[18] JSONRPC::process_action(Variant const&, bool) (??:0)
[19] JSONRPC::process_string(String const&) (??:0)
[20] GDScriptLanguageProtocol::process_message(String const&) (??:0)
[21] GDScriptLanguageProtocol::LSPeer::handle_data() (??:0)
[22] GDScriptLanguageProtocol::poll() (??:0)
[23] GDScriptLanguageServer::thread_main(void*) (??:0)
[24] Thread::callback(Thread*, Thread::Settings const&, void (*)(void*), void*) (??:0)
[25] void std::__invoke_impl<void, void (*)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*, Thread::Settings, void (*)(void*), void*>(std::__invoke_other, void (*&&)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*&&, Thread::Settings&&, void (*&&)(void*), void*&&) (??:0)
[26] std::__invoke_result<void (*)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*, Thread::Settings, void (*)(void*), void*>::type std::__invoke<void (*)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*, Thread::Settings, void (*)(void*), void*>(void (*&&)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*&&, Thread::Settings&&, void (*&&)(void*), void*&&) (??:0)
[27] void std::thread::_Invoker<std::tuple<void (*)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*, Thread::Settings, void (*)(void*), void*> >::_M_invoke<0ul, 1ul, 2ul, 3ul, 4ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul, 4ul>) (??:0)
[28] std::thread::_Invoker<std::tuple<void (*)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*, Thread::Settings, void (*)(void*), void*> >::operator()() (??:0)
[29] std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*, Thread::Settings, void (*)(void*), void*> > >::_M_run() (??:0)
[30] /home/amatrelan/Projects/godot/bin/godot.linuxbsd.tools.64(+0x6966674) [0x5630cc650674] (??:0)
[31] /usr/lib/libpthread.so.0(+0x9259) [0x7fa055b3f259] (??:0)
[32] /usr/lib/libc.so.6(clone+0x43) [0x7fa05591b5e3] (??:0)
-- END OF BACKTRACE --
================================================================
Steps to reproduce
Don’t have clear reproduce yet, restarting engine and it continues to work and then again after some time crashes.
Minimal reproduction project
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 40 (15 by maintainers)
Based on #66306 changeset I think this is also needed if
script_typecan be null.cc @Razoric480
Might just be that VSCode’s internal LSP stuff is more stable and/or that emacs does something strange with the requests that the server can’t handle. You could try setting up VSCode with the Godot-tools extension and see if that, too, crashes for you, in which case it might be a linux thing.
Hmm.
Ok now found one way to crash. took while to find out good way to crash. And still little random.
After this is seems to spam errors in editor and terminal and after some time it crashes.
The annoying part about this is that I cannot create example from this. Now that it crashed few times in my project it stopped crashing, there seems to be some hidden things hiding still what I don’t know yet.
It seems sometimes LSP or Script parser continues to try resolve things what are broken and after sometime it crashes, and it don’t seem to do this always.
Whole log