I'm trying to clean up vamos (a GL realistic automotive simulator), but while I can get it to build on my rawhide box, it segfaults upon execution.
When I run it through gdb, it says it is segfaulting on:
0x00002aaaac0d2c0b in glGenTextures () from /usr/lib64/libGL.so.1 (gdb) bt #0 0x00002aaaac0d2c0b in glGenTextures () from /usr/lib64/libGL.so.1 #1 0x00002aaaab5818d2 in Vamos_Media::Texture_Image::initialize (this=0x7fff31cc9e30, smooth=false, mip_map=false, texture_wrap=10497) at Texture_Image.cc:94 #2 0x00002aaaab581c34 in Texture_Image (this=0x7fff31cc9e30, file_name=<value optimized out>, smooth=false, mip_map=false, width=1, height=1, texture_wrap=10497) at Texture_Image.cc:74 #3 0x0000000000404bb7 in main (argc=1, argv=0x7fff31cca318) at vamos.cc:214 #4 0x00002aaaad397aa4 in __libc_start_main () from /lib64/libc.so.6 #5 0x00000000004023c9 in _start ()
I don't know the first thing about writing GL apps, nor has googling imparted me with any useful tidbits.
The latest SRPM is here: http://www.auroralinux.org/people/spot/review/vamos-0.5.7-1.fc8.src.rpm
Any and all patches or advice is welcomed.
Thanks in advance,
~spot
On Thu, 2007-06-28 at 16:58 -0500, Tom "spot" Callaway wrote:
I'm trying to clean up vamos (a GL realistic automotive simulator), but while I can get it to build on my rawhide box, it segfaults upon execution.
When I run it through gdb, it says it is segfaulting on:
0x00002aaaac0d2c0b in glGenTextures () from /usr/lib64/libGL.so.1 (gdb) bt #0 0x00002aaaac0d2c0b in glGenTextures () from /usr/lib64/libGL.so.1
Try installing debuginfo for /usr/lib64/libGL.so.1 and rerunning. This is just a hunch but is the second argument to glGenTextures a valid non-NULL pointer? (maybe a wrong size assumption 32 vs 64-bit in the Vamos_Media::Texture_Image implementation?)
See: http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/gent...
[snip]
Hope this helps Dave
Tom "spot" Callaway wrote:
I'm trying to clean up vamos (a GL realistic automotive simulator), but while I can get it to build on my rawhide box, it segfaults upon execution.
When I run it through gdb, it says it is segfaulting on:
0x00002aaaac0d2c0b in glGenTextures () from /usr/lib64/libGL.so.1 (gdb) bt #0 0x00002aaaac0d2c0b in glGenTextures () from /usr/lib64/libGL.so.1 #1 0x00002aaaab5818d2 in Vamos_Media::Texture_Image::initialize (this=0x7fff31cc9e30, smooth=false, mip_map=false, texture_wrap=10497) at Texture_Image.cc:94 #2 0x00002aaaab581c34 in Texture_Image (this=0x7fff31cc9e30, file_name=<value optimized out>, smooth=false, mip_map=false, width=1, height=1, texture_wrap=10497) at Texture_Image.cc:74 #3 0x0000000000404bb7 in main (argc=1, argv=0x7fff31cca318) at vamos.cc:214 #4 0x00002aaaad397aa4 in __libc_start_main () from /lib64/libc.so.6 #5 0x00000000004023c9 in _start ()
I don't know the first thing about writing GL apps, nor has googling imparted me with any useful tidbits.
The latest SRPM is here: http://www.auroralinux.org/people/spot/review/vamos-0.5.7-1.fc8.src.rpm
Any and all patches or advice is welcomed.
Thanks in advance,
~spot
I've seen many glGenTextures crashes in games I've packaged, esp. on 64 bit. Usually the problem is that glGenTextures gets called before a glContext has been created. All proprietary GL implementations are fine with this, but Mesa will crash, esp on 64 bit (but I've seen this on 32 bit too).
Let me know if you need more help.
Regards,
Hans
On Fri, 2007-06-29 at 10:14 +0200, Hans de Goede wrote:
I've seen many glGenTextures crashes in games I've packaged, esp. on 64 bit. Usually the problem is that glGenTextures gets called before a glContext has been created. All proprietary GL implementations are fine with this, but Mesa will crash, esp on 64 bit (but I've seen this on 32 bit too).
Let me know if you need more help.
The code in question looks like this:
unsigned char* data = read_png_file (m_file_name);
GLuint texture_id; glGenTextures (1, &texture_id); glBindTexture (GL_TEXTURE_2D, texture_id); set_gl_parameters (data, smooth, mip_map, texture_wrap); m_texture_name = texture_id; delete [] data; ms_image_cache [m_file_name] = Cached_Image (m_texture_name, m_width_pixels, m_height_pixels);
All of the reference code I could find on google seemed to be similar, declare the GLuint variable, then initialize it with glGenTextures.
Is there something obviously wrong here?
Any help is appreciated,
~spot
Tom "spot" Callaway wrote:
On Fri, 2007-06-29 at 10:14 +0200, Hans de Goede wrote:
I've seen many glGenTextures crashes in games I've packaged, esp. on 64 bit. Usually the problem is that glGenTextures gets called before a glContext has been created. All proprietary GL implementations are fine with this, but Mesa will crash, esp on 64 bit (but I've seen this on 32 bit too).
Let me know if you need more help.
The code in question looks like this:
unsigned char* data = read_png_file (m_file_name); GLuint texture_id; glGenTextures (1, &texture_id); glBindTexture (GL_TEXTURE_2D, texture_id); set_gl_parameters (data, smooth, mip_map, texture_wrap); m_texture_name = texture_id; delete [] data; ms_image_cache [m_file_name] = Cached_Image (m_texture_name, m_width_pixels, m_height_pixels);
All of the reference code I could find on google seemed to be similar, declare the GLuint variable, then initialize it with glGenTextures.
Is there something obviously wrong here?
Not obviously no, let me try to rephrase my earlier hint.
No (none whatsover) libGL functions (including glGenTextures) may be called before an OpenGL context has been created, iow before a window suitable for openGL rendering has been created. So if this apps tries to loads the textures above before creating its window, then that will crash with Mesa.
The trick is to look at the sequence in which window creation (for example SDL _setVideoMode() with OPENGL flag, and the glGenTextures get called. 99% of all crashes which in the BT point to glGenTextures() are because of glGenTextures getting called before the window + openGL context is created.
I hope that helps, if not please repost the URL to the srpm and I'll take a look as time permits.
Regards,
Hans
On Fri, 2007-06-29 at 15:46 +0200, Hans de Goede wrote:
Not obviously no, let me try to rephrase my earlier hint.
No (none whatsover) libGL functions (including glGenTextures) may be called before an OpenGL context has been created, iow before a window suitable for openGL rendering has been created. So if this apps tries to loads the textures above before creating its window, then that will crash with Mesa.
The trick is to look at the sequence in which window creation (for example SDL _setVideoMode() with OPENGL flag, and the glGenTextures get called. 99% of all crashes which in the BT point to glGenTextures() are because of glGenTextures getting called before the window + openGL context is created.
I hope that helps, if not please repost the URL to the srpm and I'll take a look as time permits.
That does help! I figured out what was going wrong and now it works on x86_64. Thanks!
~spot