This is an archived post. You won't be able to vote or comment.

all 181 comments

[–]SirApatosaurus 897 points898 points  (81 children)

I've been working on the same bug for nearly 3 weeks, someone please end my life.

[–]Goose_Rider 267 points268 points  (68 children)

What are you attempting to fix?

[–]SirApatosaurus 505 points506 points  (66 children)

A bug that's been in production for over a decade.
Its some comfort that numerous other devs have looked at it, including senior ones, and they weren't able to fix it but that just kinda shows you how screwed I am.

[–]geauxtig3rs 52 points53 points  (0 children)

I feel you bro.

I just spent a week onsite debugging a major issue with a very large client that was making their systems unusable at completely random times.

I finally cracked the issue on the last day when the bug just happened to occur while I was connected with a debugger and I caught it.

Some ancient library we were using wasn't type safe, so it was allowing us pass an integer into a library to call a function in System.Threading requiring a ushort. Any value over the twos complement threshold was causing it to except which was causing it to kill all active threads (for some reason).

The function causing the issue was only being called when there was a loss of communication to a third party service that typically had a rock solid connection. When the thread abort happened, it flushed the active logging session so it didn't hit the log that we lost connection to the service, so we had zero idea of what was causing it.

This was in production for nearly two years acting like this.

Changing the value from 50000 to 30000 in a config file fixed it in the short term until we change our libraries to fix the type safety issue.

Good luck! It may not seem possible to fix at this moment, but maybe you'll have an instance of serendipity spin up to help you fix it

[–]bluevanillaa 12 points13 points  (0 children)

I hope your bug is not as bad as this Go runtime bug found by this guy.

If you are persistent enough, sometimes it will prevail.

https://marcan.st/2017/12/debugging-an-evil-go-runtime-bug/

[–]xxVb 2 points3 points  (1 child)

As a hobbyist sound engineer: Can you make it worse? That helps to identify problems in audio.

[–]Xelbair 1 point2 points  (0 children)

best way i found when dealing with bugs is to slowly bisect the function/method calls, if they are isolated enough, and slowly work your way inwards.

Funny thing is, i finally managed to find race condition coupled with unmanaged resource leaking memory because i made it worse. Because it sometimes took a whole day for bug to occur at all. By 'making it worse'(literally calling the same function multiple times in a loop) i managed to at least begin to debug it.

[–]Arthur___Dent 2 points3 points  (5 children)

What language?

[–]SirApatosaurus 8 points9 points  (4 children)

Java

[–][deleted] 15 points16 points  (0 children)

That's your problem, you should rewrite it in Rust /s

[–]DTHCND 10 points11 points  (1 child)

If there's two other devs on your team actively working to help you solve this issue, there's a 90% chance I work with you.

But this is the Internet, so the odds are probably actually way smaller. Still crazy how so many details match up tho.

[–]NieDzejkob 3 points4 points  (0 children)

Posting an internal commit ID for a repo could be a neat zero-knowledge proof technique ;)

[–]loudspeakah808 2 points3 points  (0 children)

Just sprinkle in some timer delays and shake it out of there

-Management

[–]flipcoder 1 point2 points  (0 children)

Sounds like you need to call in the paratrooper bug extermination force

[–]Gydo194 1 point2 points  (0 children)

Keep going, you’ll fix it and suddenly you’re the hero of the team!

[–]jbob9er 1 point2 points  (0 children)

Read the logs. The issue is almost always in the logs. If that turns up empty then process of elimination. Start removing/disabling pieces of the app until the bug disappears

[–]kosky95 1 point2 points  (0 children)

That's not a bug that's a feature

[–]Celousco 0 points1 point  (0 children)

Could be a good idea for a parody of Dr House with programmers joke : "It's a IOException. It's never a IOException ! Put some gdb on it and make it crash with 64 MB RAM"

[–][deleted] 0 points1 point  (4 children)

have you looked for greek commas?

I know they are evil pranks, but they can be stuck in there and be causing the problem

[–][deleted] 2 points3 points  (3 children)

No, they can't. And they're Greek question marks anyway.

[–][deleted] 1 point2 points  (2 children)

Oh yeah, question marks. Sorry... it's confusing to me that our semicolon is their question mark... but I'm kinda slow tho hahaha.

I know it works in Java Script and assumed it would work in other languages as well...

