A while back I was developing a workflow scheduler. However the run duration kept coming back negative. The runs kept finishing like 15 seconds before they started. Eventually I figured out why; the company had configured a policy to use their custom NTP server, but it was 16.7 seconds off. So my Windows laptop’s time was in the future, but the WSL VM (which ran the program) used another NTP server and was correct. In the end I just added a bodge that made the program request the time from an external server on startup to calculate an offset.
I’ve told this story before but we were supporting a custom ATS for a customer where we had this perfect storm happen.
- We had a bug in it that we sorted out eventually, where sometimes when you fed it input that contained weird characters, it would cause the name of a function or variable to get echoed in the nearby output. So if you had a variable called $debug_page or a function called $send_to_processing, and you input say some Arabic characters (this customer had many job applicants who were native Arabic speakers) you might get output that was the output you wanted + that string so
Searching... 10 applicants found debug_pageorApplicant: Mohammad Al-Saud send_to_processing.- We had this developer who named things in lolcat speak. So a function might be called $ICanHaz($applicant) or $LongStringIsLong($string).
So we got an email from the customer saying they had a VERY offended job applicant and what had happened. They had clicked the reject button on someone, which triggered the system to send an automatic rejection form letter to the applicant. This applicant had some Arabic character in their last name, which triggered the bug.
And the reject applicant function had been written by this guy. So that poor applicant got an email that said
Dear Applicant
We have reviewed your application and while we thought you have an excellent background unfortunately we decided you are not a good fit for our company at this time… blah blah blah etc…
YouCanHazNoJobKThanksBai
I can’t imagine anyone over the age of 25 using lolcat naming conventions
He wasn’t over 25.
Not a month goes by that I don’t regret introducing my wider analytics team to RegEx.
I had a system that would fail if you ran it on leap days.
It was used to calibrate equipment, and would generate a calibration certificate after the procedure was completed. One field in the certificate was “calibration due date”, which the program calculated by taking the current date and adding 1 to the year.
Whoever wrote the program had enough foresight to use a datetime library that recognized “Feb 29, 2021” was not a valid date, but not enough foresight to use that library’s date math functions to add 365 days.
The official solution was “just hold off on calibrations until tomorrow and we’ll fix that in the 2.0 calibration machine we’re working on.” The 2.0 machine was already years behind schedule, and I’m not sure it ever got completed after I left that company. I bet the bug still existed on Feb 29, 2024.
On a related note: Falsehoods programmers belive about time
https://gist.github.com/timvisee/fcda9bbdff88d45cc9061606b4b923ca
Twas an uuid collision.
Happens a lot in my line of work due to artists copy and pasting what they shouldn’t. Always fun how the related bugs manifest.
I lost so many braincells debugging silly shit, that i can’t remember anything about it.
ikr? I was racking my brain for a silly one, because I know I spent hours debugging something ridiculous lately. I think earlier this week? A rookie bug of my own doing, like using the wrong data source in the first step? Or maybe it was a 0 vs. 1 index error? Or was it forgetting to hit save on one of the config files, then wondering why the change wasn’t propagating?
So, so many stupid, basic errors. They all blur together.
Probably the silliest thing was discovering the hard way that x.5 doesn’t always round up in Python’s round(). Python uses “round to even” so that 1.5 rounds to 2 and 2.5 also rounds to 2.
Ah. Mathematical rounding
A [shutter] Coldfusion web application regularly polled an industrial temperature probe for walk-in refrigeration/freezers in warehouses around the world over HTTP. Following an upgrade (CF9 to 10 I think) the temperature calls stopped working.
Using Wireshark I discovered the probes we’re not sending 200 OK, just raw HTML the moment you connected to the port.
I wrote a quick workaround wrapper in python that turned into a permanent solution until those probes we’re replaced.
Back in the unit 5 days, I remember a weird touch bug on my input controller. Only my wife was able to trigger it and after some testing, it turned out unity wasn’t pulling the screen fast enough to register when her finger left the screen and when it touched it again. I made a fix for it and kept it in since.
i was just a user, but i debugged a weird issue where one of those blue light reduction programs would start flickering and inverting day and night time during june.
turns out the dev had made the assumption that the sun always rises before it sets, and i was far enough north that the sun would start setting after midnight.
Watching this makes me want to dump all timezones, and daylight savings in the wood chipper.
Everyone should set their clocks to UTC.
Such a classic.
haha, knew what this was going to be. Already came close to posting it a couple of other times in this thread. :)
Ooh, interesting one! 😄
Internet Explorer didn’t automatically have “console.log” defined until you opened the console window. So there was an error breaking the web page that would disappear when you tried to open the console to see the error. The error was that console.log wasn’t defined. Fucking IE.
Saw this way too many times. Eventually the first thing to check whenever a customer was having weird issues would be to check, if someone had accidentally left debugging comments in prod code…
/thread, holy shit lmao
That would genuinely make me clock the fuck out for the day when I figured it out, jesus christ.
I found an issue in a software used by government employees.
A request would fail if the server and the client had different years in their system time which could happen if they were located in different time zones.
After a few calculations I asked: “Hey, what are the chances a government employee would do this important task between 6pm and midnight on December 31st?”
We decided not to prioritize the issue.You realise that’s going to end up in the launch process for a nuke somehow.
“Hey, what are the chances a government employee would do this important task between 6pm and midnight on December 31st?”
I guess “this important task” could refer to firing a nuke, which to be fair is unlikely to happen at that moment in time (or any for that matter)
Govt bureaucracy. It could be scheduling a janitor and still somehow end up in the checklist.
I’ve been a dev for years and had my fair share of sillyness… can’t recall which was the most silly, but one very recent one was trying to debug a weird error. So I opened the VS solution did a search for the string that spat out the error. Found it in a catch clause and stabbed that function with breakpoints, and went off to test.
Hours later (too many to confess) after trying everything, I found out why I couldn’t get it to stop on the breakpoint. I had opened the wrong project, for the wrong app :O
It was an unlucky coincidence that it had the same literal error trace in code!
i was trying to figure out why ssh wasnt working only to realize I was using the wrong username. That took about 2 hours of time to realize as I was bashing my head at the wall while looking at the pubkey signature being the same on both machines.
two days for an
=instead of an==“Yoda conditionals” are a must in languages where bindings/references are mutable by default. E.g.: “if (0 == size)” or “if (0x4269 == magic)”. If you write ‘=’ instead of ‘==’ you get a compiler error, so always put the constant first.
Hope you never have to use a language that lets you redefine numbers.
Wasn’t there a Python version where True and False were mutable by accident?
I tend to use languages where immutability is the default these days like Haskell, Idris, or Purescript. But, even when using Java and Javascript, I tossed around a lot more final / const than my peers. :)
Redefining the number 2 in Python
The biggest const-by-default lang is probably Rust now isn’t it?
Maybe? I don’t really keep up with lang popularity. Got through the Rust tutorial and did one project with it, but I honestly was missing HKTs and (mostly) isolating effects based on type signature. Of course, Rust may have grown those features since then, it was last decade when I played with it.
I once spent several hours debugging a performance issue in the Linux builds of a project. The service worked fine on Windows but couldn’t keep up with the traffic when deployed on Linux. Interestingly, CPU load was actually higher on Windows, and no sampling profiler showed any suspicious hot spots.
It turned out the problem was in the program’s main loop, which was OS-specific and called something like
sleep(float seconds)(yes, I know…). The parameter was set to1e-3on Windows and10e-3on Linux. I stared at that line several times before I noticed the difference.
Another time, all services of a distributed system were regularly reporting a loss of communication at 4 AM. The servers were supposed to receive data continuously, so even a few seconds of silence was enough to raise an alert.
Half of the team investigated all kinds of possible locking scenarios (the applications were multi-threaded). Then we noticed that all the logs in the system (including the kernel’s) had the same gap in timestamps.
Then someone remembered, that the customer had a cron job which did some maintenance at night. They confirmed that it halted the entire VM with all services for about 5 seconds.
This was on a Fortran project that had no encapsulation and way too many global variables.
Suddenly, one particular calculation was failing, and not in a floating point rounding error kind of way. After setting up several scenarios to generate various input values, I determined that Fortran’s absolute value function was returning the wrong results.
I couldn’t understand why, so I went to the Lead Architect. He poked at it for about four minutes and did some searches, and found where someone else had defined a global variable named ABS that was masking the built-in abs function. The function call argument [e.g. abs(3)] was being compiled as an array index on this ABS variable [which was not an array, so yay, undefined behaviour].









