991
Bug Fixing (programming.dev)
submitted 5 months ago by [email protected] to c/[email protected]
top 50 comments
sorted by: hot top controversial new old
[-] [email protected] 105 points 5 months ago* (last edited 5 months ago)

And the worst part is when it actually does and you have no fucking idea what went wrong before.

[-] [email protected] 30 points 5 months ago

The pc had the hiccups and now it's fine. Problem solved!

[-] [email protected] 8 points 5 months ago

Some times my game engine needs a wake up run, then an actual run.

load more comments (1 replies)
load more comments (1 replies)
load more comments (1 replies)
[-] [email protected] 97 points 5 months ago

That's step zero: rule out black magic

[-] [email protected] 54 points 5 months ago

Those damn cosmic rays flipping my bits

[-] [email protected] 9 points 5 months ago

Please tell me you look skyward, shake your fist and yell damn you!!!!

[-] [email protected] 5 points 5 months ago

I wonder if there's an available OS that parity checks every operation, analogous to what's planned for Quantum computers.

load more comments (2 replies)
[-] [email protected] 13 points 5 months ago

That feeling when it is, in fact, computer ghosts.

[-] [email protected] 70 points 5 months ago

Me: "Hmm... No... No the code is good, it's the compiler that's wrong."

runs again

[-] [email protected] 59 points 5 months ago

Yeah, but sometimes it works.

[-] [email protected] 20 points 5 months ago

It's even worse then: that means it's probably a race condition and do you really want to run the risk of having it randomly fail in Production or during an important presentation? Also race conditions generally are way harder to figure out and fix that the more "reliable" kind of bug.

load more comments (1 replies)
[-] [email protected] 8 points 5 months ago

Mmm, race conditions, just like mama used to make.

[-] [email protected] 6 points 5 months ago* (last edited 5 months ago)

There was that kind of bug in Linux and a person restarted it idk how much (iirc around 2k times) just to debug it.

[-] [email protected] 6 points 5 months ago

This is 100% valid when dealing with code generation sometimes and I hate it

load more comments (5 replies)
[-] [email protected] 40 points 5 months ago

The first is a surprise; the second is testing.

[-] [email protected] 34 points 5 months ago
[-] [email protected] 64 points 5 months ago

Hmm..you may be right. I'll get my Hispanic friend to run it and see if he gets the same result.

[-] [email protected] 21 points 5 months ago
[-] [email protected] 25 points 5 months ago

ok, then we ship your machine.

[-] [email protected] 26 points 5 months ago

i sometimes do that so i can inspect the error messages on a cleared terminal

[-] [email protected] 9 points 5 months ago

Sometimes I forget what I was looking for and have to restart the mental loop when doing this.

[-] [email protected] 24 points 5 months ago

One of my old programs produces a broken build unless you then compile it again.

load more comments (1 replies)
[-] gravitas_deficiency 22 points 5 months ago
======== 37/37 tests passing ========
[-] [email protected] 12 points 5 months ago

That's when the real debug session begins

[-] [email protected] 11 points 5 months ago

Great time to find out your tests are useless!

[-] gravitas_deficiency 4 points 5 months ago

They’re not completely useless. They’re conditionally useless, and we don’t know the condition yet.

load more comments (5 replies)
[-] [email protected] 20 points 5 months ago

Just had that happen to me today. Setup logging statements and reran the job, and it ran successfully.

[-] [email protected] 16 points 5 months ago

I've had that happen, the logging statements stopped a race condition. After I removed them it came back...

[-] [email protected] 10 points 5 months ago

Thank you for playing Wing Commander!

[-] [email protected] 19 points 5 months ago

The crazy thing is that sometimes this just works...

[-] [email protected] 18 points 5 months ago

I often do this, but I always hit Ctrl-S before running it again. Shamefully, this probably works about 10% of the time. Does that technically count as changing nothing?

[-] [email protected] 12 points 5 months ago

That and a make clean can work wonders.

[-] [email protected] 4 points 5 months ago

Autosave on focus loss dude.

[-] [email protected] 18 points 5 months ago

If that doesn't work, sometimes your computer just needs a rest. Take the rest of the day off and try it again tomorrow.

[-] [email protected] 17 points 5 months ago

Well, duh! You need to use the right incantations!

[-] [email protected] 14 points 5 months ago

I actually did this earlier today

load more comments (1 replies)
[-] [email protected] 10 points 5 months ago

it's only dumb til it works

[-] [email protected] 5 points 5 months ago

Sponsored by QA gang. Gotta make sure it's a 5/5 issue and not just a frequent issue

[-] [email protected] 5 points 5 months ago

The definition of insanity is doing the same thing over and over and expecting different results.

[-] [email protected] 4 points 5 months ago

"Works in my environment."

[-] [email protected] 4 points 5 months ago

Got to make sure it's not one of those phantom failures.

[-] [email protected] 4 points 5 months ago

My way: wrap it in a shell script and put a condition if exit status is not 0 then say "try clear the cache and run it again"

load more comments (1 replies)
load more comments
view more: next ›
this post was submitted on 24 Jan 2024
991 points (98.2% liked)

Programmer Humor

18292 readers
1464 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS