SIGSEGV on linux

Started by ealrann, November 28, 2016, 08:33:16

Previous topic - Next topic

ealrann

Hello,

I'm trying to run the Vulkan demos (from lwjgl3-demos) and the HelloVulkan (from https://github.com/LWJGL/lwjgl3/blob/master/modules/core/src/test/java/org/lwjgl/demo/vulkan/HelloVulkan.java)

When I run it, I've got the following error (and no other messages):

Quote#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fc2347ce320, pid=3487, tid=0x00007fc26dca1700
#
# JRE version: OpenJDK Runtime Environment (8.0_112-b15) (build 1.8.0_112-b15)
# Java VM: OpenJDK 64-Bit Server VM (25.112-b15 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libvulkan.so.1+0xe320]
#
# Core dump written. Default location: /home/ealrann/_ws/workspace_test/LWJGL_demo/core or core.3487
#
# An error report file with more information is saved as:
# /home/ealrann/_ws/workspace_test/LWJGL_demo/hs_err_pid3487.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

The crash occurs when creating the VkInstance, and more precisely, when creating the VKCapabilities.

The others LWJGL demos works fine.
I am on Archlinux (x86_64), the vulkan libs are installed on my system. I have a nvidia 980GTX and tried both nvidia and nouveau drivers but same issue.


Here the full log :
http://pastebin.com/e2AyWZeC


spasi

Hello ealrann,

The crash dump is very helpful but I'm afraid I will need help debugging this. I don't have access to a Linux machine with Vulkan-capable hardware atm (this will change soon, hopefully).

It looks like the instance is created successfully, vkGetInstanceProcAddr is retrieved, but then the driver crashes when we call it in the VKCapabilities constructor. I'm interested to know if it crashes with any function, or if it's a specific function lookup that causes the crash. Could you please add a breakpoint here and find out?

It would also help if could run a native Vulkan application, to see if it's a general problem in your system or an LWJGL-specific bug.

ealrann

Thank you for your answer :)

Quote from: spasi
It would also help if could run a native Vulkan application, to see if it's a general problem in your system or an LWJGL-specific bug.

I just compiled and run this vulkan demo project : https://github.com/krh/vkcube : it runs fine.

Quote from: spasi
I'm interested to know if it crashes with any function, or if it's a specific function lookup that causes the crash. Could you please add a breakpoint here and find out?

I debugged a little, the crash occurs here :
https://github.com/LWJGL/lwjgl3/blob/master/modules/core/src/main/java/org/lwjgl/vulkan/VkInstance.java#L41
and more precisely  in VKCapabilities (l.282):
vkCmdDebugMarkerBeginEXT = provider.getFunctionAddress("vkCmdDebugMarkerBeginEXT");


So it seems it's "vkCmdDebugMarkerBeginEXT" function lookup that causes the crash.


spasi

One change I'll make that will probably help with this is stop loading function pointers for extensions that are not enabled.

In the meantime, could you please test what happens if you enable the VK_EXT_debug_marker extension (if it's available on your system)?

ealrann

I'm a total newbie in LWJGL, so I'm not sure I did it well, sorry  :')

I added a constant :

private static final ByteBuffer EXT_debug_marker = memASCII("VK_EXT_debug_marker");

         
and the following code :
extension_names.put(EXT_debug_marker);


here : https://github.com/LWJGL/lwjgl3/blob/master/modules/core/src/test/java/org/lwjgl/demo/vulkan/HelloVulkan.java#L418

and I got the following error :
QuoteException in thread "main" java.lang.IllegalStateException: Cannot find a specified extension library. Make sure your layers path is set appropriately.
   at LWJGLdemo.HelloVulkan.demo_init_vk(HelloVulkan.java:459)
   at LWJGLdemo.HelloVulkan.demo_init(HelloVulkan.java:531)
   at LWJGLdemo.HelloVulkan.run(HelloVulkan.java:1927)
   at LWJGLdemo.HelloVulkan.main(HelloVulkan.java:1938)


spasi

OK, that means the extension is not available. I'll post again when what I said above is implemented.

spasi

Could you please try the next snapshot? (3.1.1 #7)

ealrann

You are very efficient   ;D
The various Vulkan demos now run correctly, thank you very much sir :)