X11 and OpenGL problems (Bus Error: EXC_BAD_ACCESS)
X11 and OpenGL problems (Bus Error: EXC_BAD_ACCESS)
- Subject: X11 and OpenGL problems (Bus Error: EXC_BAD_ACCESS)
- From: Matthew Herberg <email@hidden>
- Date: Mon, 20 Jan 2003 18:21:25 -0800
I've successfully compiled glchess (http://glchess.sourceforge.net) on
my 500MHz iBook running OS X 10.2.3 with Apple X11 and the SDK
installed.
Now I seem to reach a problem with the glMatrixMode call causing a bus
error (EXC_BAD_ACCESS), when I run the program, which does not occur
with the same source code compiled on another Unix/Linux machine with a
different libGL.
Here is the basic GDB output:
[mherberg:~] mherberg% gdb /usr/local/bin/glchess
GNU gdb 5.1-20020408 (Apple version gdb-228) (Sun Jul 14 10:07:24 GMT
2002)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and
you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "powerpc-apple-macos10".
Reading symbols for shared libraries ....... done
(gdb) run
Starting program: /usr/local/bin/glchess
[Switching to process 7758 thread 0xb03]
Reading symbols for shared libraries
.............................................................. done
/Users/mherberg/.glchessrc not found trying /etc/glchessrc
Program received signal EXC_BAD_ACCESS, Could not access memory.
0x90986c38 in glMatrixMode ()
And here is the innocent looking source code:
/* Reset then recalculate the projection matrix */
void reset_perspective(Game * game)
{
GLint viewport[4];
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glGetIntegerv(GL_VIEWPORT, viewport);
redo_perspective(game, viewport[2], viewport[3]);
glMatrixMode(GL_MODELVIEW);
}
Other than reporting this problem to Apple, implying it is a problem
with their implementation, what possibly could be the cause? I'm not
experienced with EXC_BAD_ACCESS errors, so any advice on how I can
pinpoint and further debug the program is greatly appreciated. I can
also post more information if it is required.
Thanks in advance,
M. Herberg
_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe: http://www.lists.apple.com/mailman/listinfo/x11-users
Do not post admin requests to the list. They will be ignored.