I got a single 1, as you would expect. Pressing reset produces another 1.
Hmm. Me thinks it's time to try another processor. I starting to suspect this one may have gone insane.
I can't say that a 489 Hz frequency introduced in your circuit should cause major problems.
There's something special about pin 8 being fed a PWM signal. If the wire is connect to another (unused) pin, the problem does not occur. If pin 3 is simply set high, the problem does not occur.
My guess is that an interrupt is indeed behind it.
I wish it was. Then I could fix it. Unfortunately, testing does not bear that out.
I tried the Sketch posted with a "catch all" interrupt handler. The handler did fire. Proof that an unhandled interrupt may be the culprit.
I tried a different Sketch that produced the failure with the "catch all" interrupt handler. The handler did not fire. Proof that an unhandled interrupt is not the culprit.
I tried a Sketch with individual handlers for all the interrupts that were not otherwise hooked. None of the them fire. Proof that an unhandled interrupt is not the culprit.
I tried "cli" in various places. The failure still occurs but the behaviour is different. Proof that an unhandled interrupt is not the culprit.
As far as I can tell, interrupts effect the symptoms but are not the root cause.
Judging by what you posted you are not using the standard "back end" library:
I'm using the standard "core". I made certain that the "libraries" (e.g. Servo, EEPROM, SoftwareSerial) were not part of the build. I've tried with and with out the libraries and it makes no difference (which is the one thing I expected to happen that actually did happen).
In other words, the Sketch built with a standard Arduino 0022 installation crashes.
This seems to be confirmed by the fact that your alternative serial output routine does not have this problem.
It's a good theory but it doesn't hold up to the interrupt tests I did. Interrupts seem to change the symptoms but just don't seem to be the cause.
The failures seem to be dramatically effected by the timing (one more line of code might be far fewer failures; two more lines of code result in many more failures). I suspect the "serial test" hit a magic timing spot with no failures.
Thank you for your time, your effort, and your comments! If you (or anyone else reading this) think of anything else, please let me know!