Skip to content

_regen_script_doc_thread crashes because it might be still running on exit #107407

@jamie-pate

Description

@jamie-pate

Tested versions

  • Reproducible in Godot v4.5.dev5
  • Not reproducible in Godot v4.4.1-stable

System information

Ubuntu 22.04.5 LTS 22.04 on X11 - X11 display driver, Multi-window, 1 monitor - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 3050 Laptop GPU - 12th Gen Intel(R) Core(TM) i7-12700H (14 threads)

Issue description

_regen_script_doc_thread() may crash after the rest of the program exits if it's still running. The program only 'crashes' sometimes because everything else is already shut down, but other times it segfaults

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.5.dev5.official (64b09905c7b2877f8aef99d8b63e73e5d31acfb9)
Dumping the backtrace. Please include this when reporting the bug on: https://github.com/godotengine/godot/issues
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x42520) [0x7c9180842520] (??:0)
[2] /home/jpate/bin/Godot_v4.5-dev5_linux.x86_64() [0x17013cc] (??:0)
[3] /home/jpate/bin/Godot_v4.5-dev5_linux.x86_64() [0x170135c] (??:0)
[4] /home/jpate/bin/Godot_v4.5-dev5_linux.x86_64() [0x170135c] (??:0)
[5] /home/jpate/bin/Godot_v4.5-dev5_linux.x86_64() [0x1725b76] (??:0)
[6] /home/jpate/bin/Godot_v4.5-dev5_linux.x86_64() [0x42753d5] (??:0)
[7] /home/jpate/bin/Godot_v4.5-dev5_linux.x86_64() [0x5011913] (??:0)
[8] /lib/x86_64-linux-gnu/libc.so.6(+0x94ac3) [0x7c9180894ac3] (??:0)
[9] /lib/x86_64-linux-gnu/libc.so.6(+0x126850) [0x7c9180926850] (??:0)
-- END OF C++ BACKTRACE --
================================================================
Aborted
$ echo $?
CowData<EditorFileSystemDirectory::FileInfo*>::size(const CowData<EditorFileSystemDirectory::FileInfo*> * const this) (/home/jpate/build/src/godot/core/templates/cowdata.h:197)
Vector<EditorFileSystemDirectory::FileInfo*>::size(const Vector<EditorFileSystemDirectory::FileInfo*> * const this) (/home/jpate/build/src/godot/core/templates/vector.h:92)
EditorFileSystemDirectory::get_file_count(const EditorFileSystemDirectory * const this) (/home/jpate/build/src/godot/editor/editor_file_system.cpp:91)
EditorHelp::_reload_scripts_documentation(EditorFileSystemDirectory * p_dir) (/home/jpate/build/src/godot/editor/editor_help.cpp:3138)
EditorHelp::_reload_scripts_documentation(EditorFileSystemDirectory * p_dir) (/home/jpate/build/src/godot/editor/editor_help.cpp:3135)
EditorHelp::_reload_scripts_documentation(EditorFileSystemDirectory * p_dir) (/home/jpate/build/src/godot/editor/editor_help.cpp:3135)
EditorHelp::_regen_script_doc_thread(void * p_udata) (/home/jpate/build/src/godot/editor/editor_help.cpp:3125)
Thread::callback(Thread::ID p_caller_id, const Thread::Settings & p_settings, Thread::Callback p_callback, void * p_userdata) (/home/jpate/build/src/godot/core/os/thread.cpp:64)
std::__invoke_impl<void, void (*)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long, Thread::Settings, void (*)(void*), void*>(void (*&&)(unsigned long, const Thread::Settings &, void (*)(void *), void *) __f) (/usr/include/c++/11/bits/invoke.h:61)
std::__invoke<void (*)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long, Thread::Settings, void (*)(void*), void*>(void (*&&)(unsigned long, const Thread::Settings &, void (*)(void *), void *) __fn) (/usr/include/c++/11/bits/invoke.h:96)
std::thread::_Invoker<std::tuple<void (*)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long, Thread::Settings, void (*)(void*), void*> >::_M_invoke<0ul, 1ul, 2ul, 3ul, 4ul>(std::thread::_Invoker<std::tuple<void (*)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long, Thread::Settings, void (*)(void*), void*> > * const this) (/usr/include/c++/11/bits/std_thread.h:259)
std::thread::_Invoker<std::tuple<void (*)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long, Thread::Settings, void (*)(void*), void*> >::operator()(std::thread::_Invoker<std::tuple<void (*)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long, Thread::Settings, void (*)(void*), void*> > * const this) (/usr/include/c++/11/bits/std_thread.h:266)
std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long, Thread::Settings, void (*)(void*), void*> > >::_M_run(std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)(unsigned long, Thread::Settings const&, void (*)(void*), void*), unsigned long, Thread::Settings, void (*)(void*), void*> > > * const this) (/usr/include/c++/11/bits/std_thread.h:211)
execute_native_thread_routine (Unknown Source:0)
libc.so.6!start_thread(void * arg) (pthread_create.c:442)
libc.so.6!clone3() (clone3.S:81)

Steps to reproduce

download reproduction repo
run ./repro.sh <path-to-godot-binary>

Minimal reproduction project (MRP)

doc-cache-crash.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Very Bad

    Status

    For team assessment

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions