| 
 | 
 | 
 
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » [SOLVED] OpenGL reference example X11 crash 
	
		
		
			| [SOLVED] OpenGL reference example X11 crash [message #14343] | 
			Sat, 23 February 2008 00:00   | 
		 
		
			
				
				
				
					
						  
						masu
						 Messages: 378 Registered: February 2006 
						
					 | 
					Senior Member  | 
					 | 
		 
		 
	 | 
 
	
		Hi, 
 
I compiled the OpenGL package inside the reference assembly and got a program crash under X11 compiled in debug mode and a total X server crash when compiled in release mode. 
 
I first verified if my GL installation is working with glut examples and it works, so GL library and graphics card is not the problem. 
 
I get the following X11 error message dialog: 
X error: BadMatch (invalid parameter attributes)
resource id: 27262979 = 1A00003  
and after closing this dialog, a warning one 
 
 
I made an xwininfo run on the application window before closing the error dialog: 
xwininfo: Window id: 0x1a00001 (has no name)
  Absolute upper-left X:  30
  Absolute upper-left Y:  56
  Relative upper-left X:  6
  Relative upper-left Y:  29
  Width: 682
  Height: 512
  Depth: 24
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x20 (installed)
  Bit Gravity State: ForgetGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +30+56  -312+56  -312-200  +30-200
  -geometry 682x512+30+56  
I hope somebody understands what's going on and can help me trace down the problem. 
 
By the way, is it running under Linux ? 
 
FreeBSD 6, 801.r105 
 
Matthias
		
		
		[Updated on: Mon, 25 February 2008 21:52] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |  
	| 
		
 |  
	
		
		
			| Re: [BUG] OpenGL reference example X11 crash [message #14413 is a reply to message #14388] | 
			Mon, 25 February 2008 20:18   | 
		 
		
			
				
				
				
					
						  
						masu
						 Messages: 378 Registered: February 2006 
						
					 | 
					Senior Member  | 
					 | 
		 
		 
	 | 
 
	
		I found the problem. 
 
In X11DHCtrl.cpp in Init() class member UserVisualInfo is allocated on heap by calling custom visual info creation function in GLCtrl (CreateVisual()) that returns a pointer to the structure. 
 
This structure is deleted in Init() (from line 156 on) right after using it, but it has to live until it is needed in GLCtrl::AfterInit() in X11GLCtrl.cpp line 111 by calling DHCtrl::GetVisualInfo(). 
 
A fix is delete lines 155 to 160 in X11DHCtrl.cpp: 
	// Frees VisualInfo
    if (UserVisualInfo)
    {
        XFree( (char *)UserVisualInfo);
        UserVisualInfo = 0;
    } 
and add it to DHCtrl destructor. 
 
Of course, I don't know if that imposes any problems elsewhere. 
 
Matthias
		
		
		
 |  
	| 
		
	 | 
 
 
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 08:47:51 CET 2025 
 Total time taken to generate the page: 0.05838 seconds 
 |   
 |  
  |