DEV Community

Mo Bitar
Mo Bitar

Posted on • Originally published at


I’m feeling a little delirious today, after having fully exhausted myself the past two days hunting down a dreadful bug. The most dreadful of all bugs: mobile crashes that occur on launch. Fortunately, this was just a beta build, and it was detected quickly by early testers. But, I was absolutely bewildered. What could it possibly be? The crash reports showed nothing. The changes I made in all were inconsequential. So unaffecting, in fact, that I pushed them straight to master. What could possibly go wrong?

I spent the next few days agonizingly trying to reproduce this bug, but no matter what I tried, no matter how much I tortured the application to show any signs of weakness, it excelled. I was actually impressed. Of course, it’s all a front by the application, which knows it’s being observed, so puts on its best behavior.

This bug, I was certain, would be my last. My entire life flashed before me. What if I never figure this out? I know you say that every time, but for real this time. I began carrying a heavy and fearful state of mind, overly sensitive and prickly to every negative thought. During times like these, it’s best to avoid introspection. Your incisions will be harmful. I went home early, and seriously began asking myself, what am I going to do? I’ve done everything I could.

I decided, out of raw desperation, to just brute force it, by walking through every single new line of code and interrogating it. First, I needed to undo the biggest wrong of all, and redirect the new version commits from master into their own branch, so I can easily review the changes. I thought this would be a catastrophic task, but turned out to be as simple as git branch 2.1, git reset HARD~12 (remove 12 commits), git checkout 2.1

I went through every line, tweaking it around to see if making it behave at its worst would have any fatal repercussions. Almost nothing did. But then I found it.

And really, that’s the end of the story. I’ll repeat this episode probably some time in the next few months. Each of these lucid nightmares instantly takes years off my lifespan, and propagates powerful seeds of negativity that, if not immediately severed, stand to contaminate your future. It’s a subtle, but beating effect.

Originally published on

Discussion (3)

sambenskin profile image
Sam Benskin

So many times, walking away and taking a break has given me time to think about the problem and then come back to the code with a fresh perspective. There's something about being away from the computer and being unable to actually look at or change the code that leaves you free to actually analyse the issue and often you'll come back to it with a new approach that solves the problem

bitario profile image
Mo Bitar Author

Yup, totally agree. I think our minds run background tasks aimed at solving the problem. I wrote some thoughts about this here: Problem=solution

ramankoh profile image

Its so relieving to see that I am not the only one who walks away from computer to think about problem.
I always go and find a quite place to think when I get these "hard-to-reproduce" bugs.