My app crashes or behaves incorrectly when compiled for PowerPC with the CMake "Debug" build type. I originally reported this in #184 but didn't realize at the time that crashes were happening for different reasons on different systems.
For example, my app may launch fine but crash later when I try to invoke a function from a third-party library. I flipped a build switch to completely exclude that third-party library from the build, and then the app failed its initialization function, which checks whether the Appearance Manager is installed. The app determined that Appearance was not installed, even though it is. My function that determines if Appearance is installed stores the result in a static variable, and I think something about static variables is not working correctly when the -g flag is used.
I've reduced this crash to the following simplest test case:
main.c:
void main(void)
{
static int s = -1;
++s;
}
Build commands (simplified from what CMake generated):
The crash is reported in MacsBug variously as "PowerPC unmapped memory exception" or "PowerPC read-only memory exception" or "PowerPC excluded memory exception". This is on a beige Power Macintosh G3 running Mac OS 9.2.2.
The problem disappears if I remove the -g flag from the first line when compiling main.c into main.o.
My app crashes or behaves incorrectly when compiled for PowerPC with the CMake "Debug" build type. I originally reported this in #184 but didn't realize at the time that crashes were happening for different reasons on different systems.
For example, my app may launch fine but crash later when I try to invoke a function from a third-party library. I flipped a build switch to completely exclude that third-party library from the build, and then the app failed its initialization function, which checks whether the Appearance Manager is installed. The app determined that Appearance was not installed, even though it is. My function that determines if Appearance is installed stores the result in a static variable, and I think something about static variables is not working correctly when the
-g
flag is used.I've reduced this crash to the following simplest test case:
main.c:
Build commands (simplified from what CMake generated):
The crash is reported in MacsBug variously as "PowerPC unmapped memory exception" or "PowerPC read-only memory exception" or "PowerPC excluded memory exception". This is on a beige Power Macintosh G3 running Mac OS 9.2.2.
The problem disappears if I remove the
-g
flag from the first line when compiling main.c into main.o.