In search of the elusive Heisenbug
Posted on February 19, 2004
Filed Under /dev/null/ | 28 views |
Mark Pilgrim documents a great story (if you’re a code geek who’d rather read about other people’s debugging mysteries than go outside where it’s above 0C for the first time in months) about tracking down an elusive Heisenbug in his Universal Feed Parser:
Earlier this evening, I integrated libxml2 support. When I ran the complete set of unit tests for beta 18 with libxml2 under Python 2.3 on Windows, one test failed. It was one of the ones that gets routed through the testing framework’s HTTP server, which makes it more difficult to test and dramatically increases the number of things that could have caused the problem other than the code being tested.
Take out libxml2, all tests pass. Put back libxml2, same test fails. Strange.
Turn on my _debug flag and re-run just that one test. It prints a bunch of stuff to stderr and then… passes. Turn off libxml2, and back on, twice, in disbelief. Passes. Turn off debugging and re-run just that one test; it still passes. The test passes consistently when run by itself.
I won’t spoil it for you by quoting the ending but it made me laugh.
(Heisenbug: “A bug that disappears or alters its behavior when one attempts to probe or isolate it.”).
Comments
Leave a Reply