-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Attempting to use an uninitialized RID" error is printed when opening the editor #97694
Comments
Confirmed, also on Linux (Fedora 40). |
Encountered this on Windows as well |
Full callstack:
This error looks like a race condition because it doesn't happen always. A quick analysis shows that it is possible for ExternalTexture::ExternalTexture (I've not confirmed if this is what's happening) to call texture_external_create() from a worker thread, which will allocate, but not initialize, the RID. The RID initialization will be queued. My guess is that ExternalTexture::~ExternalTexture was called before RID initialization; which caused the error. |
If we look at the creation function (FUNCRIDTEX3() it boils down to (simplified): RID ret = RSG::texture_storage->texture_allocate();
if( we_are_in_main_thread )
{
RSG::texture_storage->texture_external_initialize(ret, p1, p2, p3);
}
else
{
command_queue.push(RSG::texture_storage, &RendererTextureStorage::texture_external_initialize, ret, p1, p2, p3);
}
return ret; Now the problem is that doing: RID ret = RSG::texture_storage->texture_allocate();
RenderingServer::get_singleton()->free(ret); Will trigger the error because |
Tested versions
System information
Godot v4.4.dev (e3213aa) - Fedora Linux 40 (KDE Plasma) on X11 - X11 display driver, Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 (nvidia; 560.35.03) - 13th Gen Intel(R) Core(TM) i9-13900K (32 threads)
Issue description
"Attempting to use an uninitialized RID" error is printed when opening the editor.
I bisected the regression from #96982. cc @dsnopek
According to @stuartcarnie, the issue comes from here:
Steps to reproduce
Minimal reproduction project (MRP)
https://github.com/godotengine/godot-demo-projects/tree/master/3d/truck_town (this should be reproducible on an empty project, but I used Truck Town just in case)
The text was updated successfully, but these errors were encountered: