LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: gaspode on February 13, 2011, 15:20:29

Title: error: BadGC (invalid GC parameter)
Post by: gaspode on February 13, 2011, 15:20:29
Hi,
I tried to use LWJGL library the first time. So, I don't have any expirence about it... maybe what I
reporting this is not a bug... I am tried to compile and run Game.java file form LWJGL sources and
I have noticed an error:

failed to create drawable
org.lwjgl.LWJGLException: X Error - disp: 0xffffffff8ee67ad8 serial: 88 error: BadGC (invalid GC parameter) request_code: 60 minor_code: 0
   at org.lwjgl.opengl.LinuxDisplay.globalErrorHandler(LinuxDisplay.java:277)
   at org.lwjgl.opengl.LinuxKeyboard.nSetDetectableKeyRepeat(Native Method)
   at org.lwjgl.opengl.LinuxKeyboard.setDetectableKeyRepeat(LinuxKeyboard.java:152)
   at org.lwjgl.opengl.LinuxKeyboard.destroy(LinuxKeyboard.java:163)
   at org.lwjgl.opengl.LinuxDisplay.destroyKeyboard(LinuxDisplay.java:1061)
   at org.lwjgl.input.Keyboard.destroy(Keyboard.java:349)
   at org.lwjgl.opengl.Display.destroyWindow(Display.java:357)
   at org.lwjgl.opengl.Display.access$300(Display.java:67)
   at org.lwjgl.opengl.Display$3.destroy(Display.java:146)
   at org.lwjgl.opengl.Display.create(Display.java:864)
   at org.lwjgl.opengl.Display.create(Display.java:785)
   at org.lwjgl.opengl.Display.create(Display.java:766)
   at org.lwjgl.examples.Game.init(Game.java:66)
   at org.lwjgl.examples.Game.main(Game.java:41)

I am using linux (ubuntu 10.10) and I have tired sun java jdk and openjdk to
compile this projects. Both have the same error. I have found a similar problem
http://lwjgl.org/forum/index.php/topic,2644.0.html but this error was reported
3 years ago.

Thanks,


Title: Re: error: BadGC (invalid GC parameter)
Post by: avm1979 on August 13, 2011, 14:46:08
Bump! I'm getting a report from a player having the same error. Using LWJGL 2.7.1 and "ATI 5770 running the latest oss ati driver available in Arch (xf86-video-ati 6.14.2-1)".

Some googling around seems to indicate it's a driver problem (or at least, resolved by getting more up-to-date drivers, which doesn't seem possible in this case), but just wanted to bring it up because according to this post (http://lwjgl.org/forum/index.php/topic,2644.0.html), the error has been fixed a few years ago :) Although, in my case, it's not creating the Display twice, so it's not quite the same.

Actual stack trace, which is slightly different than the OP:

Caused by: org.lwjgl.LWJGLException: X Error - disp: 0x91c56c8 serial: 97 error: BadGC (invalid GC parameter) request_code: 60 minor_code: 0
        at org.lwjgl.opengl.LinuxDisplay.globalErrorHandler(LinuxDisplay.java:277)
        at org.lwjgl.opengl.LinuxDisplay.nGrabPointer(Native Method)
        at org.lwjgl.opengl.LinuxDisplay.grabPointer(LinuxDisplay.java:351)
        at org.lwjgl.opengl.LinuxDisplay.updatePointerGrab(LinuxDisplay.java:382)
        at org.lwjgl.opengl.LinuxDisplay.updateInputGrab(LinuxDisplay.java:486)
        at org.lwjgl.opengl.LinuxDisplay.destroyMouse(LinuxDisplay.java:849)
        at org.lwjgl.input.Mouse.destroy(Mouse.java:303)
        at org.lwjgl.opengl.Display.destroyWindow(Display.java:354)
        at org.lwjgl.opengl.Display.access$300(Display.java:67)
        at org.lwjgl.opengl.Display$3.destroy(Display.java:146)
        at org.lwjgl.opengl.Display.create(Display.java:864)
        at org.lwjgl.opengl.Display.create(Display.java:785)
        ... 4 more
Title: Re: error: BadGC (invalid GC parameter)
Post by: Fool Running on August 15, 2011, 13:15:55
Looking at the call stack, it looks like the crash is happening destroying the Display during a a create.
I assume the stack trace is not showing the error that is causing the display to want to be destroyed during a create() call. Possibly your real problem is what is causing that to happen. If you can reproduce it, you might try stepping through the code or add debugging statements (maybe even have LWJGL debug mode on might help).

Just a shot-in-the-dark, though. :P
Title: Re: error: BadGC (invalid GC parameter)
Post by: avm1979 on August 15, 2011, 16:29:05
Thanks for the idea - unfortunately, it's not something I can reproduce.

FWIW, the player got it working by switching to proprietary ATI drivers from the oss ones and switching to OpenJDK from the hotspot JRE.

Somewhat off-topic, but for whatever reason, there have been quite a few crashes reported using LWJGL + ATI + Linux + Sun's JRE - which seem to be solved by switching to OpenJDK. Since the crash occurs in native code (usually in the driver), it boggles my mind why switching VM implementations would help.
Title: Re: error: BadGC (invalid GC parameter)
Post by: princec on August 15, 2011, 18:26:06
I'd just like to confirm that we had a ton of trouble with the proprietry ATI drivers on Linux as well, all solved by switching to the open sourced ones. And similarly Sun's JVM caused lots of bother but OpenJDK works flawlessly.

Cas :)
Title: Re: error: BadGC (invalid GC parameter)
Post by: avm1979 on August 15, 2011, 18:38:54
Thanks a lot - that settles it for me, will switch to shipping with OpenJDK on Linux. That's, like, 90% of the support requests.

Interesting about the oss drivers - they don't seem to help in my case, but OpenJDK does.