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

Application crashes following first successful run (Linux/SteamVR) #202

Open
hellocld opened this issue Apr 14, 2022 · 12 comments
Open

Application crashes following first successful run (Linux/SteamVR) #202

hellocld opened this issue Apr 14, 2022 · 12 comments

Comments

@hellocld
Copy link

I have a very simple scene that runs fine on first launch, but subsequent attempts at running the scene result in a crash with the following message:

handle_crash: Program crashed with signal 11
Engine version: Godot Engine v3.4.4.stable.arch_linux
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /usr/lib/libc.so.6(+0x42560) [0x7f1539cb0560] (??:0)
[2] /home/crl/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrclient.so(+0x23f998) [0x7f150db32998] (??:0)
[3] /home/crl/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrclient.so(+0x1a2b1a) [0x7f150da95b1a] (??:0)
[4] /home/crl/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrclient.so(+0x21d6f9) [0x7f150db106f9] (??:0)
[5] /usr/lib/libc.so.6(+0x8d5c2) [0x7f1539cfb5c2] (??:0)
[6] /usr/lib/libc.so.6(clone+0x44) [0x7f1539d80584] (??:0)
-- END OF BACKTRACE --

If I quit SteamVR and relaunch it, I can successfully run the scene again once, but after that first run it'll continue to crash until I restart SteamVR again. This is on a new project, but I can reproduce the issue on projects I know were working without issue last year in the same environment.

@ChristophHaag
Copy link
Collaborator

Does it shut down properly the first time or does it quit with a crash? Wondering if it's ValveSoftware/SteamVR-for-Linux#479

@hellocld
Copy link
Author

There's no crash when I quit the first time. It does seem a lot like what's reported in the issue you linked to.

I'm just running the scene from within the editor via F6, and stopping it with F8. Is there a safer/cleaner way I should be stopping the scene?

@BastiaanOlij
Copy link
Member

It would be good to try that out with a proper debug build so we get proper debug symbols. One thing I've been wanting to try is to move the call to loadActionSets to before initialiseSession, having had some discussions with Valve regarding some intermittent crash issues on Windows there might be an issue with the session accessing the action set data while we're still submitting data.

I remember moving that to after initialiseSession due to issues on Quest but they may have been related to other logic we already changed.

Just haven't had the time to try it yet as I've been having a few days off due to easter.

@aleksfadini
Copy link

aleksfadini commented Apr 20, 2022

I'm having the same issue.
As a workaround, I kill all vr processes with
pkill -9 -f vr
And that allows me to start steamvr again without restarting my wm or rebooting. A bit of a chore, but it works.

I'm positing the crash occurs because godot does not shut down steamvr properly, so the second time it attemps to start it, an instance is already running. Killing it via terminal fixes that.

@BastiaanOlij
Copy link
Member

@aleksfadini Godot will only clean up properly if it properly exits. If you kill the Godot process (which is what happens if you press the stop button in the editor to kill of the runtime) then it just exits right there and then without running through its proper exit process.

That also applies when pressing F8 as @hellocld mentions he does.

On Windows an application just suddenly disappearing triggers SteamVR to do the necessary cleanup and the OS cleans up memory etc.

To properly exit you need to call get_tree().quit()

@hellocld
Copy link
Author

Thanks @BastiaanOlij! That makes for an easy enough workaround for now for me (added an autoload with a "quit" input that fires get_tree().quit(), can use that instead of killing the process for now).

@aleksfadini
Copy link

@hellocld that's a great workaround, thank you for bringing it up.

@BastiaanOlij thank you for clarifying, is there a way we can add this to the documentation for linux users or add the workaround to the plugin? Can I help? And thank you for the amazing plugin and the wonderful tutorial videos

@aleksfadini
Copy link

To properly exit you need to call get_tree().quit()

Just to clarify, this is not possible every time the project crashes (which happens often during debug). So for now on linux the following command is needed:

pkill -9 -f vr

before launching a scene, whenever the previous scene was terminated by a code error.

@mnn
Copy link

mnn commented Aug 15, 2023

To properly exit you need to call get_tree().quit()

This doesn't work at all - it just freezes the game window. I also tried OS.kill(0) which closes the window, but also causes crashing on all subsequent runs. So far xkill works for me, but it is a quite cumbersome manual workaround. I'll either write some script to use the kill/pkill and bind it to a key, or postpone VR experiments in Godot.

Godot 4.1.1, i3wm, steamvr

@ChristophHaag
Copy link
Collaborator

SteamVR on linux hangs on xrDestroyInstance ValveSoftware/SteamVR-for-Linux#422

@mnn
Copy link

mnn commented Aug 15, 2023

SteamVR on linux hangs on xrDestroyInstance

I am confused, wouldn't that mean all VR applications (which use SteamVR) should freeze on exit? Why only Godot project freezes on exit, but no other VR application I tried?

@amalon
Copy link

amalon commented Sep 8, 2023

SteamVR on linux hangs on xrDestroyInstance

I am confused, wouldn't that mean all VR applications (which use SteamVR) should freeze on exit? Why only Godot project freezes on exit, but no other VR application I tried?

Only applications which use the OpenXR API are affected. Many still use OpenVR.

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

6 participants