Reputation:
I've recently come across a very strange segfault while developing my application. Basically, if I add another variable to one of my structs, a segfault is caused upon execution, for no apparent reason. Removing this variable immediately solves the problem. The struct is as follows:
typedef struct Note {
char cNote;
unsigned int uiDuration;
unsigned int uiVelocity;
};
As soon as I add a
long lStartTime;
variable anywhere in the struct, the code compiles as usual but will throw a segmentation fault. GDB's backtrace is lost somewhere in some obscure WIN methods that I don't even use.
Any ideas?
Thanks!
Upvotes: 1
Views: 1445
Reputation: 500357
I see several possible explanations:
struct
is of a certain size. Changing the size break things.struct
in a header file, but are failing to rebuild all source files that use the struct
.Upvotes: 2