-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
Godot 4.4 throws errors when using await
on EditorPlugin
#100750
Comments
I can reproduce this bug, i got the errors cited in this issue and this one too:
And when crashed i got this backtrace: Backtrace
The errors are the same (expect for the one i cited) and the backtrace looks similar from this other issue, the way to trigger is different but both needs the await to happen. A difference between these two is the fact this one happens in 4.4 dev 1 too but the other issue only in 4.4 dev 2 too me (the issue author said that happens in 4.3 too but i was unable to reproduce in this version). I'll try to bisect it. |
From the pr content and the fact of the other issue won't be able to trigger in 4.4 dev 1 i don't think this is the root cause, looks like this just make the problem more easier to trigger, but that is for the gd team to judge. Also i got more errors and a slight different backtrace:
This backtrace was compiling with MSVC, the other from my first commentary was with MinGw, not sure if the compiler make difference because the other issue also has slight different backtraces with the same compiler. Backtrace
|
This issue has been assign to me but I'll not be able to resolve it. My PR only put in invidence another issue that was already there like @matheusmdx said. If you want, I can revert #94802 because I have no idea how |
CC @godotengine/gdscript |
Thought I'd look a bit into the debugger to maybe learn a bit about the VM stuff. What looked odd to me was that the This happens because since #73776 the editor loads plugin scripts ignoring the cache. If the autoload is initialized before the plugins (probably some multithreading involved here since it is very inconsistent) it loads the plugin script and calls to it. Then in the plugin script a GDScriptFunctionState is created when awaiting. This function state points to some memory with the GDScript function. When the editor force loads the plugin script afterwards the script gets reloaded and frees all its functions in the process. Now the function state points to freed memory (which sometime contains a correct other function afterwards). Reverting #73776 seems to fix it for me (25 tries without error) but that's not the right solution I'd guess. As for the correct solution: it's my first time looking at the VM, I have no clue ¯\_(ツ)_/¯ (maybe having editor plugins loaded before setting up the scene tree idk) |
Related to #86362 |
@HolonProduction Not sure if this info can helps but the problem seems to be something with the signal emission. This issue and others like #97053 and #101059 all have the common thing the use of |
Looking at #100985 the instruction pointer is also beyond the code size, but it doesn't receive the instruction pointer from a saved state, so there has to be a different cause with that issue. It just looks identical on the surface, because in both cases the VM starts executing memory that isn't Gdscript byte code (at least that's how I understand it), but there are different causes I'd say. |
Tested versions
System information
Godot v4.4.dev7 - Windows 10 (build 19045) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1650 (NVIDIA; 32.0.15.6603) - Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz (8 threads)
Issue description
When the editor starts up, calling code from an Autoload to an EditorPlugin with a function that uses
while
andawait
will result in either:Steps to reproduce
The MRP will throw the error when opening the project. If it doesn't, use "Project > Reload Current Project" as sometimes it may simply work.
This problem seems to require a combination of a few situations to happen:
load()
. Works fine with a preloaded variable on the class scope.await
must be inside thewhile
loop.Some background on why I'm running code like this:
preload()
because EditorPlugin classes are not exported to runtime.Minimal reproduction project (MRP)
project_bad_address.zip
The text was updated successfully, but these errors were encountered: