It is often caused by attempting to read uninitialised memory.
Try skipping parts of the program until you locate the statement causing it.
Then replace each part of the data by hard-coded values, one by one, until you find the uninitialised variable/pointer.