Hmm, it's failing in both cases but it's not giving us an error message.
Wonderful, eh. I guess the next two options of what to try (and I think
these are crazy and will probably cause GL to crash):
(1) In the function init_gl_handler() replace
if (!make_current_gl_handler(gl_handler)
return CCPN_FALSE;
with
make_current_gl_handler();
i.e. ignore the fact that the call doesn't work. This will probably crash
GL a line or two later.
(2) Instead try the even wackier:
if (!make_current_gl_handler(gl_handler)
return CCPN_TRUE;
Here, if GL doesn't crash it might still fail by drawing the contours off
in hyperspace.
Wayne
On Fri, 20 Jan 2006, Dr Andy Herbert wrote:
> Hi Wayne,
>
> I did remove the call to glGetError() from the if statement. I have
> also tried swapping the GL_FLAG, but still get the same error message.
>
> Cheers
>
> Andy
>
>
> On Fri, 2006-01-20 at 09:40 +0000, Wayne Boucher wrote:
> > Hmmm, doubly odd. You did remove the call to glGetError() from the if
> > statement itself, correct? Because if you did then that "0" below is
> > saying there was no error, but glXMakeCurrent is claiming it failed.
> > Well I guess you can fail without setting an error message but that is
> > odd. Assuming we take this all at face value then the computer is
> > claiming your GL "context" is not valid (I think). Now that context is
> > created in new_gl_handler() and the only parameter that sometimes causes
> > problems (definitely on the Mac) is the last one, which specifies whether
> > the "rendering is to be done with a direct connection to the graphics
> > system if possible (True) or through the X server (False)". In 1.0.8 (and
> > prior versions) this boolean value is decided at compile time via the
> > GL_FLAG in the environment.txt file. So you could try swapping that
> > around and then re-compiling (first remove gl_handler.o).
> >
> > Wayne
> >
> > On Thu, 19 Jan 2006, Dr Andy Herbert wrote:
> >
> > > Hi Wayne
> > >
> > > I hope this error message means more to you than me!
> > >
> > > >>> make_current_gl_handler failed: 0
> > > Problem in if (!init_gl_handler(gl_handler))
> > > Exception in Tkinter callback
> > > Traceback (most recent call last):
> > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > return self.func(*args)
> > > File
> > > "/usr/local/ccpnmr.debug/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2768, in resize
> > > self.setupWidgetHandler(canvas, isCanvas=True)
> > > File
> > > "/usr/local/ccpnmr.debug/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2494, in setupWidgetHandler
> > > widget.handler = self.handlerClass(widget)
> > > GlHandler.error: allocating Gl_handler object
> > > make_current_gl_handler failed: 0
> > > Problem in if (!init_gl_handler(gl_handler))
> > > Exception in Tkinter callback
> > > Traceback (most recent call last):
> > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > return self.func(*args)
> > > File
> > > "/usr/local/ccpnmr.debug/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2768, in resize
> > > self.setupWidgetHandler(canvas, isCanvas=True)
> > > File
> > > "/usr/local/ccpnmr.debug/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2494, in setupWidgetHandler
> > > widget.handler = self.handlerClass(widget)
> > > GlHandler.error: allocating Gl_handler object
> > > make_current_gl_handler failed: 0
> > > Problem in if (!init_gl_handler(gl_handler))
> > > Exception in Tkinter callback
> > > Traceback (most recent call last):
> > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > return self.func(*args)
> > > File
> > > "/usr/local/ccpnmr.debug/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2768, in resize
> > > self.setupWidgetHandler(canvas, isCanvas=True)
> > > File
> > > "/usr/local/ccpnmr.debug/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2494, in setupWidgetHandler
> > > widget.handler = self.handlerClass(widget)
> > > GlHandler.error: allocating Gl_handler object
> > >
> > >
> > > Cheers
> > >
> > > Andy
> > >
> > > On Thu, 2006-01-19 at 18:12 +0000, Wayne Boucher wrote:
> > > > Right, I think the only way for it to have failed there is for
> > > > make_current_gl_handler() to have failed. And I've not known that to fail
> > > > (except silently, i.e. it fails but says it has not failed, in which case
> > > > GL crashes). So this is a puzzle. Now in make_current_gl_handler() there
> > > > are the lines:
> > > >
> > > > if (!ok || !(glGetError() == GL_NO_ERROR))
> > > > return CCPN_FALSE;
> > > >
> > > > you could change that to:
> > > >
> > > > if (!ok) /* removed glGetError() */
> > > > {
> > > > printf("make_current_gl_handler failed: %d\n", glGetError());
> > > > return CCPN_FALSE;
> > > > }
> > > >
> > > > and see if it works (re-compile as usual in ccpnmr1.0/c). If that fails
> > > > (and it probably will) then we are probably stuffed. But it would be
> > > > interesting to know what the error code is. (I'll have to try and find
> > > > where that information is stored, what they mean.)
> > > >
> > > > Wayne
> > > >
> > > > On Thu, 19 Jan 2006, Dr Andy Herbert wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > I modified gl_handler.c as described, including the following amongst
> > > > > others:
> > > > >
> > > > > if (!init_gl_handler(gl_handler))
> > > > > {
> > > > > FREE(gl_handler_p, struct Gl_handler_p);
> > > > > printf("Problem in if (!init_gl_handler(gl_handler))\n");
> > > > >
> > > > > return NULL;
> > > > > }
> > > > >
> > > > > This is where the printf function is printed:
> > > > >
> > > > > >>> Problem in if (!init_gl_handler(gl_handler))
> > > > > Exception in Tkinter callback
> > > > > Traceback (most recent call last):
> > > > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > > > return self.func(*args)
> > > > > File
> > > > > "/usr/local/ccpnmr.debug/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPo pup.py", line 2768, in resize
> > > > > self.setupWidgetHandler(canvas, isCanvas=True)
> > > > > File
> > > > > "/usr/local/ccpnmr.debug/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPo pup.py", line 2494, in setupWidgetHandler
> > > > > widget.handler = self.handlerClass(widget)
> > > > > GlHandler.error: allocating Gl_handler object
> > > > > Problem in if (!init_gl_handler(gl_handler))
> > > > > Exception in Tkinter callback
> > > > > Traceback (most recent call last):
> > > > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > > > return self.func(*args)
> > > > > File
> > > > > "/usr/local/ccpnmr.debug/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPo pup.py", line 2768, in resize
> > > > > self.setupWidgetHandler(canvas, isCanvas=True)
> > > > > File
> > > > > "/usr/local/ccpnmr.debug/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPo pup.py", line 2494, in setupWidgetHandler
> > > > > widget.handler = self.handlerClass(widget)
> > > > > GlHandler.error: allocating Gl_handler object
> > > > > Problem in if (!init_gl_handler(gl_handler))
> > > > > Exception in Tkinter callback
> > > > > Traceback (most recent call last):
> > > > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > > > return self.func(*args)
> > > > > File
> > > > > "/usr/local/ccpnmr.debug/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPo pup.py", line 2768, in resize
> > > > > self.setupWidgetHandler(canvas, isCanvas=True)
> > > > > File
> > > > > "/usr/local/ccpnmr.debug/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPo pup.py", line 2494, in setupWidgetHandler
> > > > > widget.handler = self.handlerClass(widget)
> > > > > GlHandler.error: allocating Gl_handler object
> > > > >
> > > > >
> > > > > Hope this is more useful.
> > > > >
> > > > > Cheers
> > > > >
> > > > > Andy
> > > > >
> > > > > On Thu, 2006-01-19 at 13:14 +0000, Wayne Boucher wrote:
> > > > > > Hello,
> > > > > >
> > > > > > That could be one of a couple of things (unfortunately: that error message
> > > > > > will have to be expanded). So the only real way to find out is to go into
> > > > > > the C code and put some debug statements in and then re-compile.
> > > > > >
> > > > > > So in ccpnmr1.0/c/memops/global/gl_handler.c in the function
> > > > > > new_gl_handler() there are a few early return statements (in the next
> > > > > > release there will be a new one). Put a "printf" statement in to each
> > > > > > one. So for example, the first one would become:
> > > > > >
> > > > > > visual = glXChooseVisual(display, DefaultScreen(display), dblBuf);
> > > > > > if (!visual)
> > > > > > {
> > > > > > printf("could not find visual\n");
> > > > > > return NULL;
> > > > > > }
> > > > > >
> > > > > > Then re-compile (with a "make" in the ccpnmr1.0/c directory, not the
> > > > > > global directory) and try again.
> > > > > >
> > > > > > In fact, you might want to stick in the following above that visual check
> > > > > > (this will be in the next release):
> > > > > >
> > > > > > if (!glXQueryExtension(display, &dummy, &dummy))
> > > > > > {
> > > > > > printf("GLX extension not supported\n");
> > > > > > return NULL; /* check that OpenGL's GLX extension supported */
> > > > > > }
> > > > > >
> > > > > > with
> > > > > >
> > > > > > int dummy;
> > > > > >
> > > > > > defined at the top of the function. My (first) guess is that maybe the
> > > > > > GLX is not set up somewhere in the /etc config file, that query command
> > > > > > would trap that. Alternatively it's possible the last argument to
> > > > > > glXCreateContext is wrong (in the next release this will be settable at
> > > > > > run time but currently it is only settable at compile time).
> > > > > >
> > > > > > Note that if this initialisation fails you are toast, hence the later
> > > > > > error messages.
> > > > > >
> > > > > > Wayne
> > > > > >
> > > > > > On Thu, 19 Jan 2006, Dr Andy Herbert wrote:
> > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > I recently needed to change the graphics card in my linux box from an
> > > > > > > NVidia Geforce class to an NVidia quadro 4 type. When using openGL
> > > > > > > graphics with the bundled mesa lib analysis spits out the following
> > > > > > > error message when opening a window:
> > > > > > >
> > > > > > > Traceback (most recent call last):
> > > > > > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > > > > > return self.func(*args)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPo pup.py", line 2768, in resize
> > > > > > > self.setupWidgetHandler(canvas, isCanvas=True)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPo pup.py", line 2494, in setupWidgetHandler
> > > > > > > widget.handler = self.handlerClass(widget)
> > > > > > > GlHandler.error: allocating Gl_handler object
> > > > > > > Exception in Tkinter callback
> > > > > > > Traceback (most recent call last):
> > > > > > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > > > > > return self.func(*args)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPo pup.py", line 2768, in resize
> > > > > > > self.setupWidgetHandler(canvas, isCanvas=True)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPo pup.py", line 2494, in setupWidgetHandler
> > > > > > > widget.handler = self.handlerClass(widget)
> > > > > > > GlHandler.error: allocating Gl_handler object
> > > > > > > Exception in Tkinter callback
> > > > > > > Traceback (most recent call last):
> > > > > > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > > > > > return self.func(*args)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPo pup.py", line 2768, in resize
> > > > > > > self.setupWidgetHandler(canvas, isCanvas=True)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPo pup.py", line 2494, in setupWidgetHandler
> > > > > > > widget.handler = self.handlerClass(widget)
> > > > > > > GlHandler.error: allocating Gl_handler object
> > > > > > >
> > > > > > > and the following when moving the cursor on the new window (which
> > > > > > > doesn't show any spectra):
> > > > > > >
> > > > > > > Traceback (most recent call last):
> > > > > > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > > > > > return self.func(*args)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2814, in motion
> > > > > > > w = canvas.canvas_width
> > > > > > > AttributeError: WindowCanvas instance has no attribute 'canvas_width'
> > > > > > > Exception in Tkinter callback
> > > > > > > Traceback (most recent call last):
> > > > > > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > > > > > return self.func(*args)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2814, in motion
> > > > > > > w = canvas.canvas_width
> > > > > > > AttributeError: WindowCanvas instance has no attribute 'canvas_width'
> > > > > > > Exception in Tkinter callback
> > > > > > > Traceback (most recent call last):
> > > > > > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > > > > > return self.func(*args)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2814, in motion
> > > > > > > w = canvas.canvas_width
> > > > > > > AttributeError: WindowCanvas instance has no attribute 'canvas_width'
> > > > > > > Exception in Tkinter callback
> > > > > > > Traceback (most recent call last):
> > > > > > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > > > > > return self.func(*args)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2814, in motion
> > > > > > > w = canvas.canvas_width
> > > > > > > AttributeError: WindowCanvas instance has no attribute 'canvas_width'
> > > > > > > Exception in Tkinter callback
> > > > > > > Traceback (most recent call last):
> > > > > > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > > > > > return self.func(*args)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2814, in motion
> > > > > > > w = canvas.canvas_width
> > > > > > > AttributeError: WindowCanvas instance has no attribute 'canvas_width'
> > > > > > > Exception in Tkinter callback
> > > > > > > Traceback (most recent call last):
> > > > > > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > > > > > return self.func(*args)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2814, in motion
> > > > > > > w = canvas.canvas_width
> > > > > > > AttributeError: WindowCanvas instance has no attribute 'canvas_width'
> > > > > > > Exception in Tkinter callback
> > > > > > > Traceback (most recent call last):
> > > > > > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > > > > > return self.func(*args)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2814, in motion
> > > > > > > w = canvas.canvas_width
> > > > > > > AttributeError: WindowCanvas instance has no attribute 'canvas_width'
> > > > > > > Exception in Tkinter callback
> > > > > > > Traceback (most recent call last):
> > > > > > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > > > > > return self.func(*args)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2814, in motion
> > > > > > > w = canvas.canvas_width
> > > > > > > AttributeError: WindowCanvas instance has no attribute 'canvas_width'
> > > > > > > Exception in Tkinter callback
> > > > > > > Traceback (most recent call last):
> > > > > > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > > > > > return self.func(*args)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2814, in motion
> > > > > > > w = canvas.canvas_width
> > > > > > > AttributeError: WindowCanvas instance has no attribute 'canvas_width'
> > > > > > > Exception in Tkinter callback
> > > > > > > Traceback (most recent call last):
> > > > > > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > > > > > return self.func(*args)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2814, in motion
> > > > > > > w = canvas.canvas_width
> > > > > > > AttributeError: WindowCanvas instance has no attribute 'canvas_width'
> > > > > > > Exception in Tkinter callback
> > > > > > > Traceback (most recent call last):
> > > > > > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > > > > > return self.func(*args)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2814, in motion
> > > > > > > w = canvas.canvas_width
> > > > > > > AttributeError: WindowCanvas instance has no attribute 'canvas_width'
> > > > > > > Exception in Tkinter callback
> > > > > > > Traceback (most recent call last):
> > > > > > > File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
> > > > > > > return self.func(*args)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/memops/gui/ScrolledWindow.py", line 1333, in leave
> > > > > > > self.leave_func(event)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2925, in leave
> > > > > > > self.parent.endCrosshair()
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/AnalysisPopup.py", line 317, in endCrosshair
> > > > > > > popup.endCrosshair()
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2959, in endCrosshair
> > > > > > > self.endCanvasCrosshair(self.scrolled_window.canvases[j][i])
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2932, in endCanvasCrosshair
> > > > > > > self.setupWidgetHandler(canvas, isCanvas=True)
> > > > > > > File
> > > > > > > "/usr/local/ccpnmr.1.0.8/ccpnmr/ccpnmr1.0/python/ccpnmr/analysis/WindowPopup.py", line 2494, in setupWidgetHandler
> > > > > > > widget.handler = self.handlerClass(widget)
> > > > > > > GlHandler.error: allocating Gl_handler object
> > > > > > >
> > > > > > >
> > > > > > > This doesn't happen when I use the NVidia hardware accelerated graphics
> > > > > > > drivers, however then I still get a version of the random crashing
> > > > > > > reported earlier.
> > > > > > >
> > > > > > > Cheers
> > > > > > >
> > > > > > > Andy
> > > > > > >
> > > > > > > --
> > > > > > > Dr Andy Herbert
> > > > > > > Department of Chemistry
> > > > > > > University of Edinburgh
> > > > > > > West Mains Road
> > > > > > > Edinburgh
> > > > > > > UK
> > > > > > > EH9 3JJ
> > > > > > > Tel: +44 (0)131 650 4704 or 650 7372
> > > > > > > Email: [log in to unmask]
> > > > > > >
> > > > > --
> > > > > Dr Andy Herbert
> > > > > Department of Chemistry
> > > > > University of Edinburgh
> > > > > West Mains Road
> > > > > Edinburgh
> > > > > UK
> > > > > EH9 3JJ
> > > > > Tel: +44 (0)131 650 4704 or 650 7372
> > > > > Email: [log in to unmask]
> > > > >
> > > --
> > > Dr Andy Herbert
> > > Department of Chemistry
> > > University of Edinburgh
> > > West Mains Road
> > > Edinburgh
> > > UK
> > > EH9 3JJ
> > > Tel: +44 (0)131 650 4704 or 650 7372
> > > Email: [log in to unmask]
> > >
> --
> Dr Andy Herbert
> Department of Chemistry
> University of Edinburgh
> West Mains Road
> Edinburgh
> UK
> EH9 3JJ
> Tel: +44 (0)131 650 4704 or 650 7372
> Email: [log in to unmask]
>
|