GodotVR / godot_openxr_vendors

Godot 4 wrapper for OpenXR vendors loaders and extensions
MIT License
90 stars 19 forks source link

Editor crash when closed #67

Closed GuillaumeCa closed 5 months ago

GuillaumeCa commented 8 months ago

After upgrading from 2.0.1 to 2.0.2 on godot 4.2, the editor crashes when it is closed.

Godot(48212,0x7ff860710640) malloc: *** error for object 0x7feaf700d588: pointer being freed was not allocated
Godot(48212,0x7ff860710640) malloc: *** set a breakpoint in malloc_error_break to debug

I'm using macOS 13.4 on an intel macbook pro

starcin commented 7 months ago

It doesn't matter if it is enabled or if I have an export template using OpenXR. And I've tried it removing the folder and replacing it with the one still in my downloads folder (the original).

It doesn't crash for the first time. First time, it says the editor needs a restart for some extensions to work properly. In this session, exiting Godot is without a problem. After opening it again, now it crashes every time I exit.

By the way, it wasn't causing a crash for some time after I created the project. It happened out of nowhere.

I am using Windows 10.

ghost commented 7 months ago

I have the same issue on Linux mint 21.3 Cinnamon. When executing Godot from the command line I can see an error, even the first time. Here it is:

ERROR: Condition "!EditorSettings::get_singleton() || !EditorSettings::get_singleton()->has_setting(p_setting)" is true. Returning: Variant()
   at: _EDITOR_GET (editor/editor_settings.cpp:1140)

I hate the crash logs created by this.

Using the actions tab, I've found that this issue doesn't arise with this build, related to the first of the two commits between 2.0.1 and 2.0.2. If I understand correctly It would mean #64 created the bug. EDIT: There's also a lot of errors on the version I linked. These errors are due to the fact there's missing files in the meta quest bin folder. I tried exporting to meta quest and surprisingly I can without problem.

ghost commented 7 months ago

The issue still happens on version 2.0.3. The error I mentioned above is no longer here. It was therefore, unrelated. Since #64 is just an update on the automatic way the add-on is built and it would only be possible to cause an issue only if the builds are made with this automated script which would be very surprising.

To finish this comment, another info about the issue: by deleting every vendor directory, it disappears, which sounds logic said like that but if we only leave one vendor the issue persists. So it is not specific to a vendor.

m4gr3d commented 5 months ago

The root cause for this issue has been addressed in the Godot core codebase. The fix will roll-out with the Godot 4.3 and Godot 4.2.2 release.

ghost commented 5 months ago

I tested if the "fix" works on both Godot 4.2.2rc2 and 4.3dev5 by installing 2.0.3 in brand new projects and closing the editor. The editor crashed and created a crash log on both versions.

Am I missing something?

If not, then I want to bring back the fact that 2.0.1 works but not 2.0.2 (as I remember from testing on Godot 4.2.1), I'm assuming this means that the faulty code isn't in the engine.

m4gr3d commented 5 months ago

I tested if the "fix" works on both Godot 4.2.2rc2 and 4.3dev5 by installing 2.0.3 in brand new projects and closing the editor. The editor crashed and created a crash log on both versions.

Am I missing something?

If not, then I want to bring back the fact that 2.0.1 works but not 2.0.2 (as I remember from testing on Godot 4.2.1), I'm assuming this means that the faulty code isn't in the engine.

@nontoxicguy I've not been able to reproduce the issue on the master version of this plugin. Before the fix, trying to reload the project would cause the crash preventing the project from re-opening. With the latest dev version of Godot, I'm able to reload a project with this plugin and it re-opens as expected.

Can you test with the latest dev versions of the plugin and see if you can repro the crash. You can download a build from https://github.com/GodotVR/godot_openxr_vendors/actions/runs/8320916845

ghost commented 5 months ago

I've not been able to reproduce the issue on the master version of this plugin.

Same for me, so this issue is fixed.

I did more tests and my results are that whether the bug is here doesn't depend on Godot's version, it only depends on this plugin's version.

So that pull request you mentioned didn't fix the issue? I'm very unqualified to answer the question, but according to my tests the issue was in this plugin (or godot-cpp which is a dependency).

Anyways, I have no reason to talk about this anymore.

m4gr3d commented 4 months ago

@nontoxicguy Turns out your fix in https://github.com/GodotVR/godot_openxr_vendors/pull/80 was also needed to fix the crash.

For the issue to be resolved, we needed the fix in Godot 4.3 and your fix in https://github.com/GodotVR/godot_openxr_vendors/pull/80. We're cherry-picking that fix for version 2.0.4 of the plugin.