Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (404)
games submitted by our members
Games in WIP (289)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  VM error running nehe lesson#1  (Read 1122 times)
0 Members and 1 Guest are viewing this topic.
Offline f.l.x

Senior Member


Projects: 3


there is no place like 127.0.0.1


« Posted 2006-02-06 17:00:21 »

i'm trying to run the code of the first nehe opengl tutorials

everything goes well until i close the window, then the vm crashes with the following message
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0xb1993198, pid=9330, tid=2981018544
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_05-b05 mixed mode, sharing)
# Problematic frame:
# C  0xb1993198
#
# An error report file with more information is saved as hs_err_pid9330.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#


hs_err_pid9330.log attached for it could be of some use

Litterarum radices amaras, fructus dulces
http://flx.proyectoanonimo.com
figth spam!
Offline f.l.x

Senior Member


Projects: 3


there is no place like 127.0.0.1


« Reply #1 - Posted 2006-02-06 17:11:07 »

well, it seems to be caused by a Display.destroy() call on exit, commenting that line prevents the vm to crash, but is it safe? can i exit a lwgl program without destroying the display?

pardon my noobnes, both with lwgl and with opengl at all :p

Litterarum radices amaras, fructus dulces
http://flx.proyectoanonimo.com
figth spam!
Offline kevglass
« League of Dukes »

JGO Kernel


Medals: 54
Projects: 20


Mentally unstable, best avoided.


« Reply #2 - Posted 2006-02-06 17:19:49 »

Which version of LWJGL are you using?

Kev

Games published by our own members! Check 'em out!
Try the Free Demo of Titan Attacks
Offline f.l.x

Senior Member


Projects: 3


there is no place like 127.0.0.1


« Reply #3 - Posted 2006-02-06 17:43:03 »

0.99, downloaded today Smiley

[edit] nevermind i was importing the wrong "DisplayMode" :S [/edit]
one more oditie, rewriting this tutorial miself, i get the DisplayModes as follows
1  
DisplayMode[] modes = Display.getAvailableDisplayModes();


but i get this compilation problem
1  
Type mismatch: cannot convert from DisplayMode[] to DisplayMode[]

Litterarum radices amaras, fructus dulces
http://flx.proyectoanonimo.com
figth spam!
Offline f.l.x

Senior Member


Projects: 3


there is no place like 127.0.0.1


« Reply #4 - Posted 2006-02-07 20:49:32 »

I'm still getting this error sometimes

this is my code, the vm crashes when i don't select any display mode in my selector, say, when the display is not set nor created.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
public class Tutorial_1 implements Runnable{
   public boolean running = true, presionando_f1;
   private DisplayMode displayMode;

   /**
    * @param args
    */

   public static void main(String[] args) {
      new Tutorial_1();
      System.err.println("exiting...");
   }
   
   public Tutorial_1(){
      createWindow(false);
      run();
   }
   
   private void createWindow(boolean fullscreen){//init the window
     try{
         Display.setFullscreen(fullscreen);
         DisplayMode[] modes = Display.getAvailableDisplayModes();
         
         //This shows a dialog to let you choose a display mode
        int opcion = JOptionPane.showOptionDialog(null, "Select a display mode", "!",
               JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE,
               null, modes, 0);
         if(opcion != JOptionPane.CLOSED_OPTION) {//If you have selected an option...
           displayMode = modes[opcion];
            Display.setDisplayMode(displayMode);
            Display.setTitle("Tutorial 1 de Opengl con LWGL");
            Display.create();
           
         } else {//else, we won't loop on the run() method
           //System.exit(0); // Commented to avoid vm-crash (but i still get them), i'll use this instead
           running = false;
         }
         
      }catch(LWJGLException e){
         e.printStackTrace();
         System.exit(1);
      }
   }
   
   public void run(){
      while(running){
         if(Display.isCloseRequested()){//Exits if requested
           running = false;
         }
      }
   }
}


thanks for the help, i'm off to a good start and i want to know where do this errors come to avoid them in further projects  Grin

Litterarum radices amaras, fructus dulces
http://flx.proyectoanonimo.com
figth spam!
Offline Matzon
« League of Dukes »

JGO Knight


Medals: 13
Projects: 2


I'm gonna wring your pants!


« Reply #5 - Posted 2006-02-07 21:41:52 »

nvidia issue, fixed in cvs by not unloading OpenGL

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
Index: GLContext.java
===================================================================
RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLContext.java,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- GLContext.java   29 Aug 2005 20:14:59 -0000   1.53
+++ GLContext.java   12 Jan 2006 12:25:12 -0000   1.54
-320,7 +320,11 @@
    /** The OpenGL library reference count is decremented, and if it reaches 0, the library is unloaded. */
    public static synchronized void unloadOpenGLLibrary() {
       gl_ref_count--;
-      if ( gl_ref_count == 0 )
+      /*
+       * Unload the native OpenGL library unless we're on linux, since
+       * some drivers (NVIDIA proprietary) crash on exit when unloading the library.
+       */

+      if (gl_ref_count == 0 && LWJGLUtil.getPlatform() != LWJGLUtil.PLATFORM_LINUX)
          nUnloadOpenGLLibrary();
    }

Offline f.l.x

Senior Member


Projects: 3


there is no place like 127.0.0.1


« Reply #6 - Posted 2006-02-07 23:22:45 »

wow, thanks!
you are doing a grat job with lwgl Smiley

Litterarum radices amaras, fructus dulces
http://flx.proyectoanonimo.com
figth spam!
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Browse for soundtracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (23 views)
2013-05-17 21:29:12

alaslipknot (34 views)
2013-05-16 21:24:48

gouessej (64 views)
2013-05-16 00:53:38

gouessej (63 views)
2013-05-16 00:17:58

theagentd (73 views)
2013-05-15 15:01:13

theagentd (67 views)
2013-05-15 15:00:54

StreetDoggy (108 views)
2013-05-14 15:56:26

kutucuk (131 views)
2013-05-12 17:10:36

kutucuk (131 views)
2013-05-12 15:36:09

UnluckyDevil (140 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.433 seconds with 20 queries.