The most likely cause is a random jump/call into the bootloader code in lower memory where I believe the program load code lives.
Look for computed jumps or function calls. These are the most likely culprits. Its possible if you are doing something like:
Code:
void (*myfunction)(void);
:
myfunction = function1;
:
myfunction();
}
that the function variable either doesn't get initialized or if there is a memory leak, gets overwritten. This is usually associated with some variable in memory before the function variable exceeding its area. For example a buffer[20] variable gets 22 things written to it and ends up overwriting the variables in memory that are after 'buffer'.
Another option is poor power conditioning resulting in drop outs, brown outs, or noise spikes that could cause strange execution results... but this would be low on my list of suspects.
Try printing out the address of any computed function calls like above or any computed jumps. Computed jumps are sometimes used for case and other tables by computing and offset and then directly writting to the PC<low> address register. Print out the computed address before invoking the jump.