Bug : checking extension crashes my app

Hi,
I’m trying to play with VBOs but before i must check if they are available. So i do :

if(GLContext.getCapabilities().GL_ARB_vertex_buffer_object)

But that crashes my JVM.

That’s my code :

import org.lwjgl.opengl.GLContext;

public class CTest {


	public static void main(String[] args) {
		if(GLContext.getCapabilities().GL_ARB_vertex_buffer_object) {
			System.out.println("Hello !");
		}

	}

}

And that’s the ouput from the log :

[quote]#

An unexpected error has been detected by HotSpot Virtual Machine:

SIGSEGV (0xb) at pc=0xb2727d1c, pid=14741, tid=3085366976

Java VM: Java HotSpot™ Client VM (1.5.0_05-b05 mixed mode)

Problematic frame:

j CTest.main([Ljava/lang/String;)V+3

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

Current thread (0x0805c058): JavaThread “main” [_thread_in_Java, id=14741]

siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x00001760

Registers:
EAX=0x00000000, EBX=0x00001760, ECX=0x00000000, EDX=0x00000008
ESP=0xbfcdbf30, EBP=0xbfcdbf4c, ESI=0xae81715b, EDI=0xbfcdbf54
EIP=0xb2727d1c, CR2=0x00001760, EFLAGS=0x00010246

Top of Stack: (sp=0xbfcdbf30)
0xbfcdbf30: bfcdbf30 ae81715b bfcdbf54 ae817348
0xbfcdbf40: 00000000 ae817180 bfcdbf54 bfcdbf68
0xbfcdbf50: b2717157 aab8edf8 00000001 b7a567a8
0xbfcdbf60: 0805c058 bfcdc1a4 bfcdc018 b7879b6c
0xbfcdbf70: bfcdbfd0 bfcdc1a4 0000000a ae817180
0xbfcdbf80: b271fb70 bfcdc0c4 00000001 0805c058
0xbfcdbf90: 00000001 bfcdbfb0 bfcdbfd0 00000000
0xbfcdbfa0: bfcdc1a4 00000000 0000000a b271fb70

Instructions: (pc=0xb2727d1c)
0xb2727d0c: 44 91 1c 59 c1 e8 1c 83 e0 0f 0f 85 0a 00 00 00
0xb2727d1c: 0f be 04 19 50 e9 a4 00 00 00 83 f8 03 0f 85 09

Stack: [0xbfae1000,0xbfce1000), sp=0xbfcdbf30, free space=2027k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
j CTest.main([Ljava/lang/String;)V+3
v ~StubRoutines::call_stub
V [libjvm.so+0x16cb6c]
V [libjvm.so+0x25f688]
V [libjvm.so+0x16c99f]
V [libjvm.so+0x18fd12]
V [libjvm.so+0x1844a7]
C [java+0x17fe]
C [libc.so.6+0x14ea2] __libc_start_main+0xd2
[/quote]
See the full log in the joined file.

I’ve tried with Java 1.5 and Java 1.6. I’m under Ubuntu Breezy. My graphic card is a NVidia 6800GT. I have the last driver from nvidia installed.
LWJGL version is 0.98-1.

I can replace the extention by any other one, it gives me the same.

Is it a bug ?

Sorry it was an error in my original code (the one i’ve posted before was a simple test).
Now the problem is solved, i don’t get the error and the crash.

You must initialize the display (and thus, OpenGL) before using GLContext.

or a pbuffer… anything that creates the initial GLContext

Yes, and that was what i did first. But the error was an “design error”, a bad implementation of my code.
And just after i posted this mess, i understand where was the error.

But thanks for your answers and sorry for my mistakes.

Even so you’ve found a crashing bug in LWJGL which we will have to get fixed :slight_smile:

Cas :slight_smile:

No, you’ve found a known bug in the JVM. I’ve reported it to SUN, but haven’t got a reply yet.

  • elias

if we are exceeding the 64 kb limit, are we not goinh to resolve that then ?

Oh, it’s that bug again. Well, yes, we can’t fix that ourselves :frowning:

Cas :slight_smile:

As far as I can tell, we’re not exceeding any JVM limits. In any case, the JVM shouldn’t crash like that, but spit out a proper exceptioin. BTW, java 1.4 seems to work fine, so this is actually a regression (ouch).

I just noticed this thread and the one you linked to and filed 6342951 to track it. I’m not sure whether the webbug reporting mechanism already filed another incident about it but you should be able to see this bug in the database tomorrow. The root cause was a change to HotSpot’s null check mechanism; for such large objects HotSpot would need to perform explicit null checks rather than implicit ones (which cause a SEGV / Access Violation and need to be recognized in a signal handler). In the 1.4 release changes were made in this area which seem to have broken things on certain platforms. Your test case crashes HotSpot as far back as 1.4.0 on Solaris/x86 and apparently as far back as 1.5.0 on Windows. I expect the bug will be fixed first in Mustang and then backported to update releases. Thanks for the small and self-contained test case.

Good to hear. Thank you for “fast-tracking” this one :slight_smile:

  • elias