849
you are viewing a single comment's thread
view the rest of the comments
[-] perviouslyiner@lemmy.world 240 points 7 months ago* (last edited 7 months ago)

define it as ( __LINE__ % 10) so that the problem goes away when you add a debug statement

[-] IphtashuFitz@lemmy.world 16 points 7 months ago

Decades ago I had to debug a random crash. It only happened on Wednesdays. On Wednesdays in September. On Wednesdays in September after the 10th…

[-] xia@links.hackliberty.org 5 points 7 months ago

I kinda want to hear more of this story... care to share the details? i.e. what was the root cause?

[-] IphtashuFitz@lemmy.world 17 points 7 months ago

It was pure c code that was used to print reports, and included the date in a header. Whoever wrote it miscalculated the size of the buffer for the header by one byte. When the date was the longest month & day spelled out plus a two digit day of the month then it would overflow the buffer, resulting in the program crashing.

[-] Fleamo@lemmy.world 6 points 7 months ago

That's very funny.

load more comments (2 replies)
load more comments (15 replies)
this post was submitted on 09 Feb 2024
849 points (97.5% liked)

Programmer Humor

19187 readers
1184 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