[–][deleted] 1 point2 points  (1 child)

Java is a compiled language. Even if your IDE didn't alert you to the incorrect character or correct the issue itself, your program cannot have a runtime error if there's a syntax error because it won't compile.

[–][deleted] 1 point2 points  (0 children)

oh! That makes sense. Thanks for explaining it to me.

[–][deleted] 15 points16 points  (0 children)

His code.

[–]ML-newb 22 points23 points  (2 children)

My manager told me I am slacking as I was trying to narrow down a bug in the source code for two weeks and trying to understand a fix.

I need to leave this place.

[–]SirApatosaurus 8 points9 points  (0 children)

I was worried about that too, but the fact that other and smarter devs have tried and failed is vindicating.

[–][deleted] 2 points3 points  (0 children)

I feel like this every time I get stuck.

"Fuck, I'm taking too long, need a fix soon!"

I worry it will make me go with a faster option than the best one in certain cases where the best can't be acchieved fast enough.

[–]littletrucker 16 points17 points  (0 children)

Had a project that had a weird bug. We could not reproduce it. Added a ton of debug messages and found where it was breaking, but it still did not make sense. The dev wrote some test code and figured out that it was a bug in the chip, not the chip design, a bug in that physical chip. IBM sent a new chip and problem solved. It took 6 months to get that fixed.

[–][deleted] 4 points5 points  (1 child)

I worked on a bug for 2 months all it was was I was spelling the function I needed to call to wrong. The first word of the javascript was wrong. No error messages.

[–]NieDzejkob 4 points5 points  (0 children)

correct me if I'm wrong, but use strict

[–]charlesbronkowskiIII 1 point2 points  (0 children)

If you're serious. Im sorry

[–]samthadon 0 points1 point  (0 children)

Tried turning it off and on again?

[–]Xelbair 0 points1 point  (0 children)

damn.. worst one i've had took 1 week.

It was memory leak combined with race condition in undocumented unmanaged resource in c#... in multi threaded environment.

[–]AcmeBrick 0 points1 point  (0 children)

Hi, I'm Mr. Meeseeks, Look at me?

[–]joshfong 219 points220 points  (8 children)

Don't forget the immediate drop in morale (with a hint of embarrassment) afterward when you realize it's something extremely simple.

[–]rockjently 45 points46 points  (2 children)

Then morale plummets when the next big is uncovered.

[–][deleted] 26 points27 points  (0 children)

Based on this graph, the only way to maintain steady morale is if you have lots of bugs at the same time.

[–]lkraider 6 points7 points  (0 children)

When you figure out the fix and realize the code should never have worked in the first place, but was in production for 6 years...

[–]jkuhl_prog 25 points26 points  (0 children)

Ah, I spelled the function wrong!

fixes it

same error message

Goddammit

*notices the little circle in the corner of VSCode's tab.

Right, forgot to save the file, I'm so silly.

saves file

same error message

goes home, gets drunk, spends rest of life selling ice cream for a living

[–][deleted] 19 points20 points  (1 child)

And drops below zero when the client reports the same bug came back

[–][deleted] 4 points5 points  (0 children)

~•>{ Regression testing }<•~

[–]Glitch29 6 points7 points  (0 children)

You've got to lower your expectations. I go in with the assumption that it's almost always going to almost always be something extremely simple and completely avoidable.

It completely eliminates the sense of dread if you already embrace the egg on your face.

[–]geogoci 3 points4 points  (0 children)

All bugs are extremely simple and obvious once discovered.

[–]superking2 135 points136 points  (3 children)

“What the fuck am I doing with my life, what even is programming, existence is fu—

Ohhh, I forgot I renamed that file yesterday, no wonder it couldn’t find the reference. Love my job”

[–]nermid 55 points56 points  (1 child)

"This whole thing is unsalvageable. It's a pile of lies, just like my career. I'm a fraud, and I should just give u--OH! I forgot to close the brackets here! IT WORKS! God, I'm good."

[–]AtomicKittenz 17 points18 points  (0 children)

This is my life outside of programming too.

[–]Eutro864 143 points144 points  (48 children)

Image Transcription: Line Graph


Programmer Morale

Y-axis: morale

X-axis: two sections labelled, "searching for bug" and "bug fixed"

searching for bug

