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 exits with error when resizing a window on Ubuntu 22.04 #1

Open
maeda6uiui opened this issue Dec 17, 2023 · 4 comments
Open
Assignees
Labels
wontfix This will not be worked on

Comments

@maeda6uiui
Copy link
Owner

maeda6uiui commented Dec 17, 2023

Description

Application exits with error when attempting to resize a window.
Most of the time JVM just crashes, but once in a while JVM doesn't crash and validation errors are reported instead.

I have tested on Windows 11 and Ubuntu 22.04.
This issue is observed only on Ubuntu 22.04.
Window resizing works flawlessly on Windows 11.

Platform

OS: Ubuntu 22.04
CPU (and GPU): AMD Ryzen 7 5700G with Radeon Graphics

Log output

JVM crash report

I'll provide an excerpt because the whole crash report is too long to paste here.

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f329c9814b4, pid=5608, tid=5609
#
# JRE version: OpenJDK Runtime Environment (19.0.2+7) (build 19.0.2+7-Ubuntu-0ubuntu322.04)
# Java VM: OpenJDK 64-Bit Server VM (19.0.2+7-Ubuntu-0ubuntu322.04, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# C  [libvulkan_radeon.so+0x1814b4]
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/maeda6uiui/IdeaProjects/Mechtatel/core.5608)
#
# If you would like to submit a bug report, please visit:
#   Unknown
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

---------------  S U M M A R Y ------------

Command Line: -javaagent:/home/maeda6uiui/idea-IC-232.10227.8/lib/idea_rt.jar=46643:/home/maeda6uiui/idea-IC-232.10227.8/bin -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 com.github.maeda6uiui.mechtatel.CameraModeTest

Host: AMD Ryzen 7 5700G with Radeon Graphics, 16 cores, 30G, Ubuntu 22.04.3 LTS
Time: Sat Jan 27 17:50:29 2024 JST elapsed time: 3.661452 seconds (0d 0h 0m 3s)

---------------  T H R E A D  ---------------

Current thread (0x00007f3358018020):  JavaThread "main" [_thread_in_native, id=5609, stack(0x00007f335db00000,0x00007f335dc00000)]

