Crashes on Godot 4.4.1, OS.delay_usec in LogInternalPrinter.gd
Didn't want to necro the other similar closed issue. I am seeing repeated crashes on 4.4.1 (and now 4.5-stable):
ERROR: modules/gdscript/gdscript_vm.cpp:1360 - Condition ' !gdscript ' is true. Breaking..:
ERROR: res://addons/logger/_LogInternalPrinter.gd:137 - Internal script error! Opcode: 20 (please report).
ERROR: modules/gdscript/gdscript_vm.cpp:1360 - Condition ' !gdscript ' is true. Breaking..:
ERROR: res://addons/logger/_LogInternalPrinter.gd:137 - Internal script error! Opcode: 20 (please report).
ERROR: modules/gdscript/gdscript_vm.cpp:750 - Condition ' (ip + 7 + _pointer_size) > _code_size ' is true. Breaking..:
ERROR: res://addons/logger/_LogInternalPrinter.gd:137 - Internal script error! Opcode: 0 (please report).
LogInternalPrinter line 137 is
OS.delay_usec(max(CYCLE_BREAK_TIME*1000-delta, 0))
Seems like this isn't thread-safe in workers in Godot 4.4.* and up. Causes the Editor to freeze momentarily and hard-crash to desktop when building or trying to save a scene.
Plugin version 2.1.0 from the Asset Library, I'm on Windows 11 24H2. Thanks!
Hmmm, interesting! So your problem is that when you make a call to Log from within a worker task, things crash? Are you using Log as a tool for the editor in like a plugin or the like, or is it within a game instance? What method are you calling? I just want to be able to reproduce your exact setup?
Are you running on ARM or x86?
<cut>
Moved this to #22
I wish I could give you better context, but when this happens I don't get a godot.log, and i only could grab the above snippet because the editor froze long enough for me to quickly highlight and copy it out. the only thing i can think of is that i'm using VS Code as an external editor. When i start the editor from within VS Code/ the GDScript language server, the terminal output I get is attached. I have verbose on so there's a lot and it hits the scrollback limit, but you can see the same or similar errors at the bottom.
I'm on x86 Processor 12th Gen Intel(R) Core(TM) i7-12700KF (3.60 GHz) Installed RAM 64.0 GB (63.8 GB usable) System type 64-bit operating system, x64-based processor
I was seeing some instability when logging actual class instances to the logger without casting first to string. But that may be a red herring.