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

Unhandled Exception in object.cpp when using GDscript data Resource in a scene and resource_local_to_scene=true #43709

Closed
ChainedLupine opened this issue Nov 20, 2020 · 3 comments

Comments

@ChainedLupine
Copy link
Contributor

Godot version:
Godot beta 2 of 3.2.4 -- hash 04103db

OS/device including version:
Windows 10

Issue description:
If creating a Resource script which holds data, and then setting Local To Scene to true, a crash occurs when it is loaded.

I suspect this is related to the reference count changes made around here: #43049

Unhandled exception in object.cpp line 414 at this point:

void Object::set(const StringName &p_name, const Variant &p_value, bool *r_valid) {

#ifdef TOOLS_ENABLED

	_edited = true;
#endif

	if (script_instance) {

		if (script_instance->set(p_name, p_value)) {   // <-- Crash here, script_instance pointer looks corrupt, just like I was seeing in #43049
			if (r_valid)
				*r_valid = true;
			return;
		}
	}

Steps to reproduce:

  1. Create a data Resource, then load it via another script. Local To Scene = yes.
  2. Project crashes when executed.

Minimal reproduction project:

godot_3.2.4_beta2_resource_local_to_scene_crash.zip

@ChainedLupine
Copy link
Contributor Author

Mentioning @RandomShaper just in case he has an insight.

@akien-mga
Copy link
Member

I can confirm the crash on 3.2.4.beta2, but it seems fixed in 06389f7.

It's the same bug as #43652 which was fixed by #43657 (and cherry-picked for 3.2 via ebdcf1c).

If you want to confirm, you can use the windows-editor artifact from the latest 3.2 commit: https://github.com/godotengine/godot/runs/1426905927 (see Artifacts menu in the top right corner for the download). Note that CI artifacts are bigger than official builds as they include debug symbols, and use less optimizations.

@ChainedLupine
Copy link
Contributor Author

Thanks @akien-mga! Confirmed fixed for both the test project and my main game project.

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

No branches or pull requests

2 participants