godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.67k stars 20.11k forks source link

Project or editor crashes randomly with XIO fatal IO error 11 #93843

Open gelvinp opened 2 months ago

gelvinp commented 2 months ago

Tested versions

Godot Engine v4.2.2.stable.official.15073afe3

System information

Godot v4.2.2.stable - Arch Linux #1 SMP PREEMPT_DYNAMIC Thu, 27 Jun 2024 12:26:27 +0000 - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3080 (nvidia; 555.58) - 12th Gen Intel(R) Core(TM) i5-12600K (16 Threads)

Issue description

I've been somewhat following #75308 for a while, and I saw someone suggest that building libx11 from the official PKGBUILD (on arch linux) would be a workaround, so I should state for context that I built and installed the package earlier today. However, since then, I'm still experiencing several crashes.

The crash message I'm seeing is:

Godot Engine v4.2.2.stable.official.15073afe3 - https://godotengine.org
Vulkan API 1.3.278 - Forward+ - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce RTX 3080

XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0"
      after 1297324 requests (1297323 known processed) with 0 events remaining.
ERROR: BUG: Unreferenced static string to 0: @rpc
   at: unref (core/string/string_name.cpp:129)
ERROR: BUG: Unreferenced static string to 0: @export_exp_easing
   at: unref (core/string/string_name.cpp:129)
...

After doing some digging, it seems that some people have reported crashes with a similar error message (in #26907 for instance) when using optimus / primusrun. I'm in a similar situation I guess? I have a dedicated GPU and a CPU with integrated graphics:

OS: Arch Linux x86_64 
Host: B660M DS3H DDR4 
Kernel: 6.6.36-1-lts 
Uptime: 6 hours, 32 mins 
Packages: 2055 (pacman), 55 (flatpak) 
Shell: bash 5.2.26 
Resolution: 2560x1440, 1920x1080, 1920x1080 
DE: Plasma 6.1.1 
WM: KWin 
Theme: [Plasma], Breeze-Dark [GTK2], Breeze [GTK3] 
Icons: [Plasma], breeze-dark [GTK2/3] 
Terminal: konsole 
Terminal Font: Lilex Nerd Font Mono 10 
CPU: 12th Gen Intel i5-12600K (16) @ 4.900GHz 
GPU: NVIDIA GeForce RTX 3080 
GPU: Intel AlderLake-S GT1 
Memory: 14263MiB / 15765MiB 

However, I do not use optirun or primusrun or anything like that, so I'm not sure how closely related this is to the previous issues.

Steps to reproduce

Be running and using Godot, it seems to only crash when receiving an input like control Z to undo, or F5 to launch the game, but it happens somewhat rarely. I can't identify a repeatable series of actions to cause it to crash, it just sorta does after maybe 30-60 minutes. Often enough to where i've had maybe five or six crashes today. It crashes regardless of what project I have open, too.

Minimal reproduction project (MRP)

N/A

RealMadvicius commented 1 month ago

Are there more things in the call stack trace or is it just the text you posted that you get in console? Like do you have a full call stack or just this limited one ?

gelvinp commented 1 month ago

The rest of the stack trace was just more BUG: Unreferenced static string to 0 at: unref (core/string/string_name.cpp:129), with the different gdscript annotation names, etc. The only line referenced was string_name.cpp at line 129, so I didn't include every instance of the error.

RealMadvicius commented 1 month ago

I have seen your error in several other opened issue tickets and I think there was one mentioning a pull request for a fix or a commit from where the bug started to appear. From the source code I checked quickly , this string error message happens when trying to dispose of a String but that was already disposed, so trying to free a memory space that was previously freed, which would in any case result into a crash anyway. It would help to find what is doing the explicit call to StringName::unref() so we could identify what part of the lib is having a lil issu with its processing algo. But seems like it will be hard to find =/ I hope someone with some knowledge on this specific topic can read this issue, maybe they would instant know which part to look in the code.

Does it crash if you force using wayland instead of XWayland and/or X.org ?

akien-mga commented 1 month ago

Related to #93268.