How I fixed git-grep macOS UTF-8 support
As a speaker of Greek, I’ve been fixing issues in the handling of non-ASCII characters for over 40 years, using techniques ranging from simple lookup tables to dynamic patching of in-memory images. Here’s how I debugged and fixed the handling of UTF-8 characters in the
Continue reading "How I fixed git-grep macOS UTF-8 support"
git grep command, which was broken for almost a decade.
Rather than alchemy, methodical troubleshooting
I recently encountered a pesky problem while trying to build a React Native project under Apple’s Xcode. The build would fail with an error reporting:
Continue reading "Rather than alchemy, methodical troubleshooting"
EMFILE: too many open files, watch. Frustratingly, all available advice on the web pointed to different (often inexplicable) directions, none of which worked. After tormenting myself with these, I decided to troubleshoot the problem methodically, which allowed me to pinpoint it and solve it with an uncommon and noteworthy application of the git bisect command. Here’s the story.
Debugging had to be discovered!
I start my Communications of the ACM article titled Modern debugging techniques: The art of finding a needle in a haystack (accessible from this page without a paywall) with the following remarkable quote. “As soon as we started programming, […] we found to our surprise that it wasn’t as easy to get programs right as we had thought it would be. […] Debugging had to be discovered. I can remember the exact instant […] when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs.” A Google search for this phrase returns close to 3000 results, but most of them are cryptically attributed as “Maurice Wilkes, discovers debugging, 1949”. For a scholarly article I knew I had to do better than that.
Continue reading "Debugging had to be discovered!"
An Embarrassing Failure
My colleague Georgios Gousios and I are studying the impact of software engineering research in practice. As part of our research, we identified award-winning and highly-cited papers, and asked their authors to complete an online survey. Each survey was personalized with the author’s name and the paper’s title and publication venue. After completing a trial and a pilot run, I decided to contact the large number of remaining authors. This is when things started going horribly wrong.
Continue reading "An Embarrassing Failure"
Of BOOL and stdbool
The C99 standard has added to the C programming language a Boolean type,
Continue reading "Of BOOL and stdbool"
_Bool and the
bool alias for it. How well does this type interoperate with the Windows SDK
BOOL type? The answer is, not at all well, and here’s the complete story.
Debugging in Practice: dgsh Issue 85
Fixing an insidious bug in the new Unix directed graph shell dgsh allowed me to demonstrate in practice 10 of the 66 principles, techniques, and tools I describe in the book Effective Debugging. Almost all steps all documented in the corresponding issue and commits. Here’s a detailed retrospective.
Continue reading "Debugging in Practice: dgsh Issue 85"
The Road to Debugging Success
A colleague recently asked me how to debug a Linux embedded system that crashed in the Unix shell (and only there), when its memory got filled through the buffer cache. He added that when he emptied the buffer cache the crash no longer occurred.
Continue reading "The Road to Debugging Success"
Debugging PCSecrets Synchronization
A reader of my Effective Debugging book commented that debugging is learned through experience. I think he’s partly right, so I’ll periodically describe here techniques and tools I use when debugging. A problem I faced today was the inability of the PC-based PCSecrets program to sync with the Secrets for Android counterpart. Here is how I troubleshot and solved the problem.
Continue reading "Debugging PCSecrets Synchronization"
Debugging a File Synchronization Problem
In Effective Debugging I write that if a web search doesn’t return you any useful results, then maybe you’re barking at the wrong tree. Here’s an example.
Continue reading "Debugging a File Synchronization Problem"
Modularity and Troubleshooting
A residual current device trips leaving the house in the dark.
How do I fix the problem?
Continue reading "Modularity and Troubleshooting"