I have a class:
class A {
public:
static A& instance();
...
void setValue(int val){ _value = val; }
private:
int _value;
}
A& A::instance(){
static A _Instance;
return _Instance;
}
I am running this on an ARM processor. The issue I am encountering is that the application is triggering an alignment trap in the kernel when I call the instance() method from a particular class (say class B). If I call instance() from anywhere else, I do not encounter the alignment trap.
Alignment trap: not handling instruction e28fc609 at [<0001b588>]
I can see how this would happen if I were casting pointers to mis-aligned values, but I am simply referencing a static object. One would assume that the access would be correctly aligned.
Note the class is grossly simplified. It contains a lot of member variables and methods (not my design!).
Does anyone have any suggestions on where I may be going wrong, or where to look?