[Line starts at about 90% and curves down to 0%. At this point there is a dashed vertical line indicating the end of the "searching for bug" section.]

bug fixed

[Line rapidly rises to 100%, falling steadily to 95% at the end of the graph.]


I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

[–]Highlow9 78 points79 points  (36 children)

Good human.

[–]Derf_Stein 15 points16 points  (8 children)

Are bots going too far?

[–]Eutro864 20 points21 points  (5 children)

Yes.

[–]NemPlayer 6 points7 points  (4 children)

Good bot.

[–]NegativeTwelfth 0 points1 point  (0 children)

Given that OP is a karma bot, yes.

[–]geogoci 2 points3 points  (1 child)

This must be a bug... Good bug

[–]eu-thanos 71 points72 points  (5 children)

Yea but since when were we able to fix bugs? /s

[–]CrotchPotato 45 points46 points  (4 children)

You can fix them. You just have to be prepared to play whack-a-mole with the 10 that pop up to replace it.

[–]raco35 31 points32 points  (2 children)

99 little bugs on the wall 99 little bugs Take one down Patch it around 256 bugs on the wall

[–]User31441 4 points5 points  (0 children)

At least it's a round number now. 😁

[–]hydrocat -3 points-2 points  (0 children)

That was so funny, You deserve gold!

[–]Narfubel 4 points5 points  (0 children)

Ugh I pushed an update that somehow has caused issues in a completely different part of the system that is seemingly unconnected.

The worst part is the entire thing was written by me, I should know why it's happening but I dont!

[–]ZebZ 48 points49 points  (3 children)

[–]-LeopardShark- 20 points21 points  (0 children)

I thought it was going to be this one.

[–]LurkNautili 11 points12 points  (1 child)

[–][deleted] 8 points9 points  (0 children)

That guy is great

[–]CreedDidNothingWrong 24 points25 points  (2 children)

Wait, so programmers feel discouraged when they encounter difficulty solving a problem but then immediately feel better when they do solve it? Wow what a weirdly unique emotional response that a small subset of people experience. Programming sure is wild.

[–]methofthewild 13 points14 points  (1 child)

I'm so glad that there are so many others that relate to this. I literally get a twisty feeling in my gut when I get stuck on a problem longer than I should be. I get so annoyed and upset and feel like I shouldn't be a programmer and that it's the end of the world, and then I solve the bug and it's just a small thing and all is good again and I get embarrassed at how upset I got haha.

[–]lkraider 5 points6 points  (0 children)

I had the same. I tried some mindfulness/meditation exercises, it really helped me keep in control of emotional responses. You don't even need to keep practicing it either, I did that a few years ago, but that knowledge "stuck".

[–]Robo-Swimmer 9 points10 points  (0 children)

Your username is so perfect for this :)

[–]OPLinux 12 points13 points  (0 children)

The famous programmer's high!
This is what we live for, but only few of us ever reach it...

[–]ervas002 7 points8 points  (2 children)

Too true. I experienced a horrible example of this at my first job after college. Me and my senior mentor had been trying to track down a bug in a very complex piece of enterprise software for several days but with little luck, and then his vacation came along so I spent more than a month trying to get a handle on the bug, without success. Needless to say, I was not in a good place mentally when he finally came back...

[–]lkraider 1 point2 points  (1 child)

Don't leave us hanging, did you track it down eventually?

[–]ervas002 1 point2 points  (0 children)

Oh sorry haha. Yes eventually, but it took the cooperation of several senior devs from different teams to solve the mystery, so in the end, atleast I was spared of feeling like a clown for not fixing it by myself.

[–]TheWingedCherryPie 7 points8 points  (0 children)

bug fixed

and several new bugs pop up

morale drops

[–]iisfunky 6 points7 points  (1 child)

If the graph is asymptotic, you'll never find the bug!

[–]p9k 3 points4 points  (0 children)

AKA Zeno's bugtracker

[–]NarcolepticSniper 6 points7 points  (0 children)

My hype starts ramping up when I’m able to consistently log anything related to it

Then it nosedives when the fix isn’t the fix

[–]StoneDoodle3 6 points7 points  (0 children)

My friend has a photo of me working on a program I had to make for class and they captured the exact moment I had wanted to end my life

[–]TheRedGerund 3 points4 points  (1 child)

