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

Fix life cycle of ResourceImporterTexture not tracked properly #79954

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

RandomShaper
Copy link
Member

@RandomShaper RandomShaper commented Jul 27, 2023

Fixes comment in #79936.

This class is instantiated as part of the generation of docs, and later the object is destroyed. By not nullifying the singleton, the next instantiation (the primary one done by the editor), the false assumption that it's already instantiated is made and a dangling pointer to the destroyed singleton is used.

@RandomShaper RandomShaper added this to the 4.2 milestone Jul 27, 2023
@RandomShaper RandomShaper requested a review from a team as a code owner July 27, 2023 11:57
@YuriSizov
Copy link
Contributor

Not sure it closes the linked issue (we don't really have much info on the cause of that), but it should fix the problem that @aaronfranke is having.

Copy link
Contributor

@YuriSizov YuriSizov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, we can merge it on its own merit. Would be great to get a confirmation that it's the exact cause of crash for Aaron.

@YuriSizov YuriSizov merged commit a0f5724 into godotengine:master Jul 27, 2023
@YuriSizov
Copy link
Contributor

Thanks!

@RandomShaper RandomShaper deleted the fix_res_imp_life branch July 27, 2023 15:14
@aaronfranke
Copy link
Member

I tested with commit a0f5724 and I am getting a different error message in the crash:

================================================================
handle_crash: Program crashed with signal 11
Engine version: Godot Engine v4.2.dev.custom_build (a0f572494e6602e0927bc3de61e9093c37da60f0)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] 1   libsystem_platform.dylib            0x0000000184362a24 _sigtramp + 56
[2] 2   ???                                 0xffff80018425f104 0x0 + 18446603342733242628
[3] std::__1::recursive_mutex::lock()
[4] ResourceImporterTexture::update_imports() (in godot.macos.editor.arm64) + 96
[5] EditorNode::_notification(int) (in godot.macos.editor.arm64) + 2764
[6] EditorPluginList::~EditorPluginList()
[7] Object::notification(int, bool) (in godot.macos.editor.arm64) + 32
[8] SceneTree::_process_group(SceneTree::ProcessGroup*, bool) (in godot.macos.editor.arm64) + 280
[9] SceneTree::_process(bool) (in godot.macos.editor.arm64) + 676
[10] SceneTree::process(double) (in godot.macos.editor.arm64) + 240
[11] Main::iteration() (in godot.macos.editor.arm64) + 952
[12] OS_MacOS::run() (in godot.macos.editor.arm64) + 116
[13] main (in godot.macos.editor.arm64) + 304
[14] 14  dyld                                0x0000000183fdbf28 start + 2236
-- END OF BACKTRACE --
================================================================

However, it seems to not be crashing on a new empty project. I am using this project to test the crash.

Also, like before, the crash seems to be intermittent. If I clear the cache it may work, or not. It's really weird.

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

Successfully merging this pull request may close these issues.

3 participants