Debugging – Section 5.10 of Programming Pearls
cs.bell-labs.com
cs.bell-labs.com
The way a lot of bugs are eventually solved is not by asking what caused them, but when they started. It's often the regression testers who find the source. You keep going back through the nightly releases until you find one that doesn't exhibit the bug. At that point you go to the commit logs and there is your problem.
Given how much memory, disk space, etc. we have these days it's getting to the point that we should really have the ability to dump a program's state and all actions from starting the program to finishing it and then fast forward/rewind the actions of the user. Inspect all the locals, see what's actually happening. Set a loop over 30 seconds. Bugs would be a lot easier to find and recreate.
A bit like lightbox, but for debuggers!
It's just that no-one's done it yet and no programming language is really written to do it.
And I know the mozilla guys sometimes use chronicle-recorder to fully record a running application for debugging. (It was referenced in a bug I filed.)
http://code.google.com/p/chronicle-recorder/Great quote from that page, "The ODB is as close to a silver bullet as you can get. Why don't people use it?"
It is billed as "DVR for Java."
Given a program from 20 years ago this is definitely possible. Given a program from today, it becomes an intractable problem quite quickly.
> It's just that no-one's done it yet and no programming language is really written to do it.
Live programming might get you what you want, but it won't be through brute force tracing of everything. Better to focus on deterministic replay then its quite easy to rebuild the contexts we need to fake it.
Also, there are important things that you just can't log for legal or ethical reasons. For example, no user of a browser would be happy to know that the current URL they were viewing or their POST data was sent back to a browser developer (or even saved in a local file) without their explicit permission.
Cue fifteen minutes of frustrated googling and trying to figure out the problem.
Eventually, I write "cow".pluralize, and rails helpfully informs me that the plural of cow is kine. Aaaargh.
Turns out the problem was accessing `repo[:fork]`. That wasn't telling me whether the repo was original. (Oddly enough, repo.fork was safe.)
I thought that sounded made up, but apparently subliminal passwords do exist:
http://www.escapistmagazine.com/forums/read/7.382686-Remembe...
I couldn't figure out why my '%' key was exiting insert mode in vim. It turned out to be bad keying - I had remapped caps-lock to escape, and was grazing that key while hitting shift with my pinky. Drove me nuts until I figured it out, was especially hard to debug because it was an 'intermittent bug'.
That flaky appliance? Junk it and buy a new one.
The explosion of systems complexity have made many debugging tasks harder than ever before.