I have this call in UIViewController-inheritor class context:
+ (void) smthPressed: (id) caller
{
// some code here
// ...
startTimers();
}
startTimers declared as:
inline void startTimers()
{
NSString * x = @""; // falls here with EXC_BAD_INSTRUCTION
// some other codes here
}
What the HELL is going on?
P.S.:
inline void startTimers()
{
int x = 0;
int y = 0; // EXC_BAD_INSTRUCTION here. Stack couldn't end there!
// ...
P.P.S.:
Documentation says: “For most non-memory access exceptions (for example, EXC_BAD_INSTRUCTION …)”, so it is NOT mem-access fault.
P.P.P.S.: arch is Standart (armv6 armv7). Nothing changes if I set Optimized (armv7).
Perhaps you have corrupted your stack accidentally. Does it occur when you place the
startTimers()code elsewhere in your program?Try using NSZombieEnabled and the static analyser to look for other places in your code you might be making memory-management errors that could lead to a write to a stack variable being invalid (overflowing arrays on the stack, bad pointers, etc).
You could also try switching compilers, if that option is available to you, in the extremely rare case that you hit a complier bug.