glGetError causes a segmentation fault

Bug #318043 reported by Dima Ryazanov
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
mesa (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

In Ubuntu Intrepid, the following program crashes in glGetError:

#include <GL/glx.h>
#include <GL/gl.h>

int main(int argc, char* argv[]) {
    glGetError();
    return 0;
}

It used to work in Hardy.
[lspci]
00:00.0 Host bridge [0600]: Intel Corporation 82G33/G31/P35/P31 Express DRAM Controller [8086:29c0] (rev 02)
     Subsystem: Dell Unknown device [1028:020d]
00:02.0 VGA compatible controller [0300]: Intel Corporation 82G33/G31 Express Integrated Graphics Controller [8086:29c2] (rev 02) (prog-if 00 [VGA controller])
     Subsystem: Dell Unknown device [1028:020d]

Revision history for this message
Dima Ryazanov (dima-gmail) wrote :

It only happens when compiled in 32-bit Ubuntu.

Revision history for this message
Bryce Harrington (bryce) wrote :

Hi dima-gmail,

Please attach the output of `lspci -vvnn`, and attach your /var/log/Xorg.0.log file from after reproducing this issue. If you've made any customizations to your /etc/X11/xorg.conf please attach that as well.

Please attach the output of `lspci -vvnn` too.

[This is an automated message. If this script has reached you erroneously, please accept our apologies; any reply to this message will be sufficient to prevent it from doing further automated processing.]

Changed in mesa:
status: New → Incomplete
Revision history for this message
Dima Ryazanov (dima-gmail) wrote :
Revision history for this message
Dima Ryazanov (dima-gmail) wrote :

/var/log/Xorg.0.log doesn't have anything interesting: the program crashes before opening a connection to the X server. It does that even if DISPLAY is not set.

Changed in mesa:
status: Incomplete → New
Bryce Harrington (bryce)
description: updated
Revision history for this message
Dima Ryazanov (dima-gmail) wrote :

Btw, a workaround for this is to copy /usr/lib/libGL.so.1.2 from Hardy. I assume this means there should be an easy fix.

Revision history for this message
Bryce Harrington (bryce) wrote :

Hi dima-gmail,

Thanks for including the attached files. Could you also include your /var/log/Xorg.0.log (or Xorg.0.log.old) from after reproducing the issue?

[This is an automated message. Apologies if it has reached you inappropriately; please just reply to this message indicating so.]

Changed in mesa:
status: New → Incomplete
Revision history for this message
Dima Ryazanov (dima-gmail) wrote :

As I said, it doesn't require an X server - it still crashed even if DISPLAY was not set.
I could reproduce this with no X server running, so there was no log.

(I can't reproduce it at the moment, though: I switched to an NVidia video card, and the proprietary drivers replaced libGL with a different binary that doesn't crash.)

Revision history for this message
Dan Erik Petersen (dan-erik-petersen) wrote :

Hi all -

I get this segmentation fault also, but when running PyOpenGL-3.0.0b8 on 32-bit Ubuntu 8.10. For example:

$ python PyOpenGL-3.0.0b8/tests/test_glutwindow.py
newArguments ['tests/test_glutwindow.py']
Segmentation fault

Running GDB on this reveals:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb7cdeb70 (LWP 19457)]
0xb7af9156 in glGetError() from /usr/lib/libGL.so.1

This error does NOT show up on 64-bit Ubuntu 8.10 (amd64), and I thought it might be related to this bug post.

Dan;

Revision history for this message
Dima Ryazanov (dima-gmail) wrote :

Still happens in Ubuntu 9.04.

Revision history for this message
skrisman (ssandboxx) wrote :

Yeap running ubuntu jaunty

Revision history for this message
skrisman (ssandboxx) wrote :
skrisman (ssandboxx)
Changed in mesa (Ubuntu):
status: Incomplete → New
Revision history for this message
skrisman (ssandboxx) wrote :

After considering this a little more, aren't all calls to opengl not valid until a context is made current?

Revision history for this message
Dima Ryazanov (dima-gmail) wrote :

1) Without a context, calls should just return an error, not segfault. (And glGetError should be used to get the type of the error...)
2) glGetError crashes the same way if used with a valid context. It would just make the test case longer.

Revision history for this message
skrisman (ssandboxx) wrote :

Hmmm, mine doesn't crash with a valid context set as current, do you want to give an example?

Revision history for this message
skrisman (ssandboxx) wrote :

Alright I took a hint from Dima and tried the hardy libGL.so.1. It worked perfectly. Then i tried the other versions. I tried the jaunty, jaunty, and karmic, ALL OF THEM WORKED! I'm not really sure what that means but it fixed the problem for me. I got them from here http://packages.ubuntu.com/search?keywords=libgl1-mesa-swx11, but i didn't install, i merely copied libGlL.so.1 into /usr/lib.

This also fixed this bug: https://bugs.launchpad.net/ubuntu/+source/pyglet/+bug/381154

Bryce Harrington (bryce)
Changed in mesa (Ubuntu):
status: New → Confirmed
Revision history for this message
skrisman (ssandboxx) wrote :

The Packages I referred to did not have dri acceleration, so this is still a bug. The Karmic version still does not work, but the latest stable mesa 3d version does.

Revision history for this message
Bryce Harrington (bryce) wrote :

> but the latest stable mesa 3d version does.

Specifically which version are you referring to here?

Can you please test whether this problem is solved in the version of mesa included in xorg-edgers?
https://edge.launchpad.net/~xorg-edgers/+archive/ppa

Changed in mesa (Ubuntu):
status: Confirmed → Incomplete
Bryce Harrington (bryce)
tags: added: intrepid
Revision history for this message
Bryce Harrington (bryce) wrote :

We're closing this bug since it is has been some time with no response from the original reporter. However, if the issue still exists please feel free to reopen with the requested information. Also, if you could, please test against the latest development version of Ubuntu, since this confirms the bug is one we may be able to pass upstream for help.

Changed in mesa (Ubuntu):
status: Incomplete → Invalid
Revision history for this message
skrisman (ssandboxx) wrote :

Bug seems to be gone in Lucid Lynx.

Revision history for this message
Giuseppe Iannello (giuseppe-iannello) wrote :

Bug is back on 10.10, the test case in the first post leads to a segfault.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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