This page may be out of date. Submit any pending changes before refreshing this page.
Hide this message.
Quora uses cookies to improve your experience. Read more
Robert Walker

I don’t know if this really counts. It’s by far the hardest bug I’ve tried to debug so I suppose that counts as debugging. But I never found out what it was.

I just withdrew the software from sale. It was a minor program and I don’t know if anyone bought it - it was available in a bundle with another program Activity Timer that does get a few sales from time to time, which makes it hard to be sure but I don’t think anyone bought it for itself.

The program listing is here: Text Echo - Download - Text Echo - Windows Software

I mainly used it for multiple search and replace. It worked just fine except that about once a month, while editing text by hand, the rich edit control would show a few characters of garbage around the editing cursor inserted in the text. I went for several weeks always using it in the debug build and actually was able to break in the debugger after the bug eventually happened to see what was going on, but I still couldn’t figure it out as the code and variables all looked just fine.

The problem seemed to be happening in the Windows rich edit control itself. I got the program to copy its rich text source for me to look at and it was fine, but it was displayed incorrectly and further down the line would save incorrectly with these garbage characters. The visuals were inconsistent with the rich edit source. It’s several years now since I worked on it so I’m a bit hazy with the details of how that was.

But as far as I know I was initializing it and updating it correctly. I also tried inspecting the code my program used for working with the rich edit control visually - there wasn’t a lot of code, perhaps a few hundred lines, not many thousands of lines - and I saw nothing wrong with it. That doesn’t mean my code was fine. It might be that I had some hard to spot bug in how I initialized or updated the rich text control. I did some unusual things, particularly, streaming out the rich edit text as the raw rtf source code (which you can do), editing the source code and then streaming it back in again. Possibly something went wrong there somewhere along the line. One thought I have about it just now, what if occasionally my code somehow streamed invalid rtf source back into the control e.g. unpaired braces or some such - but only on rare occasions? Might that would confuse the inbuilt rich editor in Windows enough to do something strange at a later date although the rich edit source at that point looked fine?

I could have worked on it some more, but it’s really hard to debug a program that goes wrong only about once a month, and I never found a way to duplicate it to trigger the bug more often. Meanwhile I had several other programs that demanded my attention.

Another thing I could have done is profiling with various tools to check the code. I did do that, but only with the free tools available. There are some high cost code checking tools I could have bought to try to track down the bug by inspecting the code automatically, but I’ve no idea if they’d work either and not worth doing for a program that might or might not have earned a few dollars in its entire lifetime :). And I don’t think they’d catch bugs that depend on understanding what the intent is behind the code.

So, it’s just a mystery. I still use the program as a multi-search and replace tool for my own personal use. It can do a multi-search and replace of unlimited many search terms in plain text files (e.g. source code, html etc) simultaneously throughout a folder and all its subfolders .It’s not a capability I need very often but occasionally it is useful, maybe once every few years :).

I could change the rich edit field to a plain text field and remove all the rich edit features and do it as a plain text program, if it was worth doing that. It was such a minor bug, just a few garbled characters, inserted about once a month, However, there’s no way I can release it as a rich edit editor if it occasionally garbles a few characters while editing :).

About the Author

Robert Walker

Robert Walker

Writer of articles on Mars and Space issues - Software Developer of Tune Smithy, Bounce Metronome etc.
Studied at Wolfson College, Oxford
Lives in Isle of Mull
4.8m answer views110.3k this month
Top Writer2017, 2016, and 2015
Published WriterHuffPost, Slate, and 4 more