desmume fails to start with GLXBadContext error

Bug #197437 reported by Graham C
34
This bug affects 1 person
Affects Status Importance Assigned to Milestone
desmume (Debian)
Fix Released
Unknown
desmume (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: desmume

When I try to run desmume or desmume-glade (i.e. both of the application menu entries added by this package) I get the following error:

The program 'desmume-glade' received an X Window System error.
This probably reflects a bug in the program.
The error was 'GLXBadContext'.
  (Details: serial 397 error_code 154 request_code 143 minor_code 5)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

desmume-cli works as expected when I feed it an nds rom, so I guess this is specific to the guis.

Revision history for this message
Graham C (chckens) wrote :

This is 0.7.3-3 in Hardy by the way, with a Radeon 9700 Pro using Free ati driver

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

This seems to be caused by a call to glXMakeCurrent with an invalid GLX context and doesn't come from desmume code (even if desmume could be triggering the bug).
To know more, you should try to obtain a backtrace (https://wiki.ubuntu.com/Backtrace).
Make sure that you run desmume with the --sync option and set a breakpoint to the gdk_x_error() function with 'break gdk_x_error'.
Try also disabling AIGLX or DRI or running desmume with the --disable-3d and/or the --gdk-gl-force-indirect options.

Changed in desmume:
status: New → Incomplete
Revision history for this message
Graham C (chckens) wrote :

desmume --disable-3d makes the problem go away, desmume --gdk-gl-force-indirect has no discernible effect

backtrace attached. I'll try disabling AIGLX/DRI next...

Revision history for this message
Graham C (chckens) wrote :

Disabling AIGLX also makes the problem disappear

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

Thanks for your cooperation. Looks like an SDL bug, so setting as appropriate.

Changed in desmume:
importance: Undecided → Low
status: Incomplete → Triaged
Revision history for this message
Colin McQuillan (m-niloc) wrote :

This is not related to SDL - the SDL calls are in other threads. I've extracted the relevant gtkglext parts into a program giving this error:

The program 'a.out' received an X Window System error.
This probably reflects a bug in the program.
The error was 'GLXBadContext'.
  (Details: serial 118 error_code 154 request_code 143 minor_code 5)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

Changed in desmume:
status: Unknown → New
Revision history for this message
Andy Hauser (andy-ubuntu-bugzilla) wrote :

I tested the test programm on two Archlinux installations. It only shows the problem on x86_64 one with the fglrx drivers.
The other is x86 with intel drivers and does not show a problem running the a.out.

Revision history for this message
Cesare Tirabassi (norsetto) wrote :

Yes this is really Xorg (http://dri.sourceforge.net/doc/DRIuserguide.html):

GLXPixmap rendering is only supported for indirect rendering contexts. This
is a common OpenGL limitation. Attempting to use a direct rendering context
with a GLXPixmap will result in an X protocol error.

I guess the only solution would be to render to a pbfuffer (or even better an FBO) and then bind the buffer to a gtk drawable.

As Colin pointed out this is anyhow not a problem for desmume only, but to all apps that would be using the gtkglext rendering to pixmap functions when DRI is enabled (I can reproduce with the pixmap and pixmap-mixed examples, as well as with masyv).

Revision history for this message
Evgeni Golov (evgeni) wrote :

This is fixed in 0.8-2 in Debian.

Revision history for this message
Justin Dugger (jldugger) wrote :

Fixed in Jaunty. Please reopen if you can duplicate in Jaunty!

Changed in desmume:
status: Triaged → Fix Released
Changed in desmume (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.