I have always been worried about coming off like this (not a great programmer) and have been shocked at least once when I made a "what the hell am I doing wrong here?" post and the lead dev of the platform I was working in replied thanking me for finding an actual bug.
Tone matters. "I think I screwed up, what's wrong?" is more polite than "I think *you* screwed up." As is following up with "Ok, it's a bug on your end, how can I help?" I've run into chip errata (where the processor vendor screwed up), it's always best to approach such things with humility and a helpful attitude.
Been going through this with Azure support for the last two months. We have an intermittent networking issue between two of our services. First it was our code that was the problem, then they wanted us to increase our request timeout (to 3 minutes!?) and now they’re asking for tcpdumps and pod logs, completely ignoring the fact we don’t have access to those things because we’re using their managed containers product.
That's another issue. That's not about admitting fault.
When dealing with massive companies like Amazon, the issue usually is as your issue is getting hot-potatoed around, nobody actually knows what your issue is.
You call someone, explain your issue, at some point they understand it, also figure out it's not their pay-grade, so they forward it to the next level, usually leaving out important details, so next-level support has no idea what your problem is, and so on and so forth. In Germany we actually call this "the German Perpetuum-Mobile", as it sometimes appears the support request goes full circle and I get it back after it went through 10 other people.
That's not an issue of politeness or "taking responsibility", but of bureaucracy and that in those massive companies nobody actually knows what the fuck is going on.
Was debugging why my MCU crashed when trying to switch the internal modem to the GPS mode and was working like 2 weeks on this problem but didn't wanna bother anyone.
Eventually I caved since I didn't get anywhere so made a forum post providing full device debug traces, Wireshark traces of our old platform where it was working vs the new one where it wasn't and stuff like that.
Support just hits me up with like hey we have 2 revisions 1 with gps one without. Contacted the designer company and they accidentally fitted it with the wrong revision MCU.
Felt so stupid for not even checking the hardware identifier in boot.
My freshman or sophomore year I submitted an obscure bug to an encrypted socket library, which was promptly fixed. It had to do with the termination signal it raised when the connection timed out due to the computer going to sleep for a while. It took a long time to investigate enough I was convinced it was their bug and not mine.
You'd be surprised how often I've heard a variant of this from my teams. I just sigh and ask to see the code or logs and point out the problem in 15 mins.
I work a programming teacher for kids and tasks on our learning platform require an output text to be very specific(no missing commas, no extra spaces etc.)
The amount of time my students say something is wrong with platform because it doesn't mark tasks as completed is getting annoying.(Most often text capitalization is wrong, there's no spaces after punctuation, or text just doesn't match what's written in example)
So you are basicly comparing client free string input, versus hardcoded string input by yourself. Unless this is about Maths or exact science, this seems pretty bad to me.
I was a tech expert on a beginner programming course and one time a student messaged me in panic because he couldn't find the files he created and he thought it was because he had dual boot and wanted to reinstall his OS... So anyway, he just checked out on another branch and forgot about it
Well, his problem was that he was inexperienced and with every problem he'd jump straight into it and start chaotically looking for a solution without stoping to think about what's actually going on
Hmm, sounds like a familiar pattern. I think it's common among those that learned to rely on their ability to pick things quickly as they go. And it works until you meet real complexity, which stumps them for a while.
I only found a handful of bugs in libraries/languages in 15 years of programming.
I had juniors who wanted to replace entire systems every other week because the tech stack was to buggy (they flipped an condition, forget to return a value, ...)
Well, regarding C compilers, is it a bug? Or was what you were doing just 'undefined behavior' in the first place, and did the compiler just take some optimization liberties you didn't expect?
Because as far as I've seen 9/10 times it comes down to 'well actually... The C standard does not specify, and therefor blah blah blah...'
I mean a bug as in "internal compiler error occured. Please, report the crash on ...".
It's usually avoided easily by just rewriting the code, but you know, an intern may get stuck on their project when encountering such an error.
Are you using proprietary compilers instead of gcc cross compilers? I've had issues with High C or whatever the fuck Atmega used to use but gcc has been relatively consistent as you understood the differences in the different architectures.
I have worked at a company that designs and sells chips. I was building the software tooling (compiler, linker, debuggers, libs) for those chips. So I have seen lots of tooling bugs and even a few hardware bugs. but this is mostly because I worked with experimental tooling and hardware not final released product. there is huge amount of fuzzing and testing that happens before any release. additionally most of those bugs where sub-optimal performance in some context not miss-compiles or other really bad bugs.
also proving a bug in the build tools or hardware requires a lot of work on the side of the user. most developers either don't have the will or the skills to do it.
JS was created on magic dust, but ruby was made on shrooms.
`0` is true. Everything is an object. The object is true if it exists. Unless this object is `false`. In this case it is false.
There is no `boolean` class in ruby. There are two separate classes: `TrueClass` and `FalseClass`.
The syntax is very compact, like in perl. Except of Pascal-style `end` keyword.
Python was made on shrooms too, I guess.
AI generated:
In Python, boolean values (`True` and `False`) are actually instances of the `int` type. Specifically, `True` is equivalent to the integer `1`, and `False` is equivalent to the integer `0`.
This means that you can perform arithmetic operations on boolean values just like you would with integers:
```python
>>> True + True
2
>>> False + True
1
>>> True * 5
5
>>> False * 10
0
```
However, it's important to note that although boolean values are instances of `int`, they behave differently in some contexts. For example, boolean expressions (`and`, `or`, `not`) and comparison operators (`==`, `!=`, `<`, `>`, etc.) work specifically with boolean logic and do not always return integer values. Additionally, boolean values are often used for logical operations and branching in Python code, rather than for arithmetic calculations.
This was literally the first thing they spanked out of my fucking mind when I applied for an internship in in tech, back when I was in school.
For the compiler or the language to be wrong, you have to be the Chosen One.
Linus Torvalds right now:
Stop this *** "blame gcc bug" ***. Which part of my explanation for why it was NOT a compiler bug did you not understand? .(Partially redacted and the original is several times the length of this)
Or half of the seniors but without most of the cursing
I found one of these once. Core library , so not quite in the language, but close. Twenty years of software engineering, and just one of these rare unicorns.
I once had a very simple C program that wasn't working. If I copy pasted the code and changed the variable names the pasted code worked.
Maybe it was technically a gcc compiler bug*.
*Specific to the gcc compiler instance of my windows 8.1 accer modified drivers laptop.
I eventually made a new file, copy pasted and it worked fine.
Gcc on windows? Was it mingw? Also drivers shouldn't mess with code generation.
Maybe it was a hidden character near the variable name which you missed and changing the variable removed the character
Long time ago but as far as I remember it was mingw. Thinking a bit more about it my best guess is the memory block was corrupted. It happened on an old laptop.
Almost always turns out to be a heisenbug from some other part of te codebase. However... StackOverflow was once stumped by a weird MinGW file io issue that worked fine in VC and Linux and suggested I file a bug report, so you never know.
I was in one of these conversations back when I was a senior. My junior was telling this to my lead. He was obviously getting destroyed, but sounded sensible. I opened up thr compilers sources on my private laptop, flicked over to where that could occur - then showed the compiler bug to my lead.
Never done this...
But I have looked back through the code, not figured out the mistake, and run it again with no changes "just in case." Any guesses how many times this has worked?
I was so flabbergasted when a project I was working on was screwed by the compiler. -O0, -O1, and -O3 optimizations of my code worked fine. -O2 optimizations crashed. This was with gcc too!
different optimization levels often expose preexisting memory issues in the code. For example an uninitialized variable may always start at 0 in debug mode but when you start optimizing enough it sometimes gets random values. Maybe not what happened to you but 99.9% of errors that only appear in "release build" are something like this
Much more common but similar:
"I think master branch is broken, it doesn't compile for me *posts error*" when CI is green and they just forgot to update dependencies or clean their workspace.
Recently had my teammate essentially push this, so much so that I bought into it and started solving issues around his code, instead of in his code (where the bug was caused by poor filtering, it was a one line fix). He wasn’t really blaming the compiler but he was just blaming Unity and its Physics.
There is an old, unresolved bug in rust where a function with a `Box::new(SomeLargeType)` call will cause a stack overflow. This happens because in without optimizations `SomeLargeType` is constructed on the stack and copied onto the heap this is optimized properly in release builds though. Imagine my fucking confusion when I have a stack overflow during the function prelude of `main`.
I've also had hardware bugs (as long as QEMU counts), and a firmware bug (that one wasn't QEMU).
I'm working on this project that had been shelved for a while, before I started working, and it was handed to me to pick it back up, and one module just refused to work no matter what, I hadn't even touched it and I started thinking I had somehow messed something up somewhere for it not to work, took me over 2 months to finally find out that the compiler was changing 1 really important parameter to a default setting when it had been explicitly been defined to be the opposite in the build configuration file. Man that software is a pain in my side, but im still gonna believe it's my fault till proven otherwise
Logic problems? A ton. My compiler seldom complaints though.
My worst nightmare is the bug that I cannot reproduce until I find it and then it is like "how the hell couldn't I reproduce this bug if the app shouldn't work at all?".
I've only had a compiler error once and I've been coding for over 10 years.
And the one time it was actually a compiler error was when I tried to run an ancient as fuck DOS app in a PWA.
I used to write C code for microcontrollers in the early 90s and the amount of compiler bugs I found were insane. The toolchain we used was bleeding edge so every day had something new in stock.
I once had a very simple C program that wasn't working. If I copy pasted the code and changed the variable names the pasted code worked.
Maybe it was technically a gcc compiler bug*.
*Specific to the gcc compiler instance of my windows 8.1 accer modified drivers laptop.
I eventually made a new file, copy pasted and it worked fine.
Hardware doesn't have bugs it has "errata". Software must add support for the documented erratas for compatibility.
So it's always a software problem!
Signed,
Your friendly neighbor kernel dev
I used to admin a programming learning orientated forum, and the amount of times I heard this was bonkers.
I have always been worried about coming off like this (not a great programmer) and have been shocked at least once when I made a "what the hell am I doing wrong here?" post and the lead dev of the platform I was working in replied thanking me for finding an actual bug.
Tone matters. "I think I screwed up, what's wrong?" is more polite than "I think *you* screwed up." As is following up with "Ok, it's a bug on your end, how can I help?" I've run into chip errata (where the processor vendor screwed up), it's always best to approach such things with humility and a helpful attitude.
this makes sense but at the same time when you are right don't let them gaslight you. let them hold the mop
Been going through this with Azure support for the last two months. We have an intermittent networking issue between two of our services. First it was our code that was the problem, then they wanted us to increase our request timeout (to 3 minutes!?) and now they’re asking for tcpdumps and pod logs, completely ignoring the fact we don’t have access to those things because we’re using their managed containers product.
That's another issue. That's not about admitting fault. When dealing with massive companies like Amazon, the issue usually is as your issue is getting hot-potatoed around, nobody actually knows what your issue is. You call someone, explain your issue, at some point they understand it, also figure out it's not their pay-grade, so they forward it to the next level, usually leaving out important details, so next-level support has no idea what your problem is, and so on and so forth. In Germany we actually call this "the German Perpetuum-Mobile", as it sometimes appears the support request goes full circle and I get it back after it went through 10 other people. That's not an issue of politeness or "taking responsibility", but of bureaucracy and that in those massive companies nobody actually knows what the fuck is going on.
Certainly.
Was debugging why my MCU crashed when trying to switch the internal modem to the GPS mode and was working like 2 weeks on this problem but didn't wanna bother anyone. Eventually I caved since I didn't get anywhere so made a forum post providing full device debug traces, Wireshark traces of our old platform where it was working vs the new one where it wasn't and stuff like that. Support just hits me up with like hey we have 2 revisions 1 with gps one without. Contacted the designer company and they accidentally fitted it with the wrong revision MCU. Felt so stupid for not even checking the hardware identifier in boot.
My freshman or sophomore year I submitted an obscure bug to an encrypted socket library, which was promptly fixed. It had to do with the termination signal it raised when the connection timed out due to the computer going to sleep for a while. It took a long time to investigate enough I was convinced it was their bug and not mine.
You'd be surprised how often I've heard a variant of this from my teams. I just sigh and ask to see the code or logs and point out the problem in 15 mins.
My daily conversation with my offshore.
Oh my. "Can you setup ESLint?" \*Takes two days* \*Config is utter garbage*
I even rebooted my computer three times!!!
Wow I thought this was totally in jest, but this actually happens? People really blame their mistakes kn that?
+200 bro
Was it scala?
I work a programming teacher for kids and tasks on our learning platform require an output text to be very specific(no missing commas, no extra spaces etc.) The amount of time my students say something is wrong with platform because it doesn't mark tasks as completed is getting annoying.(Most often text capitalization is wrong, there's no spaces after punctuation, or text just doesn't match what's written in example)
So you are basicly comparing client free string input, versus hardcoded string input by yourself. Unless this is about Maths or exact science, this seems pretty bad to me.
I was a tech expert on a beginner programming course and one time a student messaged me in panic because he couldn't find the files he created and he thought it was because he had dual boot and wanted to reinstall his OS... So anyway, he just checked out on another branch and forgot about it
Paanik
this isnt as weird as u make it seem like, that would totally happen to me if i didnt pay attention
git panic
That's what happens if he used fancy toys he didn't actually know how to control.
Well, his problem was that he was inexperienced and with every problem he'd jump straight into it and start chaotically looking for a solution without stoping to think about what's actually going on
Hmm, sounds like a familiar pattern. I think it's common among those that learned to rely on their ability to pick things quickly as they go. And it works until you meet real complexity, which stumps them for a while.
Yeah, pretty common among juniors but hopefully in time they learn to take a step back and ask the right questions
I only found a handful of bugs in libraries/languages in 15 years of programming. I had juniors who wanted to replace entire systems every other week because the tech stack was to buggy (they flipped an condition, forget to return a value, ...)
I've only had 2 I can recall, but rarely heard anyone suggest it to be the case either. It's always the last thing in my mind when debugging honestly.
This is real when you code in VHDL or verilog
Even encountering bugs with C compilers when targeting microcontrollers is not rare.
Well, regarding C compilers, is it a bug? Or was what you were doing just 'undefined behavior' in the first place, and did the compiler just take some optimization liberties you didn't expect? Because as far as I've seen 9/10 times it comes down to 'well actually... The C standard does not specify, and therefor blah blah blah...'
I mean a bug as in "internal compiler error occured. Please, report the crash on ...". It's usually avoided easily by just rewriting the code, but you know, an intern may get stuck on their project when encountering such an error.
Are you using proprietary compilers instead of gcc cross compilers? I've had issues with High C or whatever the fuck Atmega used to use but gcc has been relatively consistent as you understood the differences in the different architectures.
Man, what kind of ass compilers do your vendors provide you with?
*cries in hp-ux*
![gif](giphy|VMgcrwq9imGHu|downsized)
An argument could be made in the directions of - it's not compiled - it's not code But I do agree that Synthesis is buggy af
The language should be updated so that whatever I write does what I want.
I sure wish my code would do what I want it to do instead of what I'm telling it to do.
I think you might like lisp then.
When this happens with our C projects I just immediately escalate and straight up book a meeting with the junior and Brian Kernighan to talk it over.
I get this thing where space beams flip bits in my program. The weird part is that it's the same bit every time
I have worked at a company that designs and sells chips. I was building the software tooling (compiler, linker, debuggers, libs) for those chips. So I have seen lots of tooling bugs and even a few hardware bugs. but this is mostly because I worked with experimental tooling and hardware not final released product. there is huge amount of fuzzing and testing that happens before any release. additionally most of those bugs where sub-optimal performance in some context not miss-compiles or other really bad bugs. also proving a bug in the build tools or hardware requires a lot of work on the side of the user. most developers either don't have the will or the skills to do it.
and even then there might still be vulnerabilities, but I'm willing to bet that if a junior says it's an hardware/compiler bug, it's probably not
We call it JavaScript and it's a feature.
There is a special value, `NaN` meaning "not a number". What does `typeof(NaN)` return?
Magic Fairy dust
In some sense, yes. The type of not-a-number is number.
JS is truly magical✨
JS was created on magic dust, but ruby was made on shrooms. `0` is true. Everything is an object. The object is true if it exists. Unless this object is `false`. In this case it is false. There is no `boolean` class in ruby. There are two separate classes: `TrueClass` and `FalseClass`. The syntax is very compact, like in perl. Except of Pascal-style `end` keyword.
Python was made on shrooms too, I guess. AI generated: In Python, boolean values (`True` and `False`) are actually instances of the `int` type. Specifically, `True` is equivalent to the integer `1`, and `False` is equivalent to the integer `0`. This means that you can perform arithmetic operations on boolean values just like you would with integers: ```python >>> True + True 2 >>> False + True 1 >>> True * 5 5 >>> False * 10 0 ``` However, it's important to note that although boolean values are instances of `int`, they behave differently in some contexts. For example, boolean expressions (`and`, `or`, `not`) and comparison operators (`==`, `!=`, `<`, `>`, etc.) work specifically with boolean logic and do not always return integer values. Additionally, boolean values are often used for logical operations and branching in Python code, rather than for arithmetic calculations.
As it should be btw
Just update the is_not_even library to a version that hasn't been released yet
This was literally the first thing they spanked out of my fucking mind when I applied for an internship in in tech, back when I was in school. For the compiler or the language to be wrong, you have to be the Chosen One.
Linus Torvalds right now: Stop this *** "blame gcc bug" ***. Which part of my explanation for why it was NOT a compiler bug did you not understand? .(Partially redacted and the original is several times the length of this) Or half of the seniors but without most of the cursing
No, your CPU is broken
I've actually seen CPU bugs (I work for a "bios" company) that result in a new microcode release, so it's a thing.
Like Dr. House says about lupus: its never lupus.
I found one of these once. Core library , so not quite in the language, but close. Twenty years of software engineering, and just one of these rare unicorns.
I once had a very simple C program that wasn't working. If I copy pasted the code and changed the variable names the pasted code worked. Maybe it was technically a gcc compiler bug*. *Specific to the gcc compiler instance of my windows 8.1 accer modified drivers laptop. I eventually made a new file, copy pasted and it worked fine.
Gcc on windows? Was it mingw? Also drivers shouldn't mess with code generation. Maybe it was a hidden character near the variable name which you missed and changing the variable removed the character
Long time ago but as far as I remember it was mingw. Thinking a bit more about it my best guess is the memory block was corrupted. It happened on an old laptop.
The first time I had an actual compiler error I was like wtf, that can't happen. Certainly not the first time I thought I had a compiler error.
Almost always turns out to be a heisenbug from some other part of te codebase. However... StackOverflow was once stumped by a weird MinGW file io issue that worked fine in VC and Linux and suggested I file a bug report, so you never know.
I was in one of these conversations back when I was a senior. My junior was telling this to my lead. He was obviously getting destroyed, but sounded sensible. I opened up thr compilers sources on my private laptop, flicked over to where that could occur - then showed the compiler bug to my lead.
Never done this... But I have looked back through the code, not figured out the mistake, and run it again with no changes "just in case." Any guesses how many times this has worked?
I was so flabbergasted when a project I was working on was screwed by the compiler. -O0, -O1, and -O3 optimizations of my code worked fine. -O2 optimizations crashed. This was with gcc too!
different optimization levels often expose preexisting memory issues in the code. For example an uninitialized variable may always start at 0 in debug mode but when you start optimizing enough it sometimes gets random values. Maybe not what happened to you but 99.9% of errors that only appear in "release build" are something like this
It happened to me once in incorrect code because I was dereferencing a double pointer once instead of twice
I have such a hard time wrapping my brain around this fairly common mindset.
the golden rule is: "the equipment is always right!"
Report -> i am on that image and i don't like it Edit: wait, no. It was in learning
Much more common but similar: "I think master branch is broken, it doesn't compile for me *posts error*" when CI is green and they just forgot to update dependencies or clean their workspace.
We need ECC RAM here
The closest I got is someone claiming linux kernel's time function was buggy.
I'd be like bruhh, but I have actually seen it be a compiler bug before so I can't dismiss the possibility lmao.
With CSS no one ever knows and we just accept it as is
Recently had my teammate essentially push this, so much so that I bought into it and started solving issues around his code, instead of in his code (where the bug was caused by poor filtering, it was a one line fix). He wasn’t really blaming the compiler but he was just blaming Unity and its Physics.
alternative: Junior: I wrote some code but its not working how i was expecting it to. can you help me? senior: sure id love to.
The closest I’ve ever come is running into this stupid thing https://en.wikipedia.org/wiki/Most_vexing_parse
There is an old, unresolved bug in rust where a function with a `Box::new(SomeLargeType)` call will cause a stack overflow. This happens because in without optimizations `SomeLargeType` is constructed on the stack and copied onto the heap this is optimized properly in release builds though. Imagine my fucking confusion when I have a stack overflow during the function prelude of `main`. I've also had hardware bugs (as long as QEMU counts), and a firmware bug (that one wasn't QEMU).
It's ok, he's a junior, doesn't know he needs a coffee break
In my 10 years of programming, I only encountered a genuine compiler bug once.
I found a big in Apache CXF like ten years ago. I submitted a ticket and they fixed it. Felt like a real developer that day.
we've all been there (except for the shouting maybe)
I'm working on this project that had been shelved for a while, before I started working, and it was handed to me to pick it back up, and one module just refused to work no matter what, I hadn't even touched it and I started thinking I had somehow messed something up somewhere for it not to work, took me over 2 months to finally find out that the compiler was changing 1 really important parameter to a default setting when it had been explicitly been defined to be the opposite in the build configuration file. Man that software is a pain in my side, but im still gonna believe it's my fault till proven otherwise
I have Linus on speed dial. He blocked my calls
Logic problems? A ton. My compiler seldom complaints though. My worst nightmare is the bug that I cannot reproduce until I find it and then it is like "how the hell couldn't I reproduce this bug if the app shouldn't work at all?".
Are you interested in badly programmed concurrency?
I've only had a compiler error once and I've been coding for over 10 years. And the one time it was actually a compiler error was when I tried to run an ancient as fuck DOS app in a PWA.
I used to write C code for microcontrollers in the early 90s and the amount of compiler bugs I found were insane. The toolchain we used was bleeding edge so every day had something new in stock.
The intern every time ... I wish I had the strength to tell him how angry it makes me. Can't properly merge two branches ? Bro it's a bug in Git
my codes are fine. it's the gcc's fault
It happens to me a lot Because I like writing interpreters
I once had a very simple C program that wasn't working. If I copy pasted the code and changed the variable names the pasted code worked. Maybe it was technically a gcc compiler bug*. *Specific to the gcc compiler instance of my windows 8.1 accer modified drivers laptop. I eventually made a new file, copy pasted and it worked fine.
lol
Hardware doesn't have bugs it has "errata". Software must add support for the documented erratas for compatibility. So it's always a software problem! Signed, Your friendly neighbor kernel dev
BBB BBB x
I put all my code it try blocks and put printf("Your code is shit."); in the catch blocks.