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

Started by theagentd, October 29, 2015, 19:59:01

Previous topic - Next topic

theagentd

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. >___<

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

theagentd

Redownloaded the latest nightly and it's still happening.

spasi

Could you try build #54 please? I probably uploaded #53 with old windows binaries.

theagentd

Updated again. The test program I posted works, but my huge test program still crashes like before. Looking into it.

theagentd

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!