My guess is that you have a bad connection. Most microprocessor / microcontrollers will reset when the voltage gets low enough. Either ground is coming up due to a bad ground connection, or B+ is dropping down due to a bad power connection. I guess there is also a third possibility, a bad solder joint inside the ECM is essentially doing the same thing -- causing the voltage to droop resulting in a reset.
I just thought of a 4th possibility. A short circuit (such as a bare wire that grounds when you fly over the tracks) is causing the voltage drop.