godot: Crash (segfault) when opening/creating project due to Vulkan debug utils [Mesa Haswell]

Godot version

4.0.dev.20210820.official.75697c0df

(via https://twitter.com/Akien/status/1428808742989148168 / https://downloads.tuxfamily.org/godotengine/testing/4.0/4.0-dev.20210820/)

System information

Linux, Elementary OS 5.1, Intel® HD Graphics 4400 (HSW GT2), Vulkan API 1.1.0 [0]

Issue description

Crash (segfault) when opening/creating any project.

Steps to reproduce

$ /<path>/Godot_v4.0-dev.20210820_linux.64 --verbose --editor /<path>/project.godot 
Godot Engine v4.0.dev.20210820.official.75697c0df - https://godotengine.org
Using "ICU / HarfBuzz / Graphite" text server...
XInput: Refreshing devices.
XInput: Using touch device: Virtual core pointer
WARNING: XOpenIM failed
     at: DisplayServerX11 (platform/linuxbsd/display_server_x11.cpp:3925)
Vulkan API 1.1.0
INTEL-MESA: warning: Haswell Vulkan support is incomplete
Using Vulkan Device #0: Intel - Intel(R) HD Graphics 4400 (HSW GT2)
- Vulkan multiview supported:
  max view count: 16
  max instances: 268435455
- Vulkan subgroup:
  size: 32
  stages: STAGE_FRAGMENT, STAGE_COMPUTE
  supported ops: FEATURE_BASIC, FEATURE_VOTE, FEATURE_BALLOT, FEATURE_SHUFFLE, FEATURE_SHUFFLE_RELATIVE, FEATURE_QUAD
WARNING: XCreateIC couldn't create wd.xic
     at: _create_window (platform/linuxbsd/display_server_x11.cpp:3751)
Using present mode: VK_PRESENT_MODE_FIFO_KHR
FreeDesktopScreenSaver: Acquired screensaver inhibition cookie: 4099
Using "default" pen tablet driver...
Shader 'ParticlesShaderRD' SHA256: b1c13742d6c7dc398cf01338d0e4a4947d10ce9f81c08416520adc0d946e6896
Shader 'ParticlesCopyShaderRD' SHA256: 70843017352c938ab16d3d6842d71c8f756708323386170ebdd95741236f561b
Shader 'CanvasSdfShaderRD' SHA256: 816c231df07a2f1b5f640e2ca29fdc7fc37acbefad545c953a8dfd00d38db03a
Shader 'SkeletonShaderRD' SHA256: ff686ba34b4393c77ce295a3c5b24ceef9e7d6fdc159df8657dc6a81feda212e
Shader 'CanvasShaderRD' SHA256: c36e476ac4ce51e50dd1290ccaf7f64cd6bb029a61589c429b3a060054902228
Shader 'CanvasOcclusionShaderRD' SHA256: 4a8854b5b957f77150c3d80fb5ad16e3ac5421b9e9a310cb4aaea49ccb3f807e
Shader 'ClusterRenderShaderRD' SHA256: c4390f1ed2f365a226dccf3cb11f09e2813040319ef8f0dfada7a9a25fed89c1
Shader 'ClusterStoreShaderRD' SHA256: 9068c995b77d702ec04d40d69d31d5eebe3226a6ce9f36ebad47caf51869d760
Shader 'ClusterDebugShaderRD' SHA256: a231523c33193a35a7b7e1560fbb0457fa4b1ea7b05032be928aad31d3b0f37d
Shader 'SceneForwardMobileShaderRD' SHA256: a7e3ba939b48858524011eb5b9534f14972b49fec9c6447d642f2651285ca2f2
Shader 'SkyShaderRD' SHA256: e6902ca3c52d65d0655f0b9a56946ae5f937009f86375d4820e4ee24fe350688
Shader 'BlurRasterShaderRD' SHA256: 205c05013e63df37f8c15e1f9fa9a5eaff3c2707f66d767dfaed80465f69a094
Shader 'CopyToFbShaderRD' SHA256: 4443801df53215f08e48cf8bdf295ba88cf324adb044ff49952c1953e683ecec
Shader 'CubemapRoughnessRasterShaderRD' SHA256: 3ef71f33e04fc7bc1c6944a811d946548bcb786ac41109c08d897a7ebc67c135
Shader 'TonemapShaderRD' SHA256: df56d0131824081b100eb73e73c0f8d52f5561dfb1c82518ba4e313419ca2c0a
Shader 'LuminanceReduceRasterShaderRD' SHA256: 42f711e2f15d9eb18ac503c29a8d606da4649db3e4ebd01e66ff455e074d5a06
Shader 'CubeToDpShaderRD' SHA256: 57a7145fd3034af34bd11d25a6167d3a9981c4f59eb0cf5d12d7e2078715b6b8
Shader 'BokehDofRasterShaderRD' SHA256: 6a496a8fe361fb770d4bf0cf6c9bd9156ece09a182e5843201ec1335fba1bf3b
Shader 'CubemapDownsamplerRasterShaderRD' SHA256: 8e7f681440ae08f45ad6389d97094e2884abcba49baa188383ff1dfa337b8db8
Shader 'CubemapFilterRasterShaderRD' SHA256: b3c9682934992fa90e0c00f44936067e0edd3dd49e4f99b6e9eac8c8287361e9
Shader 'SortShaderRD' SHA256: 91d8bf452e4f62ffc1a926c54c1328ce691943177b729957365e52f63dc5b8a4
Shader 'BlitShaderRD' SHA256: 82225c2d18349e339d96edb103d998c127637a4604be9d119d4793b67df14185
JoypadLinux: udev enabled and loaded successfully.
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_dlpath
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_config_topdir
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_config_add_before
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_config_add_after
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_config_is_array
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_pcm_areas_copy_wrap
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_mixer_selem_id_parse
/usr/lib/x86_64-linux-gnu/libpulse.so.0: undefined symbol: pa_threaded_mainloop_once_unlocked
/usr/lib/x86_64-linux-gnu/libpulse.so.0: undefined symbol: pa_thread_make_realtime
PulseAudio: context other
PulseAudio: context other
PulseAudio: context other
PulseAudio: context ready
PulseAudio: Detecting channels for device: alsa_output.pci-0000_00_1b.0.analog-stereo
PulseAudio: detected 2 channels
PulseAudio: audio buffer frames: 512 calculated latency: 11ms
 
CORE API HASH: 8305278628240260042
EDITOR API HASH: 3825680112465765238
Class 'GDScriptEditorTranslationParserPlugin' is not exposed, skipping.
Class 'GDScriptNativeClass' is not exposed, skipping.
Class 'IPUnix' is not exposed, skipping.
Class 'PhysicsDirectBodyState2DSW' is not exposed, skipping.
Class 'PhysicsDirectBodyState3DSW' is not exposed, skipping.
Class 'PhysicsDirectSpaceState2DSW' is not exposed, skipping.
Class 'PhysicsDirectSpaceState3DSW' is not exposed, skipping.
Class 'PhysicsServer2DSW' is not exposed, skipping.
Class 'PhysicsServer3DSW' is not exposed, skipping.
Class 'ResourceImporterMP3' is not exposed, skipping.
Class 'ResourceImporterOGGVorbis' is not exposed, skipping.
Class 'TextServerAdvanced' is not exposed, skipping.
Construct gdnative interface

Destruct gdnative interface

EditorSettings: Load OK!
Loaded builtin certs
Failed to bind socket. Error: 3
EditorSettings: Save OK!
Using present mode: VK_PRESENT_MODE_FIFO_KHR
Using present mode: VK_PRESENT_MODE_FIFO_KHR
handle_crash: Program crashed with signal 11
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x3f040) [0x7f8df2085040] (??:0)
-- END OF BACKTRACE --
Aborted