Stack: [0x00007f335db00000,0x00007f335dc00000],  sp=0x00007f335dbfcf30,  free space=1011k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libvulkan_radeon.so+0x1814b4]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 2035  org.lwjgl.system.JNI.callPPJI(JIJJJ)I (0 bytes) @ 0x00007f3348858ef6 [0x00007f3348858ea0+0x0000000000000056]
J 2029 c1 org.lwjgl.vulkan.VK10.nvkQueueSubmit(Lorg/lwjgl/vulkan/VkQueue;IJJ)I (48 bytes) @ 0x00007f3340f6fe64 [0x00007f3340f6fb00+0x0000000000000364]
J 2231 c1 org.lwjgl.vulkan.VK10.vkQueueSubmit(Lorg/lwjgl/vulkan/VkQueue;Lorg/lwjgl/vulkan/VkSubmitInfo$Buffer;J)I (14 bytes) @ 0x00007f3340fb1a74 [0x00007f3340fb1760+0x0000000000000314]
J 2226 c1 com.github.maeda6uiui.mechtatel.core.vulkan.util.CommandBufferUtils.endSingleTimeCommands(Lorg/lwjgl/vulkan/VkDevice;JLorg/lwjgl/vulkan/VkCommandBuffer;Lorg/lwjgl/vulkan/VkQueue;)V (99 bytes) @ 0x00007f3340fb52ec [0x00007f3340fb4640+0x0000000000000cac]
j  com.github.maeda6uiui.mechtatel.core.vulkan.screen.VkMttScreen.runMergeScenesNabor()V+681
j  com.github.maeda6uiui.mechtatel.core.vulkan.screen.VkMttScreen.run(Lorg/joml/Vector4f;Lcom/github/maeda6uiui/mechtatel/core/camera/Camera;Lcom/github/maeda6uiui/mechtatel/core/postprocessing/fog/Fog;Ljava/util/List;Lorg/joml/Vector3f;Ljava/util/List;Lorg/joml/Vector3f;Ljava/util/List;Lorg/joml/Vector3f;Lcom/github/maeda6uiui/mechtatel/core/shadow/ShadowMappingSettings;Lcom/github/maeda6uiui/mechtatel/core/postprocessing/blur/SimpleBlurInfo;Ljava/util/List;)V+25
j  com.github.maeda6uiui.mechtatel.core.vulkan.MttVulkanImpl.draw(Lcom/github/maeda6uiui/mechtatel/core/vulkan/screen/VkMttScreen;Lorg/joml/Vector4f;Lcom/github/maeda6uiui/mechtatel/core/camera/Camera;Lcom/github/maeda6uiui/mechtatel/core/postprocessing/fog/Fog;Ljava/util/List;Lorg/joml/Vector3f;Ljava/util/List;Lorg/joml/Vector3f;Ljava/util/List;Lorg/joml/Vector3f;Lcom/github/maeda6uiui/mechtatel/core/shadow/ShadowMappingSettings;Lcom/github/maeda6uiui/mechtatel/core/postprocessing/blur/SimpleBlurInfo;Ljava/util/List;)V+23
j  com.github.maeda6uiui.mechtatel.core.screen.MttScreen.draw()V+76
j  com.github.maeda6uiui.mechtatel.CameraModeTest.onUpdate(Lcom/github/maeda6uiui/mechtatel/core/MttWindow;)V+121
j  com.github.maeda6uiui.mechtatel.core.MttWindow.update()V+116
j  com.github.maeda6uiui.mechtatel.core.Mechtatel$$Lambda$203+0x00000008011b5378.accept(Ljava/lang/Object;)V+4
J 2203% c2 com.github.maeda6uiui.mechtatel.core.Mechtatel.run()V (229 bytes) @ 0x00007f3348868bfc [0x00007f3348868900+0x00000000000002fc]
j  com.github.maeda6uiui.mechtatel.CameraModeTest.<init>(Lcom/github/maeda6uiui/mechtatel/core/MttSettings;)V+6
j  com.github.maeda6uiui.mechtatel.CameraModeTest$$Lambda$137+0x00000008011489a0.accept(Ljava/lang/Object;)V+8
j  java.util.Optional.ifPresentOrElse(Ljava/util/function/Consumer;Ljava/lang/Runnable;)V+12 java.base@19.0.2
j  com.github.maeda6uiui.mechtatel.CameraModeTest.main([Ljava/lang/String;)V+15
v  ~StubRoutines::call_stub 0x00007f334805fcc6

siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000000000030

When validation errors are reported

2024-01-27 18:11:37,224 INFO [main] Mechtatel - Starting the Mechtatel engine...
Jan 27, 2024 6:11:37 PM com.jme3.system.NativeLibraryLoader loadLibbulletjme
INFO: Loading native library from /home/maeda6uiui/IdeaProjects/Mechtatel/mechtatel-core/target/classes/Bin/Linux64ReleaseSp_libbulletjme.so
2024-01-27 18:11:37,651 WARN [main] ValidationLayers - terminator_CreateInstance: Received return code -3 from call to vkCreateInstance in ICD /usr/lib/x86_64-linux-gnu/libvulkan_virtio.so. Skipping this driver.
2024-01-27 18:11:37,652 WARN [main] ValidationLayers - terminator_CreateInstance: Received return code -3 from call to vkCreateInstance in ICD /usr/lib/x86_64-linux-gnu/libvulkan_dzn.so. Skipping this driver.
Libbulletjme version 18.2.1 initializing
2024-01-27 18:11:38,925 INFO [main] Mechtatel - Mechtatel engine successfully started
2024-01-27 18:11:38,926 INFO [main] Mechtatel - Starting the main loop...
radv/amdgpu: The CS has been rejected, see dmesg for more information (-2).
Exception in thread "main" java.lang.RuntimeException: Failed to present a swapchain image: -4
	at com.github.maeda6uiui.mechtatel.core.vulkan.MttVulkanImpl.presentToFrontScreen(MttVulkanImpl.java:257)
	at com.github.maeda6uiui.mechtatel.core.MttWindow.present(MttWindow.java:178)
	at com.github.maeda6uiui.mechtatel.CameraModeTest.onUpdate(CameraModeTest.java:92)
	at com.github.maeda6uiui.mechtatel.core.MttWindow.update(MttWindow.java:174)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at com.github.maeda6uiui.mechtatel.core.Mechtatel.run(Mechtatel.java:160)
	at com.github.maeda6uiui.mechtatel.CameraModeTest.<init>(CameraModeTest.java:24)
	at java.base/java.util.Optional.ifPresentOrElse(Optional.java:196)
	at com.github.maeda6uiui.mechtatel.CameraModeTest.main(CameraModeTest.java:30)
2024-01-27 18:11:39,523 ERROR [main] ValidationLayers - vkQueueSubmit() failed (VK_ERROR_DEVICE_LOST)
2024-01-27 18:11:39,529 ERROR [main] ValidationLayers - Validation Error: [ VUID-vkFreeCommandBuffers-pCommandBuffers-00047 ] Object 0: handle = 0x7f8422cf0eb0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xfa21a40000000003, type = VK_OBJECT_TYPE_COMMAND_POOL; | MessageID = 0x1ab902fc | vkFreeCommandBuffers(): pCommandBuffers[0] (VkCommandBuffer 0x7f8422cf0eb0[]) is in use. The Vulkan spec states: All elements of pCommandBuffers must not be in the pending state (https://vulkan.lunarg.com/doc/view/1.3.275.0/linux/1.3-extensions/vkspec.html#VUID-vkFreeCommandBuffers-pCommandBuffers-00047)
2024-01-27 18:11:39,529 ERROR [main] ValidationLayers - Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Object 0: handle = 0x7f8422cf0eb0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xd5d2d1000000182f, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x4dae5635 | vkQueueSubmit(): pSubmits[0].pCommandBuffers[0] command buffer VkCommandBuffer 0x7f8422cf0eb0[] expects VkImage 0xd5d2d1000000182f[] (subresource: aspectMask 0x1 array layer 0, mip level 0) to be in layout VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_UNDEFINED.
2024-01-27 18:11:39,529 ERROR [main] ValidationLayers - Validation Error: [ VUID-vkFreeCommandBuffers-pCommandBuffers-00047 ] Object 0: handle = 0x7f8422cf0eb0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xfa21a40000000003, type = VK_OBJECT_TYPE_COMMAND_POOL; | MessageID = 0x1ab902fc | vkFreeCommandBuffers(): pCommandBuffers[0] (VkCommandBuffer 0x7f8422cf0eb0[]) is in use. The Vulkan spec states: All elements of pCommandBuffers must not be in the pending state (https://vulkan.lunarg.com/doc/view/1.3.275.0/linux/1.3-extensions/vkspec.html#VUID-vkFreeCommandBuffers-pCommandBuffers-00047)
2024-01-27 18:11:39,529 ERROR [main] ValidationLayers - Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Object 0: handle = 0x7f8422cf0eb0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xd0f33c0000001832, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x4dae5635 | vkQueueSubmit(): pSubmits[0].pCommandBuffers[0] command buffer VkCommandBuffer 0x7f8422cf0eb0[] expects VkImage 0xd0f33c0000001832[] (subresource: aspectMask 0x1 array layer 0, mip level 0) to be in layout VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_UNDEFINED.
2024-01-27 18:11:39,529 ERROR [main] ValidationLayers - Validation Error: [ VUID-vkFreeCommandBuffers-pCommandBuffers-00047 ] Object 0: handle = 0x7f8422cf0eb0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xfa21a40000000003, type = VK_OBJECT_TYPE_COMMAND_POOL; | MessageID = 0x1ab902fc | vkFreeCommandBuffers(): pCommandBuffers[0] (VkCommandBuffer 0x7f8422cf0eb0[]) is in use. The Vulkan spec states: All elements of pCommandBuffers must not be in the pending state (https://vulkan.lunarg.com/doc/view/1.3.275.0/linux/1.3-extensions/vkspec.html#VUID-vkFreeCommandBuffers-pCommandBuffers-00047)
2024-01-27 18:11:39,529 ERROR [main] ValidationLayers - Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Object 0: handle = 0x7f8422cf0eb0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xdb8c8b0000001835, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x4dae5635 | vkQueueSubmit(): pSubmits[0].pCommandBuffers[0] command buffer VkCommandBuffer 0x7f8422cf0eb0[] expects VkImage 0xdb8c8b0000001835[] (subresource: aspectMask 0x1 array layer 0, mip level 0) to be in layout VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_UNDEFINED.
2024-01-27 18:11:39,529 ERROR [main] ValidationLayers - Validation Error: [ VUID-vkFreeCommandBuffers-pCommandBuffers-00047 ] Object 0: handle = 0x7f8422cf0eb0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xfa21a40000000003, type = VK_OBJECT_TYPE_COMMAND_POOL; | MessageID = 0x1ab902fc | vkFreeCommandBuffers(): pCommandBuffers[0] (VkCommandBuffer 0x7f8422cf0eb0[]) is in use. The Vulkan spec states: All elements of pCommandBuffers must not be in the pending state (https://vulkan.lunarg.com/doc/view/1.3.275.0/linux/1.3-extensions/vkspec.html#VUID-vkFreeCommandBuffers-pCommandBuffers-00047)
2024-01-27 18:11:39,529 ERROR [main] ValidationLayers - Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Object 0: handle = 0x7f8422cf0eb0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xc75e650000001838, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x4dae5635 | vkQueueSubmit(): pSubmits[0].pCommandBuffers[0] command buffer VkCommandBuffer 0x7f8422cf0eb0[] expects VkImage 0xc75e650000001838[] (subresource: aspectMask 0x1 array layer 0, mip level 0) to be in layout VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_UNDEFINED.
2024-01-27 18:11:39,529 ERROR [main] ValidationLayers - Validation Error: [ VUID-vkFreeCommandBuffers-pCommandBuffers-00047 ] Object 0: handle = 0x7f8422cf0eb0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xfa21a40000000003, type = VK_OBJECT_TYPE_COMMAND_POOL; | MessageID = 0x1ab902fc | vkFreeCommandBuffers(): pCommandBuffers[0] (VkCommandBuffer 0x7f8422cf0eb0[]) is in use. The Vulkan spec states: All elements of pCommandBuffers must not be in the pending state (https://vulkan.lunarg.com/doc/view/1.3.275.0/linux/1.3-extensions/vkspec.html#VUID-vkFreeCommandBuffers-pCommandBuffers-00047)
2024-01-27 18:11:39,529 ERROR [main] ValidationLayers - Validation Error: [ UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Object 0: handle = 0x7f8422cf0eb0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xd5d2d1000000182f, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x4dae5635 | vkQueueSubmit(): pSubmits[0].pCommandBuffers[0] command buffer VkCommandBuffer 0x7f8422cf0eb0[] expects VkImage 0xd5d2d1000000182f[] (subresource: aspectMask 0x1 array layer 0, mip level 0) to be in layout VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL--instead, current layout is VK_IMAGE_LAYOUT_UNDEFINED.
2024-01-27 18:11:39,530 ERROR [main] ValidationLayers - Validation Error: [ VUID-vkFreeCommandBuffers-pCommandBuffers-00047 ] Object 0: handle = 0x7f8422cf0eb0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xfa21a40000000003, type = VK_OBJECT_TYPE_COMMAND_POOL; | MessageID = 0x1ab902fc | vkFreeCommandBuffers(): pCommandBuffers[0] (VkCommandBuffer 0x7f8422cf0eb0[]) is in use. The Vulkan spec states: All elements of pCommandBuffers must not be in the pending state (https://vulkan.lunarg.com/doc/view/1.3.275.0/linux/1.3-extensions/vkspec.html#VUID-vkFreeCommandBuffers-pCommandBuffers-00047)
2024-01-27 18:11:39,530 ERROR [main] ValidationLayers - Validation Error: [ VUID-VkPresentInfoKHR-pImageIndices-01430 ] Object 0: handle = 0x7f8420532f20, type = VK_OBJECT_TYPE_QUEUE; | MessageID = 0x48ad24c6 | vkQueuePresentKHR(): pPresentInfo->pSwapchains[0] images passed to present must be in layout VK_IMAGE_LAYOUT_PRESENT_SRC_KHR or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR but is in VK_IMAGE_LAYOUT_UNDEFINED. The Vulkan spec states: Each element of pImageIndices must be the index of a presentable image acquired from the swapchain specified by the corresponding element of the pSwapchains array, and the presented image subresource must be in the VK_IMAGE_LAYOUT_PRESENT_SRC_KHR or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR layout at the time the operation is executed on a VkDevice (https://vulkan.lunarg.com/doc/view/1.3.275.0/linux/1.3-extensions/vkspec.html#VUID-VkPresentInfoKHR-pImageIndices-01430)
2024-01-27 18:11:39,530 ERROR [main] ValidationLayers - Validation Error: [ UNASSIGNED-VkPresentInfoKHR-pImageIndices-MissingAcquireWait ] Object 0: handle = 0xaffee800000017d9, type = VK_OBJECT_TYPE_IMAGE; Object 1: handle = 0x603cd90000000044, type = VK_OBJECT_TYPE_FENCE; | MessageID = 0x1b6b9ef2 | vkQueuePresentKHR(): pPresentInfo->pImageIndices[0] was acquired with a fence VkFence 0x603cd90000000044[] that has not since been waited on

Process finished with exit code 1
@maeda6uiui maeda6uiui added the bug Something isn't working label Dec 17, 2023
@maeda6uiui maeda6uiui self-assigned this Dec 17, 2023
@maeda6uiui
Copy link
Owner Author

Might be related: godotengine/godot#71929

@maeda6uiui maeda6uiui changed the title Application exits with error when resizing a window in Ubuntu 22.04 Application exits with error when resizing a window on Ubuntu 22.04 Dec 17, 2023
@maeda6uiui
Copy link
Owner Author

maeda6uiui commented Jan 21, 2024

Confirmed the code from Vulkan-Tutorial-Java worked on my Ubuntu 22.04.

@maeda6uiui

This comment was marked as outdated.

@maeda6uiui maeda6uiui added wontfix This will not be worked on and removed bug Something isn't working labels Jan 26, 2024
@maeda6uiui
Copy link
Owner Author

I think I've pushed all that I could, but I couldn't find a way to fix this.
I've already spent a decent amount of time for this issue, and it seems to me that it's high time to give it up.
I'll leave this issue open for recording purposes, though.

As a workaround, settings were updated to disable window resizing by default.
df736a4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant