Condition "!success" is true. and Parameter "_fp" is null.
Tested versions
-Reproducible: v4.5.stable, v4.5.1.stable, v4.6.dev6
System information
Godot v4.5.1.stable - Windows 11 (build 26100) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1050 Ti (NVIDIA; 32.0.15.8180) - AMD Ryzen 9 9900X 12-Core Processor (24 threads) - 31.11 GiB memory
Issue description
i just run the scene im working on, it loads for a while(like expected), it then starts spawning the sub elements, the player then crashes and spams the Debugger with:
world.gd:199 @ gen_chunk(): Condition "!success" is true.
<C++ Source> core/variant/array.cpp:63 @ _ref()
<Stack Trace> world.gd:199 @ gen_chunk()
and
world.gd:199 @ gen_chunk(): Parameter "_fp" is null.
<C++ Source> core/variant/array.cpp:55 @ _ref()
<Stack Trace> world.gd:199 @ gen_chunk()
Steps to reproduce
i have no idea what is causing it, or how to reproduce it. it is possible that im abusing something, causing it to crash. But ether way at least getting those errors are really unhelpful
Minimal reproduction project (MRP)
run Main.tscn https://github.com/user-attachments/files/24019606/mrp.zip
I couldn't reproduce this on master, although I did get errors relating to the icon being set to res://icon.svg but the file not existing
possible that is't my hardware then?
I get these errors, but not the ones you described.
here is the errors i get
try to add the icon back, maybe that changes it?
try to add the icon back, maybe that changes it?
I just removed the icon.svg reference from the project settings and running it resulted in no errors. Are those errors from the MRP?
Yeah
Actually, I think this may be a race condition created by your use of WorkerThreadPool, and so it's not really a Godot issue.
The memory also just seems to grow unbounded until it reaches 5 GiB:
at which point I see these errors:
You'll need to stop modifying chunkLibList in your worker thread and in your main thread simultaneously without thread synchronization primitives like a Mutex. See Thread-safe APIs for more info, and especially this part:
GDScript arrays, dictionaries
In GDScript, reading and writing elements from multiple threads is OK, but anything that changes the container size (resizing, adding or removing elements) requires locking a mutex.
Alright, I'll take a look