Opening just the project manager works okay:

$ /<path>/Godot_v4.0-dev.20210820_linux.64 
Godot Engine v4.0.dev.20210820.official.75697c0df - https://godotengine.org
WARNING: XOpenIM failed
     at: DisplayServerX11 (platform/linuxbsd/display_server_x11.cpp:3925)
Vulkan API 1.1.0
INTEL-MESA: warning: Haswell Vulkan support is incomplete
Using Vulkan Device #0: Intel - Intel(R) HD Graphics 4400 (HSW GT2)
WARNING: XCreateIC couldn't create wd.xic
     at: _create_window (platform/linuxbsd/display_server_x11.cpp:3751)
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_dlpath
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_config_topdir
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_config_add_before
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_config_add_after
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_config_is_array
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_pcm_areas_copy_wrap
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_mixer_selem_id_parse
/usr/lib/x86_64-linux-gnu/libpulse.so.0: undefined symbol: pa_threaded_mainloop_once_unlocked
/usr/lib/x86_64-linux-gnu/libpulse.so.0: undefined symbol: pa_thread_make_realtime
 
WARNING: XCreateIC couldn't create wd.xic
     at: _create_window (platform/linuxbsd/display_server_x11.cpp:3751)

Previous pre-built binary version that worked (via https://downloads.tuxfamily.org/godotengine/testing/4.0/4.0-dev.20210811/):

$ ~/Downloads/Godot_v4.0-dev.20210811_linux.64 
Godot Engine v4.0.dev.20210811.official.7188cb601 - https://godotengine.org
WARNING: XOpenIM failed
     at: DisplayServerX11 (platform/linuxbsd/display_server_x11.cpp:3925)
Vulkan API 1.2.162
INTEL-MESA: warning: Haswell Vulkan support is incomplete
Using Vulkan Device #0: Intel - Intel(R) HD Graphics 4400 (HSW GT2)
WARNING: XCreateIC couldn't create wd.xic
     at: _create_window (platform/linuxbsd/display_server_x11.cpp:3751)
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_dlpath
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_config_topdir
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_config_add_before
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_config_add_after
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_config_is_array
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_pcm_areas_copy_wrap
/usr/lib/x86_64-linux-gnu/libasound.so.2: undefined symbol: snd_mixer_selem_id_parse
/usr/lib/x86_64-linux-gnu/libpulse.so.0: undefined symbol: pa_threaded_mainloop_once_unlocked
/usr/lib/x86_64-linux-gnu/libpulse.so.0: undefined symbol: pa_thread_make_realtime

[0] Note: Previous working version reports Vulkan API 1.2.162 but latest version reports Vulkan API 1.1.0.

Minimal reproduction project

N/A

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 20 (20 by maintainers)

Most upvoted comments

As mentioned on twitter I was able to get the editor to run (Godot Engine v4.0.dev.calinou.770a1d00a with debug symbols) by inserting a breakpoint with gdb at VulkanContext::command_begin_label:

break VulkanContext::command_begin_label

Then when it was hit first time, ran this:

set this->enabled_debug_utils = 0
disable 1
continue

The editor then ran without issue.

I was able to add a mesh, light & camera & then play the scene[0] (after the repeating the same steps for the new process).

From a quick look at the source history it seems this code was introduced in https://github.com/godotengine/godot/commit/7323cbab4bfcb5ad1fb0bd2dd667bdb450827335 (“Add named resources and debug labels in RenderDoc”).

Will investigate further…

[0] godot-v4-with-debug-disabled-Screenshot from 2021-10-06 01 30 14 godot-v4-pre-alpha-cylinder-editor-Screenshot from 2021-10-06 01 37 21 godot-v4-prealpha-cylinder-debug-disabled-Screenshot from 2021-10-06 01 52 51

After testing that the project ran okay, I then tested the more recent SDK setup with the editor (as there seems a difference between those two scenarios in general).

Running the editor via this command:

$ ./godot-v4-linux-nightly-debug-symbols-2021-10-06 --path /<path>/vulk-play-gg --editor

Resulted in quite a long pause but then the editor eventually opened.

Partial output included:

Godot Engine v4.0.dev.calinou.2e8cba0bd - https://godotengine.org

[...]

INTEL-MESA: warning: Haswell Vulkan support is incomplete
Vulkan API 1.2.182 - Using Vulkan Device #0: Intel - Intel(R) HD Graphics 4400 (HSW GT2)

[...]

Editor as it appears after opening:

godot-editor-running-with-vulkan-sdk-1_2_182-Screenshot from 2021-10-08 04 08 11

So, based on what I’ve observed, it seems that the issue does arise (at least in part) from not calling _get_preferred_validation_layers() which seems to do whatever initialisation is required: https://github.com/godotengine/godot/blob/77721b35ba21f2e7e8bb42cf415fccb018517843/drivers/vulkan/vulkan_context.cpp#L214-L264

It would be good to know why the equivalent of --vk-layers needs to be supplied in my case but not on other systems.

(Stab in the dark here, but could it be related to configuration of implicit layers: https://vulkan.lunarg.com/doc/view/1.2.189.0/linux/layer_configuration.html? Also, looking at that page suggests some possibilities for reducing the log spam which I might look into.)

Where to from here?

Potential future actions to take from here:

  • At a minimum it does seem like the functionality that’s causing the issue would be best to be behind debug-related command line switch because it’s not essential to game functionality. (Enhancement?)

  • Additionally, it would seem that the current code flow doesn’t ensure that whatever layer initialization is required is performed before use. (Bug?)

  • Finally, due to the amount of output from validation layers if the debug label functionality can be enabled separately from validation it seems like that may be a better default approach. (Enhancement?)