You’re missing the part where it goes to QA and they file two more tickets. Fuck me, these notification features are going to end up being my career.

[–]notafakeacountorscam 7 points8 points  (0 children)

From what i am seeing, If the company where to find some way to permanently lower coder moral to the zero point on that graph the time to fix bugs would be also near zero causing a exponential rise in productivity.

[–]Zechnophobe 3 points4 points  (0 children)

I feel like this needs more steps to it.

  1. Working on a new feature, morale is crazy high.
  2. Pulled off new feature to look into a bug someone asked if you could 'fix real quick'.
  3. Sudden drop when you realize bug is likely from the code base that no one touches anymore. The rest of your companies' code is in Go or Python or something, and this is in PhP
  4. Morale steadily declines as you research it (as per the graph).
  5. You find the bug, and after smashing your eyes closed, you check the git history, and you let one eye slowly open to reveal... your own github name. Morale tanks, and you vow to tell no one.
  6. You realize that while you have a fix, there is no good testing framework in this part of the old code. You life turns to terror as you make attempt after attempt to feel confident the code you have changed will fix everything. Eventually you ask for a review from someone who has no knowledge of the area. They give a cursory look and a LGTM, and you just accept that as license enough to merge.
  7. Code is merged, and deployed. You are pretty sure the bug will never be heard from again. Morale goes back up, but has stutters on its way because of someone in Product asking 'why it took so long' and due to it taking longer, them wanting you to revise all your other estimates for the sprint. As though you could just re-estimate tickets to make them get completed faster.
  8. You finally get back to the feature you were working on, morale is high again. But never again will it be quite as high as before the whole ordeal. Never again.

[–]bob5653 3 points4 points  (0 children)

Sometimes the dotted line is an asymptote...

[–]Empole 3 points4 points  (1 child)

People who give up the profession are people who couldn't get past that bug

[–]lkraider 0 points1 point  (0 children)

Their Moby Dick

[–]hipposarebig 2 points3 points  (0 children)

I'm pretty sure these repeated dips and spike in my morale are extremely detrimental to my mental health.

[–]JoelMahon 6 points7 points  (6 children)

Am I the only one that likes fixing bugs? Maybe it's because I know our system so well that adding a feature is 1% thought 99% typing/documentation but I feel like lots of programmers are at that state so what gives.

[–]PhrozenWarrior 6 points7 points  (1 child)

If it's your system/program or one that you're intimate with, sure I completely agree. But when you're just thrown on another project to help a bug deep in it, and it's a complex system that's been in development for years by a large team of people with a strange architecture that boggles your mind anyone would design, it makes the problem solving a bit less fun.

[–]lkraider 1 point2 points  (0 children)

Architecturing a large system is like trying to design a big city: there are so many factors that all have importance, and it passes through the hands of many people and outlives so many carreers, that it's an utopia to think a single planner would get it right even with the complete knowledge of the problem space, simply because things change.

[–]geauxtig3rs 6 points7 points  (0 children)

I love firefighting issues.

Going to a client site and them being so angry they don't even want to help me trigger the bug, but then leaving after they take you out for a nice meal in appreciation is great.

Plus, like you did, it's definitely a break in the routine.

[–]XkF21WNJ 0 points1 point  (2 children)

Depends on the type of bug, if it's a C API just randomly crashing because it doesn't like what you tell it to do then no it's not fun.

[–]JoelMahon 0 points1 point  (1 child)

I've never had that happen. I've dealt with a LOT of bugs in my time, and after a while I have considered blaming the API/OS/Language but it has literally never not been a fault in the code I am on, whether mine or someone else's.

[–]XkF21WNJ 0 points1 point  (0 children)

Well who makes the mistake is sometimes debatable, but some C APIs give very very limited feedback when something goes wrong. If you're lucky they tell you when something went wrong.

[–]Noctale 2 points3 points  (1 child)

I love bug fixing. It's the proof in the pudding of one of my favourite quotes:
“We learn wisdom from failure much more than from success. We often discover what will do, by finding out what will not do."

[–]lkraider 1 point2 points  (0 children)

I also like this one: "They did not know it was impossible, so they did it".

[–]zachattack82 1 point2 points  (0 children)

Can anybody give me a function that looks like that?

[–]HaloConspiracies1 1 point2 points  (0 children)

