this post was submitted on 02 May 2025
3 points (100.0% liked)

Programming

0 readers
3 users here now

A magazine created for the discussion of computer programming-related topics.

Rules

Please keep submissions on topic and of high quality. No image posts, no memes, no politics. Keep the magazine focused on programming topics not general computing topics. Direct links to app demos (unrelated to programming) will be removed. No surveys.

founded 2 years ago
MODERATORS
 

I just spent untold hours debugging an issue I introduced myself by "removing an unnecessary variable".

The variable was necessary.

#development #programming

you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 1 points 1 week ago (1 children)

The code originally made a copy of a struct before modifying the copy. The original was then used afterwards. I entirely missed the later use and that it was critical that the original struct was used as is. So I passed a subtly modified struct to the later processing, which, in combination with a second bug I had introduced some time earlier, caused all kinds of havoc.

There was another bug I also introduced, which funnily had similar effects. This bug was added months ago, and it affected only older OS versions. I typically only run the bleeding version during development (but I had tested the change with older versions, too). Unfortunately, this issue was random as it depended on stack contents to get triggered, and thus went unnoticed until the additional scrutiny introduced this intense debugging session.

The combination of these factors made this highly frustrating thing to debug, as any kind of A-B testing fails when you have multiple or random issues.

#bugstories

[โ€“] [email protected] 1 points 1 week ago

@[email protected]
This was posted the other day on here, apologies to them as can't remember who it was, but anyway congrats on being a meme lol

Pink panther cuts a tree and instead of the tree falling the world drops away. Caption says "when you delete a block of code you thought was useless"