-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
[4.0] Trying to access enumerators declared in an autoload or class causes silent crash #71199
Comments
This comment was marked as resolved.
This comment was marked as resolved.
Figured out more specifically what was happening, updated the original post and added a minimal reproduction project. |
Turns out it's a much bigger bug than I thought, it happens any time you try to access an enumerator in specific ways. Updated the minimal reproduction project and original post. |
I just checked and "enumerators" doesn't seem the right term. I suggest to use |
CC @anvilfolk |
Could not reproduce on master (f73cb4c). |
Can't reproduce using the MRP on Beta10, Beta11 or on master. I wouldn't have been surprised if the problem was here before Beta11 since the enum fixes only came with Beta11. Tried opening every script & running the project, no errors. Could there be anything else at all in play here? It's strange that you can reproduce that in B10 and B11 - biiiiig changes happened between those two! |
Nevermind, I am silly, I didn't realize the error wouldn't be reported, it would just show up as null. It's working for me on B11 and master. But you're right, enums are borked in B10 :) Can you double-check with beta11? I'm pretty sure this is just enums not really working before #69590 which came with Beta11 :) |
You're right, thanks for looking. My project was broken in both b10 and b11 so I assumed what was messing up in b10 was messing up in b11. B11 was crashing because trying to iterate over a const PackedStringArray in an _init() function is broken. Thank you so much for spending the time looking into this @anvilfolk ! |
It's a team effort! :) Thanks for reporting! :) Lots of big stuff in flux! I'm hoping your other problems are also already fixed in |
Godot version
4.0 b10,b11
System information
Windows 10, RTX 2060, Vulkan
Issue description
Cannot access an enumerator statically from a user defined class or from an autoload. Game crashes without error.
Exception thrown at 0x00007FF6CE53AC63 in godot.windows.editor.x86_64.exe: 0xC0000005: Access violation reading location 0x00000039FFFFFFFC.
Stack trace
``` > godot.windows.editor.x86_64.exe!CowData::_ref(const CowData & p_from) Line 405 C++ godot.windows.editor.x86_64.exe!GDScriptFunction::call(GDScriptInstance * p_instance, const Variant * * p_args, int p_argcount, Callable::CallError & r_err, GDScriptFunction::CallState * p_state) Line 1875 C++ godot.windows.editor.x86_64.exe!GDScriptInstance::get_property_list(List * p_properties) Line 1698 C++ godot.windows.editor.x86_64.exe!Object::get_property_list(List * p_list, bool p_reversed) Line 509 C++ godot.windows.editor.x86_64.exe!Resource::duplicate(bool p_subresources) Line 254 C++ [Inline Frame] godot.windows.editor.x86_64.exe!call_with_variant_args_retc_helper(Resource *) Line 762 C++ godot.windows.editor.x86_64.exe!call_with_variant_args_retc_dv,bool>(Resource * p_instance, Ref(const Resource::*)(bool) p_method, const Variant * * p_args, int p_argcount, Variant & r_ret, Callable::CallError & r_error, const Vector & default_values) Line 557 C++ godot.windows.editor.x86_64.exe!MethodBindTRC,bool>::call(Object * p_object, const Variant * * p_args, int p_arg_count, Callable::CallError & r_error) Line 546 C++ godot.windows.editor.x86_64.exe!GDScriptFunction::call(GDScriptInstance * p_instance, const Variant * * p_args, int p_argcount, Callable::CallError & r_err, GDScriptFunction::CallState * p_state) Line 1673 C++ godot.windows.editor.x86_64.exe!GDScriptInstance::callp(const StringName & p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error) Line 1847 C++ godot.windows.editor.x86_64.exe!Object::callp(const StringName & p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error) Line 711 C++ godot.windows.editor.x86_64.exe!Variant::callp(const StringName & p_method, const Variant * * p_args, int p_argcount, Variant & r_ret, Callable::CallError & r_error) Line 1161 C++ godot.windows.editor.x86_64.exe!GDScriptFunction::call(GDScriptInstance * p_instance, const Variant * * p_args, int p_argcount, Callable::CallError & r_err, GDScriptFunction::CallState * p_state) Line 1551 C++ godot.windows.editor.x86_64.exe!GDScriptInstance::callp(const StringName & p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error) Line 1847 C++ godot.windows.editor.x86_64.exe!Object::callp(const StringName & p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error) Line 711 C++ godot.windows.editor.x86_64.exe!Variant::callp(const StringName & p_method, const Variant * * p_args, int p_argcount, Variant & r_ret, Callable::CallError & r_error) Line 1161 C++ godot.windows.editor.x86_64.exe!GDScriptFunction::call(GDScriptInstance * p_instance, const Variant * * p_args, int p_argcount, Callable::CallError & r_err, GDScriptFunction::CallState * p_state) Line 1551 C++ godot.windows.editor.x86_64.exe!GDScriptInstance::callp(const StringName & p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error) Line 1847 C++ godot.windows.editor.x86_64.exe!Object::callp(const StringName & p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error) Line 711 C++ godot.windows.editor.x86_64.exe!Variant::callp(const StringName & p_method, const Variant * * p_args, int p_argcount, Variant & r_ret, Callable::CallError & r_error) Line 1161 C++ godot.windows.editor.x86_64.exe!GDScriptFunction::call(GDScriptInstance * p_instance, const Variant * * p_args, int p_argcount, Callable::CallError & r_err, GDScriptFunction::CallState * p_state) Line 1583 C++ godot.windows.editor.x86_64.exe!GDScriptInstance::callp(const StringName & p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error) Line 1847 C++ [Inline Frame] godot.windows.editor.x86_64.exe!Node::_gdvirtual__ready_call() Line 242 C++ godot.windows.editor.x86_64.exe!Node::_notification(int p_notification) Line 155 C++ [Inline Frame] godot.windows.editor.x86_64.exe!Node::_notificationv(int) Line 46 C++ [Inline Frame] godot.windows.editor.x86_64.exe!CanvasItem::_notificationv(int) Line 45 C++ godot.windows.editor.x86_64.exe!Node2D::_notificationv(int p_notification, bool p_reversed) Line 37 C++ godot.windows.editor.x86_64.exe!Object::notification(int p_notification, bool p_reversed) Line 792 C++ godot.windows.editor.x86_64.exe!Node::_propagate_ready() Line 189 C++ godot.windows.editor.x86_64.exe!Node::_propagate_ready() Line 179 C++ godot.windows.editor.x86_64.exe!Node::_set_tree(SceneTree * p_tree) Line 2595 C++ godot.windows.editor.x86_64.exe!Node::_add_child_nocheck(Node * p_child, const StringName & p_name) Line 1123 C++ godot.windows.editor.x86_64.exe!Node::add_child(Node * p_child, bool p_force_readable_name, Node::InternalMode p_internal) Line 1139 C++ godot.windows.editor.x86_64.exe!SceneTree::_change_scene(Node * p_to) Line 1120 C++ [Inline Frame] godot.windows.editor.x86_64.exe!call_with_variant_args_helper(EditorNode *) Line 293 C++ godot.windows.editor.x86_64.exe!call_with_variant_args_dv(EditorNode * p_instance, void(EditorNode::*)(Node *) p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error, const Vector & default_values) Line 440 C++ godot.windows.editor.x86_64.exe!MethodBindT::call(Object * p_object, const Variant * * p_args, int p_arg_count, Callable::CallError & r_error) Line 318 C++ godot.windows.editor.x86_64.exe!Object::callp(const StringName & p_method, const Variant * * p_args, int p_argcount, Callable::CallError & r_error) Line 733 C++ godot.windows.editor.x86_64.exe!Callable::callp(const Variant * * p_arguments, int p_argcount, Variant & r_return_value, Callable::CallError & r_call_error) Line 62 C++ godot.windows.editor.x86_64.exe!MessageQueue::_call_function(const Callable & p_callable, const Variant * p_args, int p_argcount, bool p_show_error) Line 230 C++ godot.windows.editor.x86_64.exe!MessageQueue::flush() Line 292 C++ godot.windows.editor.x86_64.exe!SceneTree::physics_process(double p_time) Line 432 C++ godot.windows.editor.x86_64.exe!Main::iteration() Line 3026 C++ godot.windows.editor.x86_64.exe!OS_Windows::run() Line 1277 C++ godot.windows.editor.x86_64.exe!widechar_main(int argc, wchar_t * * argv) Line 181 C++ godot.windows.editor.x86_64.exe!_main() Line 205 C++ godot.windows.editor.x86_64.exe!main(int argc, char * * argv) Line 217 C++ ```Steps to reproduce
Create a class that has an enumerator. Try to access the enumerator statically like this:
Otherwise, you can create an autoload that has enumerator and try to access it like this:
Minimal reproduction project
The project prints null for the enum in certain cases, when it should always print the enum like a dictionary. Other variable types work fine, specifically enums don't work in this case.
enum-bug-testing.zip
The text was updated successfully, but these errors were encountered: