I have some code running on my Teensy3 that causes the Arduino development environment to hang to the point where I have to force-quit it to recover. I am still in the process of debugging this, but I thought I'd go ahead and post this just in case someone else has seen a similar problem and can save me some time.
Some characteristics of the bug:
1. It's a Heisenbug. Adding diagnostics changes the point at which the bug manifests itself.
2. It's not random. When the bug manifests itself it is 100% reproducible.
3. Under certain circumstances, the bug can manifest itself during a call to delay(), i.e. I can run this code:
Serial.println("foo");
delay(1000);
Serial.println("baz");
and I will get "foo" but not "baz".
4. It's not the linker problem reported yesterday by Bill Greiman (at least I don't think so -- I applied Bill's fix to my mk20dx128.ld file and nothing changed).
5. It's not caused by anything the teensy outputs on its USB serial port. I can run the code looking at the raw output from /dev/cu.usbmodem12341 (piped through hexdump so I can see everything) and there is no output after the point at which the bug is triggered.
6. I can't reproduce it with a simple sketch (yet). The bug only manifested itself once I was very deep into the development process for some very complicated code. Up to that point everything had been working flawlessly. I have no idea how I would go about reproducing the bug without all that hairy code.
This is a contender for weirdest-bug-I-have-ever-seen, and that's saying something.
Some characteristics of the bug:
1. It's a Heisenbug. Adding diagnostics changes the point at which the bug manifests itself.
2. It's not random. When the bug manifests itself it is 100% reproducible.
3. Under certain circumstances, the bug can manifest itself during a call to delay(), i.e. I can run this code:
Serial.println("foo");
delay(1000);
Serial.println("baz");
and I will get "foo" but not "baz".
4. It's not the linker problem reported yesterday by Bill Greiman (at least I don't think so -- I applied Bill's fix to my mk20dx128.ld file and nothing changed).
5. It's not caused by anything the teensy outputs on its USB serial port. I can run the code looking at the raw output from /dev/cu.usbmodem12341 (piped through hexdump so I can see everything) and there is no output after the point at which the bug is triggered.
6. I can't reproduce it with a simple sketch (yet). The bug only manifested itself once I was very deep into the development process for some very complicated code. Up to that point everything had been working flawlessly. I have no idea how I would go about reproducing the bug without all that hairy code.
This is a contender for weirdest-bug-I-have-ever-seen, and that's saying something.