Critical error during Display.create()

Started by Krisbam, October 04, 2010, 23:27:14

Previous topic - Next topic

Krisbam

Hello there! I've been using lwjgl for some time now, but lately I've been getting sporadic errors which critically crashes my app.
The error, "Java Result: -1073741819" seems to be caused during Display.create() in the initContext() function during swapBuffers() in the update() function. The pinpoint location is somewhere in the WindowsContextImplementation during a nSwapBuffers() function.

I have the newest version of Java (upgraded to see if it fixed the problem, it didn't), and a fairly fast quad-core computer with a 64-bit OS and NVIDIA 8800GTS as my gpu.


The biggest problem with this is how sporadic it is, I haven't been able to find out what causes it because sometimes my app works just fine, then suddenly it starts crashing over and over. Five minutes later it may work just fine again. Any ideas what may be causing this and what I could do to fix it?

bobjob


Krisbam

try {
    int currentBpp = Display.getDisplayMode().getBitsPerPixel();

    DisplayMode mode = findDisplayMode(WWIDTH, WHEIGHT, currentBpp);
            
    if(mode == null) {
        Sys.alert("Error", WWIDTH+"x"+WHEIGHT+"x"+currentBpp+"display mode unavaiable");
        return;
    }

    Display.setTitle("GameEngine");
    Display.setDisplayMode(mode);
    Display.setFullscreen(false);

            
    Display.create();

}catch (LWJGLException e) {
    e.printStackTrace();
    Sys.alert("Error", "Failed: "+e.getMessage());
}


Where WWIDTH = 800 and WHEIGHT = 600.

bobjob

I cant find anything wrong with it.

a few ideas/questions.

Are you attaching it to a canvas by any chance?

if not then maybe try to a sleep(1000) before the call to create, and try execture a few times, see if its trying to create Display before things are setup.
if so, then can you paste you canvas setPerant() code.

does it ever crash first execution try (after loading your IDE)?
if not than it could be that you are not cleaning up resources, as I noticed video card problems when I dont delete gl resources, untill I reload the IDE.

Krisbam

Not attaching anything to a canvas and the error can also occur right after the IDE has loaded.

I added in a sleep, but I can't really know if it works until it (maybe) starts crashing again.

Krisbam

Still crashing after the sleep and IDE restart. Didn't open any other programs or anything, just went to eat dinner and when I came back it crashed (and keeps crashing). Guess I'll try it again in some time..

bobjob

any problems with other LWJGL demos, or is it only in your own app?

just an idea, maybe go into your Graphics card control panel, and try fiddle with options see if its realted to buffer settings or such.

Can you try Display.setVSync(true);
before Display.create().

I know, grasping at straws.

Krisbam

Aha! I think it's the same error I've had in Minecraft. I figured out that it's (sometimes) caused by having Photoshop CS4 or 3ds Max open. Closing the programs seem to help.
I also got a couple of error logs from Minecraft, both which show exactly what I found out. The nSwapBuffers in WindowsContextImplementation is either causing the error, or the program just stops there.

Here's my two error logs:
First
Second


Thanks a lot for the fast response! I hope these logs can prove insightful into what's causing this problem.

princec

Yep - driver crash, get new drivers that work. That is the only solution before you go desperately trying lots of other things in the vain hope that it will fix things.

If there are no newer drivers that work, you are SOL I'm afraid, and all that's left is to report the problem to Nvidia.

Cas :)

bobjob

you could always try something like the "Omega" drivers