Skip to content
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

ERROR: Index p_type_a = 2712273640 is out of bounds (Variant::VARIANT_MAX = 38) #861

Open
ash-hashtag opened this issue Sep 21, 2022 · 4 comments

Comments

@ash-hashtag
Copy link

ash-hashtag commented Sep 21, 2022

just cloned the master repo at this commit
8670305

and tried to compile and run with gdextension example, compiled with no errors, but when opening the project in godot, this error gets thrown and crashes

ERROR: Index p_type_a = 2712273640 is out of bounds (Variant::VARIANT_MAX = 38).
   at: get_ptr_operator_evaluator (core/variant/variant_op.cpp:1051

but older commits work fine, the submodule used in actual gdextension works fine
this commit
https://github.com/godotengine/godot-cpp/tree/862d1f1fdd3201bb1e7bd27e941df2ea8adce3c7

@MGilleronFJ
Copy link

MGilleronFJ commented Sep 21, 2022

Last time I had this error was because I compiled GodotCpp against a different version of the Godot API.
To fix it, I compiled Godot master branch, generated extension_api.json from it, deleted the gen/ folder in GodotCpp, and recompiled it using `custom_api_file="path/to/the/extension_api.json", which worked.

I have no idea why Godot doesn't gracefully handle that, but maybe you should make sure the extension API is exactly matching the Godot version you are using. Are you using Godot 4 beta1 official build? If not, then it will likely fail. The GodotCpp repo is tracking beta1 (see the top of https://github.com/godotengine/godot-cpp/blob/master/godot-headers/extension_api.json).

If everything matches, then perhaps recent changes made it diverge somehow. In which case, compiling Godot to generate extension_api.json and recompile GodotCpp from scratch is your best option (remember to delete gen/). Second option is to stay on an earlier commit.

@ash-hashtag
Copy link
Author

I did compile to Godot 4 beta 1, but I'll try with custom api.json

@akien-mga
Copy link
Member

4.0 beta 1 is already too old for the master branch of this repo. This repo is always in sync with the master branch of Godot. For beta 1 you need to go back to the commit that says "sync headers with beta 1".

@frankhale
Copy link

@ash-hashtag have a look at this related issue. Just need to do what @akien-mga mentioned. The specific commit is listed in the following issue #845

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants