Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
134 stars 2 forks source link

Game randomly closing on startup #2507

Open coolymike opened 2 months ago

coolymike commented 2 months ago

Describe the issue.

Seemingly randomly, the prerelease version of Resonite Linux Native closes on startup. This does not happen on non-prerelease builds. It occurs during the Resonite icon with loading bar, when the loading bar reaches the end.

To Reproduce

Expected behavior

No crash

Screenshots

No response

Resonite Version Number

2024.7.8.1130

What Platforms does this occur on?

Linux

What headset if any do you use?

Desktop

Log Files

Logs scrubbed from private info: Player.log Resonite.log

For comparison the current release build of Resonite produces the following logs when starting normally: Player.log Resonite.log

The main content of the log is still there, the scrubbed info is mainly IDs like SteamID.

Additional Context

No response

Reporters

whippersnatchpumpkinpatch on Discord

Frooxius commented 2 months ago

There seems to be some kind of error when the GC allocates memory that crashes things. This is a bit odd, since that's part of the runtime itself, so I'm not sure where it could be coming from.

We can try doing a rebuild, perhaps something is corrupted.

coolymike commented 2 months ago

After having started the latest update 2024.7.9.1044 at least 7 times for testing, I have not encountered the same crash. I no longer have the files for 2024.7.8.1130, so I cannot test if the same crash still occurs on that version. Nothing else has changed about my system between these updates.

This is currently no longer an issue, but since I am unsure what the exact cause is, it's possible this might show up again in future builds.

Frooxius commented 2 months ago

Thanks for the update.

It's possible that something was corrupted or it was a transient issue due to other factors.

If this shows up again, we can reopen this, but right now there's not enough information for anything actionable unfortunately.

coolymike commented 2 months ago

This issue appears to be present once again in the latest prerelease version of Resonite on Linux native. This crash occurred the first time starting the prerelease while using a database from the release version. The game was started with Monado + OpenComposite which can clutter the Unity Player.log with lines prefixed with [OC] or lines about "GetSkeletalBoneData error", which can be safely ignored. Despite that, this seems like the same crash again.

Player.log Resonite.log

Frooxius commented 2 months ago

Does this happen with every startup or only sometimes?

I'm not very familiar with Monado + OpenComposite - is it possible those are introducing some instability?

According to the log, the issue is coming from GC allocations, which is in the Mono runtime itself, which we unfortunately do not control. It would likely be a native library or something that is affecting it.

coolymike commented 2 months ago

This only occurs sometimes "at random", not on every startup. Monado + OpenComposite are used as a VR runtime, intended to function similar to SteamVR. They do not use, interact with, or modify Mono. The previous crash (on issue creation) occurred without two those loaded, with the same exception, so Monado+OC introducing instability is unlikely in this specific case.

Resonite is running under the Steam Linux Runtime, aside from the graphics drivers (mesa). Any Linux system with Resonite installed (and launched) through Steam should use the same native system libraries. This installation of Resonite is completely unmodified, and directly what Steam served to me with the "prerelease" branch.

Frooxius commented 2 months ago

What Linux distribution are you using for this?

If it occurs even without those, then yeah, it's unlikely to be cause of an issue.

Problem is, I don't know what could be. Things don't need to actually interact with Mono in any way - any native libraries, plugins and so on can potentially corrupt the memory in a way that affects Mono, since they share the same address space.

We haven't really touched any native libraries. There could be also bugs in Mono itself that are only revealed with certain memory access patterns, which could explain why this comes and goes. Which can be very difficult to solve - the only way for us is to move away from Unity/Mono or find a mitigation.

Given that this only happens sometimes and there's not too many leads, we probably won't consider this a blocker for release though. We'll make a clean rebuild before everything gets released.

coolymike commented 2 months ago

I am using Arch Linux, updated a few hours ago. As noted, the Steam Linux Runtime should remove most distribution specific quirks and library usage, especially in games using common engines like Unity. The only major exception is the graphics drivers.

The mono runtime Resonite uses is bundled with it, as Unity does so by default.

I'll have to spend more time troubleshooting and creating some issues for the other things I've found in the prerelease, then I'll try to run Resonite under a debugger to see if that gives any useful results.

The last time some vague mono "memory management" crash happened on Linux, the unofficial ""community fix"" was to take the Unity mono source code for the specific version of Unity used, then recompiling it in a modern version of Visual Studio. Although that was for running the game under VR with Proton, not the native version on desktop.

coolymike commented 2 months ago

GDB backtrace when this crash happens:

Thread 1 "Resonite.x86_64" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff4fca740 (LWP 147547)]
0x00007fffd0e39b99 in GC_mark_from ()
   from /home/user/.local/share/Steam/steamapps/common/Resonite/Resonite_Data/MonoBleedingEdge/x86_64/libmonobdwgc-2.0.so
(gdb) bt
#0  0x00007fffd0e39b99 in GC_mark_from ()
   from /home/user/.local/share/Steam/steamapps/common/Resonite/Resonite_Data/MonoBleedingEdge/x86_64/libmonobdwgc-2.0.so
#1  0x00007fffd0e3ea21 in GC_mark_some ()
   from /home/user/.local/share/Steam/steamapps/common/Resonite/Resonite_Data/MonoBleedingEdge/x86_64/libmonobdwgc-2.0.so
#2  0x00007fffd0e3fad3 in GC_collect_a_little_inner ()
   from /home/user/.local/share/Steam/steamapps/common/Resonite/Resonite_Data/MonoBleedingEdge/x86_64/libmonobdwgc-2.0.so
#3  0x00007fffd0e3ffa2 in GC_allocobj ()
   from /home/user/.local/share/Steam/steamapps/common/Resonite/Resonite_Data/MonoBleedingEdge/x86_64/libmonobdwgc-2.0.so
#4  0x00007fffd0e40dd4 in GC_generic_malloc_inner ()
   from /home/user/.local/share/Steam/steamapps/common/Resonite/Resonite_Data/MonoBleedingEdge/x86_64/libmonobdwgc-2.0.so
#5  0x00007fffd0e43c4c in GC_generic_malloc ()
   from /home/user/.local/share/Steam/steamapps/common/Resonite/Resonite_Data/MonoBleedingEdge/x86_64/libmonobdwgc-2.0.so
#6  0x00007fffd0e43eb4 in GC_malloc_kind_global ()
   from /home/user/.local/share/Steam/steamapps/common/Resonite/Resonite_Data/MonoBleedingEdge/x86_64/libmonobdwgc-2.0.so
#7  0x00007fffd0e16fff in ?? ()
   from /home/user/.local/share/Steam/steamapps/common/Resonite/Resonite_Data/MonoBleedingEdge/x86_64/libmonobdwgc-2.0.so
#8  0x00007fffd0dccf07 in ?? ()
   from /home/user/.local/share/Steam/steamapps/common/Resonite/Resonite_Data/MonoBleedingEdge/x86_64/libmonobdwgc-2.0.so
#9  0x00007fffd0df80a8 in ?? ()
   from /home/user/.local/share/Steam/steamapps/common/Resonite/Resonite_Data/MonoBleedingEdge/x86_64/libmonobdwgc-2.0.so
#10 0x00007fffd0e11239 in ?? ()
   from /home/user/.local/share/Steam/steamapps/common/Resonite/Resonite_Data/MonoBleedingEdge/x86_64/libmonobdwgc-2.0.so
#11 0x40064ff7 in  (wrapper managed-to-native) System.MonoCustomAttrs:GetCustomAttributesInternal (System.Reflection.ICustomAttributeProvider,System.Type,bool) {0x2b4c468} + 0xf7 (0x40064f00 0x4006509c) [0x7ffff00b1d20 - Unity Root Domain]
#12 0x00007ffe0db0c000 in ?? ()
#13 0x0000000000000000 in ?? ()

(Captured on 2024.7.12.12)