Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411275 Posts in 69323 Topics- by 58380 Members - Latest Member: bob1029

March 28, 2024, 06:42:36 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)[Slick2D] Crash on some machines when using Image.getGraphics()
Pages: [1]
Print
Author Topic: [Slick2D] Crash on some machines when using Image.getGraphics()  (Read 721 times)
Zarkonnen
Level 1
*


Games! Kittens! Wine!


View Profile WWW
« on: March 02, 2015, 06:15:39 AM »

On some machines, creating a new Image and calling getGraphics() on it causes lwjgl to enter into some kind of faulty state that crashes when swapping buffers. Any idea what causes this and how to make Slick clean up after itself properly?

Reproduction code:

Code:
    package crashrepro;

    import org.newdawn.slick.*;

    public class CrashRepro extends BasicGame {
        public static void main(String[] args) throws Exception {
            CrashRepro cr = new CrashRepro("CrashRepro");
            // Crash only happens in fullscreen mode.
            AppGameContainer agc = new AppGameContainer(cr, 800, 600, true);
            agc.start();
        }

        public CrashRepro(String title) { super(title); }

        @Override
        public void init(GameContainer gc) throws SlickException {}

        @Override
        public void update(GameContainer gc, int i) throws SlickException {}

        @Override
        public void render(GameContainer gc, Graphics grphcs) throws SlickException {
            Image img = new Image(128, 128);
            img.getGraphics(); // This crashes the game.
        }
    }

Stack trace:

    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j  org.lwjgl.opengl.WindowsContextImplementation.nSwapBuffers(Ljava/nio/ByteBuffer;)V+0
    j  org.lwjgl.opengl.WindowsContextImplementation.swapBuffers()V+35
    j  org.lwjgl.opengl.ContextGL.swapBuffers()V+3
    j  org.lwjgl.opengl.DrawableGL.swapBuffers()V+0
    j  org.lwjgl.opengl.Display.swapBuffers()V+39
    j  org.lwjgl.opengl.Display.update(Z)V+44
    j  org.lwjgl.opengl.Display.update()V+1
    j  org.newdawn.slick.AppGameContainer.gameLoop()V+78
    j  org.newdawn.slick.AppGameContainer.start()V+17
    j  crashrepro.CrashRepro.main([Ljava/lang/String;)V+27
    v  ~StubRoutines::call_stub
Logged

Zarkonnen
Level 1
*


Games! Kittens! Wine!


View Profile WWW
« Reply #1 on: March 05, 2015, 08:10:18 AM »

OK, this turns out to be caused by a lwjgl bug.
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic