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

Using the same export_group name in an inherited class and re-saving that class while the project is running crashes the project and sometimes the editor #79804

Closed
nan0m opened this issue Jul 22, 2023 · 2 comments · Fixed by #78254

Comments

@nan0m
Copy link

nan0m commented Jul 22, 2023

Godot version

4.1.0

System information

Windows 10, i711800H, Forward+ Vulkan

Issue description

When using @export_group("Name") in a BaseClass, then inheriting from that BaseClass in another class and there also using @export_group("Name"), with the same group name, then running the project and re-saving the inherited class the project crashes with

ERROR: FATAL: Index p_index = 3 is out of bounds (size() = 3).
   at: get (./core/templates/cowdata.h:155)

sometimes the editor crashes too after a while.

Steps to reproduce

  1. open reproduction project
  2. Run the project.
  3. Open the "super"script
  4. Press CTRL + S to save it.

Minimal reproduction project

MRP_.zip

@ghost
Copy link

ghost commented Jul 23, 2023

I can confirm that it crashes the project with the reproduction steps and project provided.
I did not manage to make the editor itself crash.

After first downloading the project it crashed on every CTRL + S, without any changes made to the script.
After opening it for the second time, it took more tries, up to ~50.

Modifying the export_group name while running and saving almost always causes an project crash.

Two different errors are printed, but only when running with the external console:

  • the first one happens when resaving script with no changes:
ERROR: FATAL: Index p_index = 3 is out of bounds (size() = 3).
   at: get (./core/templates/cowdata.h:155)
  • the second one is thrown when the script is modified before saving:
ERROR: FATAL: Index p_index = 3 is out of bounds (((Vector<T> *)(this))->_cowdata.size() = 3).
   at: operator[] (./core/templates/vector.h:52)

My system:

  • v4.1.1.stable.official.bd6af8e0e - Windows 10.0.19045 - Vulkan (Compatibility) - GeForce GT 540M- Intel Core i7-2670QM CPU @ 2.20GHz (8 Threads)

@dalexeev
Copy link
Member

dalexeev commented Jul 23, 2023

I tested the MRP and it looks like PR #78254 fixes this issue too. Note, however, that there are several other bugs with hot reloading of scripts (when you edit the script while the project is running).

@YuriSizov YuriSizov added this to the 4.2 milestone Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants