Hello Guest

[FIXED] Latest nightlies broke GLFWCursorPosCallback/all callbacks???

  • 4 Replies
  • 13060 Views
Hello. The latest nightlies broke GLFWCursorPosCallback. I wrote this test program to showcase the problem. The program starts up correctly, but as soon as the mouse enters the window (or if it already is in the window when it is created) the entire VM crashes. Not sure if this is an LWJGL problem or a GLFW problem, so I'm posting it here first. EDIT: Also happens with scroll callbacks and framebuffer size callbacks, possibly all of them. >___<

Code: [Select]
package engine.test;

import static org.lwjgl.glfw.GLFW.*;
import static org.lwjgl.opengl.GL11.*;

import org.lwjgl.glfw.GLFWCursorPosCallback;
import org.lwjgl.glfw.GLFWErrorCallback;
import org.lwjgl.opengl.GL;
import org.lwjgl.system.MemoryUtil;

public class GLFWCursorTest {

public static GLFWErrorCallback errorCallback;
public static GLFWCursorPosCallback cursorCallback;

public static void main(String[] args) {

glfwSetErrorCallback(errorCallback = new GLFWErrorCallback(){
@Override
public void invoke(int error, long description) {

System.err.println("GLFW error occured");
System.err.println("\t" + MemoryUtil.memDecodeUTF8(description));
System.err.println("Stack trace:");
StackTraceElement[] stack = Thread.currentThread().getStackTrace();
for(int i = 4; i < stack.length; i++){
System.err.println(stack[i]);
}
System.err.println();

}
});

glfwInit();

glfwDefaultWindowHints();
long window = glfwCreateWindow(1024, 768, "Test window", 0, 0);
glfwMakeContextCurrent(window);
GL.createCapabilities();

glfwSetCursorPosCallback(window, cursorCallback = new GLFWCursorPosCallback() {

@Override
public void invoke(long window, double xpos, double ypos) {
System.out.println(xpos + ", " + ypos);
}
});

while(glfwWindowShouldClose(window) != GL_TRUE){
glClear(GL_COLOR_BUFFER_BIT);

glfwSwapBuffers(window);
glfwPollEvents();
}
}
}

Quote
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006f757a4c, pid=5360, tid=4668
#
# JRE version: Java(TM) SE Runtime Environment (8.0_20-b10) (build 1.8.0_20-ea-b10)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.20-b10 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# V  [jvm.dll+0x137a4c]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\Test\git\WSW\WSWTest\hs_err_pid5360.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
#

hs_err_pid5360.log: http://pastebin.com/xNuEqSTs
« Last Edit: October 29, 2015, 20:02:13 by theagentd »

Re: Latest nightlies broke GLFWCursorPosCallback/all callbacks???
« Reply #1 on: October 29, 2015, 20:41:13 »
Redownloaded the latest nightly and it's still happening.

*

Online spasi

  • *****
  • 2261
    • WebHotelier
Re: Latest nightlies broke GLFWCursorPosCallback/all callbacks???
« Reply #2 on: October 29, 2015, 20:52:03 »
Could you try build #54 please? I probably uploaded #53 with old windows binaries.

Re: Latest nightlies broke GLFWCursorPosCallback/all callbacks???
« Reply #3 on: October 29, 2015, 21:04:48 »
Updated again. The test program I posted works, but my huge test program still crashes like before. Looking into it.

Re: Latest nightlies broke GLFWCursorPosCallback/all callbacks???
« Reply #4 on: October 30, 2015, 17:02:33 »
Yep, fixed now. The natives were indeed outdated in #53 which broke everything, but after updating to #54 my test program was accidentally using the natives of #53. x_x Thanks!