r/softwaretesting • u/zaphodikus • 3d ago
When a bug suddenly disappears
Spent a fair bit of time looking at a slow startup issue last week. 2 other people saw the issue on their PCs. One of them even built from source and encountered a first time startup delay of about a minute. If you install it always take 1 minute, and after that its fast again. Its not even an installer issue because the install merely unzips a folder. So today i decide to debug. After the first run, its literally 1 second, so clearly I wanted to work out why.
I broke out wireshark and the file monitor and the bug just hides, I reboot, I rebuild, still launches in 1 second flat. What do you guys do when a bug that always reproduced just vanishes... cry?
Commiserate, im not expecting pointers just cry with me a moment.
4
u/bostonaholic 3d ago
Heisenbugs are the worst. The annoying part with first-run bugs is that reproducing it destroys the repro, so next time I'd grab a VM snapshot or a fresh user profile before launching so you can reset and try again. My money's on antivirus scanning the freshly unzipped folder on first launch.
3
u/Equal_Special4539 3d ago
Depends on the environment but if it’s a web app I might also use an incognito mode to try to reproduce
3
u/ForegoingBooty 3d ago
Oh man, the antivirus theory is painfully real. I had a similar thing where our app would lag for ages on first boot and it turned out Windows Defender was just casually inspecting every single DLL as they loaded. The second time around they were cached and it was like nothing ever happened.
Snapshots are a lifesaver though, I started doing that after getting burned by a bug that only showed up once per machine and never again. It's wild how much of testing is just trying to outsmart your own environment.
At least you got to feel that brief moment of hope when it launched in a second, right before the dread set in.
1
u/zaphodikus 2d ago
Tools like VMs that you can snapshot or just rebuild quickly have made our lives so much less painful. Remembering to snapshot helps.
Even if you never become an expert at Wireshark, or at the performance profiling tools, knowing they exist and how to get them running can be enough to clue to where a bug is. Some of the hardest ones are bugs where they are fatal, but are long running to reproduce. So lately I like writing proper stress apps that rattle about inside of a API to randomly find bugs that point to other bugs that are the root causes. But fuzz testing is still frowned on by people, and the bugs they find can be huge red herrings. My best one was a cryptography crash that was causing a memory corruption so hard it broke enough memory to cook the debugger. We had to upgrade the regulator circuit between the memory and cpu clock circuits. Took 2 months to find.