Hello Guest

SIGSEGV on linux

  • 7 Replies
  • 12306 Views
SIGSEGV on linux
« on: November 28, 2016, 08:33:16 »
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


*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: SIGSEGV on linux
« Reply #1 on: November 28, 2016, 10:29:24 »
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.

Re: SIGSEGV on linux
« Reply #2 on: November 30, 2016, 00:00:45 »
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):
Code: [Select]
vkCmdDebugMarkerBeginEXT = provider.getFunctionAddress("vkCmdDebugMarkerBeginEXT");
So it seems it's "vkCmdDebugMarkerBeginEXT" function lookup that causes the crash.


*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: SIGSEGV on linux
« Reply #3 on: November 30, 2016, 17:38:48 »
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)?

Re: SIGSEGV on linux
« Reply #4 on: November 30, 2016, 18:43:47 »
I'm a total newbie in LWJGL, so I'm not sure I did it well, sorry  :')

I added a constant :

Code: [Select]
private static final ByteBuffer EXT_debug_marker = memASCII("VK_EXT_debug_marker");         
and the following code :
Code: [Select]
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 :
Quote
Exception 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)


*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: SIGSEGV on linux
« Reply #5 on: November 30, 2016, 18:55:56 »
OK, that means the extension is not available. I'll post again when what I said above is implemented.

*

Offline spasi

  • *****
  • 2261
    • WebHotelier
Re: SIGSEGV on linux
« Reply #6 on: November 30, 2016, 21:06:26 »
Could you please try the next snapshot? (3.1.1 #7)

Re: SIGSEGV on linux
« Reply #7 on: November 30, 2016, 21:43:43 »
You are very efficient   ;D
The various Vulkan demos now run correctly, thank you very much sir :)