lwjgl3: X Error of failed request: RenderBadPicture (invalid Picture parameter)

I’m currently facing a very weird issue: In one of my projects I’m getting the following error during initialization. My initialization code is pretty much identical to the Pong example code, with added logging statements to see the steps of the initialization:

[LWJGL] Version: 3.0.0b SNAPSHOT
[LWJGL]      OS: Linux v3.13.0-79-generic
[LWJGL]     JRE: 1.8.0_74 amd64
[LWJGL]     JVM: Java HotSpot(TM) 64-Bit Server VM v25.74-b02 by Oracle Corporation
[LWJGL] Loaded library from java.library.path: lwjgl
[LWJGL] MemoryUtil accessor: MemoryAccessorUnsafe
[LWJGL] Loaded native library: lib/native/libjemalloc.so
[LWJGL] MemoryUtil allocator: JEmallocAllocator
 *** glfwInit
[LWJGL] Loaded native library: lib/native/libglfw.so
     glfwInit [done]
 *** setting glfwSetErrorCallback
     setting glfwSetErrorCallback [done]
 *** setting glfwWindowHint
     setting glfwWindowHint [done]
 *** glfwCreateWindow
X Error of failed request:  RenderBadPicture (invalid Picture parameter)
  Major opcode of failed request:  139 (RENDER)
  Minor opcode of failed request:  6 (RenderSetPictureClipRectangles)
  Picture id in failed request: 0x540005e
  Serial number of failed request:  3285
  Current serial number in output stream:  3287
java.lang.RuntimeException: Nonzero exit code returned from runner: 1
    at scala.sys.package$.error(package.scala:27)

The reason for the vague statement “during initialization” is that the error seems to be asynchronous, and it is not always happening in glfwCreateWindow. For instance, this is output of another run, where I somehow made it past the glfwCreateWindow:

< ... as before ... >
 *** setting glfwSetErrorCallback
     setting glfwSetErrorCallback [done]
 *** setting glfwWindowHint
     setting glfwWindowHint [done]
 *** glfwCreateWindow
X Error of failed request:  RenderBadPicture (invalid Picture parameter)
  Major opcode of failed request:  139 (RENDER)
  Minor opcode of failed request:  6 (RenderSetPictureClipRectangles)
  Picture id in failed request: 0x560005d
  Serial number of failed request:  3523
  Current serial number in output stream:  3525
     glfwCreateWindow [done]
 *** glfwMakeContextCurrent
pure virtual method called
terminate called without an active exception
java.lang.RuntimeException: Nonzero exit code returned from runner: 134

Note that the error in this case also comes with an additional pure virtual method called, which is not the case when it happens in other places.

Another example: If I don’t call glfwInit right at the start of the main function, the error always seems to be triggered by glfwInit itself, i.e., I do not get to the point of setting the error callback etc. I was actually very surprised to see that the behavior changes depending on whether I place glfwInit before or after the other initialization code, because this other code has nothing to do with OpenGL / native libraries and just initializes a few Java/Scala data structures.

I do get this error with both the latest stable build (build #3.0.0b build 64) and the latest nightly (build #3.0.0 build 41). My system is an Ubuntu 14.04, 64bit, Java 1.8.0_74, Nvidia Geforce GTX 670, Nvidia driver version 352.79.

What makes this issue even more annoying is the fact that it seems to be difficult to reproduce: So far, I get this error only in my main project. I was trying to come up with a minimal example to reproduce it, but in the minimal example the exact same code works. I’m currently trying to add some complexity from the big project to the minimal example to see what may trigger the problem. But even after adding all dependencies and using exactly the same JVM options, I could not reproduce the error so far. I’m now looking into other potential side effects…

I should add: I have just ported the big project from LWJGL 2.9.1 to 3.X for the first time. With 2.9.1 everything was working fine.

Any hints what could possibly go wrong would be highly appreciated.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 24 (11 by maintainers)

Most upvoted comments

@Spasi sorry for late reply … I could solve the problem. Actually it was related to Swing … I disabled Settings menu in jME (which is a splash screen with some settings like vsync, screen resolution , antialiasing ,…) which is a swing canvas. By disabling it, game runs fine.