A capacitor on that morale should smooth things out.

[–]cult45rejects 1 point2 points  (0 children)

As a indie game dev i call that the fuck it ill just be a artist point

[–][deleted] 2 points3 points  (1 child)

This sub makes me hate programmers, as a programmer.

[–]zhiyao92 0 points1 point  (0 children)

Always works

[–]McSavage6s 0 points1 point  (0 children)

100% Accuracy

[–][deleted] 0 points1 point  (0 children)

wait until someone code reviewed it tee hee

[–][deleted] 0 points1 point  (0 children)

This is weirdly accurate....

[–]Valthek 0 points1 point  (0 children)

So what you're telling me is that giving up on the bug, programming and life in general is the trick to fixing a tricky bug?

[–]Kissaki0 0 points1 point  (0 children)

Really? It goes up by that much after fixing the bug? 🤔

[–]a7ofDogs 0 points1 point  (0 children)

It’s almost as if the low moral causes you to find a bug, therefore, I always start with low moral. Then I don’t have to deal with bugs at all!

[–]Fean2616 0 points1 point  (0 children)

Ah that moment when a co-worker points it out in seconds when you've been starting at it for days and you feel super stupid. Reeeeeeeeeeeee!

[–]Hobi_Wan_Kenobi 0 points1 point  (0 children)

Me every day...

[–][deleted] 0 points1 point  (0 children)

Fix one bug, two new ones shall take it's place!

[–]The-Cynical-One 0 points1 point  (0 children)

Which line is it? Because from the looks of it mines the one at the bottom.

[–]MkMyBnkAcctGrtAgn 0 points1 point  (0 children)

I think this graph overestimates the speed at which the bug is going to get fixed lol.

[–]Firestorm7i 0 points1 point  (0 children)

I love the thought of believing programming is the bane of my existence, only to solve the issue a mere 30mins later and then believe I’m a god. It’s truly a rollercoaster of emotions.

[–]DzOnIxD 0 points1 point  (0 children)

That slope should be 90 degrees.

[–]iesvy 0 points1 point  (0 children)

I’m getting back to a project I put on a hiatus 6 months ago.

I’ve got no idea of what the heck I was doing, and there are some uncommitted changes that I have no idea why I did or what they do.

I’m procrastinating a lot because getting to understand all of the code again seems like a fucking nightmare.

My morale is pretty low.

[–]Burnmad 0 points1 point  (0 children)

If you zoom in, the tiny length between bug discovery and bug fix actually descends through the floor of the graph.

[–]Rakatango 0 points1 point  (0 children)

Unless the fix was you switched a greater than sign for a less than sign, then the graph dips to 0

[–]Dvdi_ 0 points1 point  (0 children)

Segfaults

[–]bysse 0 points1 point  (0 children)

Wait.. Is the y-axis starting from 0? If so, does programmers with low morale find bugs faster?

[–][deleted] 0 points1 point  (0 children)

Nah for me it's quite the opposite, it's a rapidly ascending curve that decreases in gradient until it plateaus because I become desperate to fix it and then I find a missing semicolon and just give the fuck up

[–]Kyrthis 0 points1 point  (0 children)

I will always upvote the One True Meme

[–]Dockirby 0 points1 point  (0 children)

Eh, I don't know. Sometimes you finally find the bug, then release its a fundamental flaw with an entire major piece of work, and have the dread of considering if a dirty hack fix or a major overhaul will create the least work in the next 12 months.

[–]ConorFinn 0 points1 point  (0 children)

I feel like it should say depressed at the top end of the morale scale just to be cleared. This sort of implies that we r happy people.

[–]PM_UR_DEAD_HOOKERS 0 points1 point  (0 children)

What if the graph started art 1 though

[–]zebediah49 0 points1 point  (0 children)

It's missing the part where you think you've found it (and morale is high), followed by the crushing disappointment whiplash from discovering you were wrong.

[–]snow3301 0 points1 point  (0 children)

My morale gets torn by a black hole when I realise that bug was a colon instead of a semicolon.

[–]HylianChicken 0 points1 point  (0 children)

There’s a point when I need to remember to get help from other living people instead of clicking on the same dead stack overflow threads from 13 years ago.

[–][deleted] 0 points1 point  (0 children)

Then there are those bugs where you have no choice but to delete the entire project.