Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
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 1335 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!
Online kevglass

JGO Kernel


Medals: 117
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« 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!
Legends of Yore - The Casual Retro Roguelike
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

JGO Knight


Medals: 19
Projects: 1


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.

 

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

The first screenshot will be displayed as a thumbnail.

ctomni231 (33 views)
2014-07-18 06:55:21

Zero Volt (29 views)
2014-07-17 23:47:54

danieldean (24 views)
2014-07-17 23:41:23

MustardPeter (26 views)
2014-07-16 23:30:00

Cero (41 views)
2014-07-16 00:42:17

Riven (43 views)
2014-07-14 18:02:53

OpenGLShaders (31 views)
2014-07-14 16:23:47

Riven (30 views)
2014-07-14 11:51:35

quew8 (29 views)
2014-07-13 13:57:52

SHC (64 views)
2014-07-12 17:50:04
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
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!