I am writing an OpenGL/GLUT project in pure C, and I've come across a
disturbing problem: calling glGenTextures results in the application
crashing with "Bus error" being printed to the console. A crash log is
also generated by CrashReporter.
In an attempt to isolate the true problem, I created a fresh Xcode
project with one single .c file: it contains nothing but a main()
entry point, and a simple call to glGenTextures. Unfortunately, the
same exact issue persists even in this isolated environment.
I am writing and executing this code on a first-generation MacBook
running OS X 10.5. The CPU is an Intel Core Duo, and the graphics
processor is an integrated Intel GMA 950 chip.
Bizarrely, this same code runs without any problems on a Windows
machine using the latest GLUT libs from Nate Robins' website.
Any help regarding this matter will be greatly appreciated. Below I
have cited all relevant information to the problem. Thanks for reading!
Here is the complete code (gentextures.c):
-----------
And here is an excerpt from the crash report:
-----------
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
Crashed Thread: 0