SkillsC, assembly, embedded, electronics
Joined devRant on 5/26/2018
Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
Interesting bug hunt!
Got called in because a co-team had a strange bug and couldn't make sense of it. After a compiler update, things had stopped working.
They had already hunted down the bug to something equivalent to the screenshot and put a breakpoint on the if-statement. The memory window showed the memory content, and it was indeed 42. However, the debugger would still jump over do_stuff(), both in single step and when setting a breakpoint on the function call. Very unusual, but the rest worked.
Looking closer, I noticed that the pointer's content was an odd number, but was supposed to be of type uint32_t *. So I dug out the controller's manual and looked up the instruction set what it would do with a 32 bit load from an unaligned address: the most braindead thing possible, it would just ignore the lowest two address bits. So the actual load happened from a different address, that's why the comparison failed.
I think the debugger fetched the memory content bytewise because that would work for any kind of data structure with only one code path, that's how it bypassed the alignment issue. Nice pitfall!
Investigating further why the pointer was off, it turned out that it pointed into an underlying array of type char. The offset into the array was correctly divisible by 4, but the beginning had no alignment, and a char array doesn't need one. I checked the mapfiles and indeed, the old compiler had put the array to a 4 byte boundary and the new one didn't.
Sure enough, after giving the array a 4 byte alignment directive, the code worked as intended.12
Code review, here the simplified version. What the fuck has to be wrong with someone who seriously codes the first variant in production code?!24
Fuck those useless calls!
PM: customer X wants a call in an hour.
Me: they didn't send emails before. No questions, no prep, no call.
PM: yeah but they want to talk.
Me: these unprepared calls are pointless. I'll be sitting there, noting down the questions and telling them I'll have to look up the details.
PM: shall I tell them that you don't want to talk to them?
Me: I don't care, it's your call, do whatever you want.
PM: that's not professional.
Me: oh you're calling it professional to sit there with a pencil, writing down crap or what?
PM: what's the problem?!
Me: I've had this shit for the last two fucking calls, and they were so unprepared that they wasted half of the call just reading up, and I'm fed up with this shit!
PM: but they are the customers, and they aren't that happy.
Me: yeah, and do you know why? Because our schedule is completely fucked up and our management has been ignoring ANY warning from engineering for WEEKS! That's why they are unhappy and not because I'm not holding their fucking hands!
PM: hey, but you can't tell me what I have to do!
Me: and you can't tell me either! [he's my PM, but technically not my superior.]
PM: so no call or what?
Me: you're free to have your call. I'll sort out the shit that they're concerned about, putting that down in a proper email, and then we have at least some basis for discussion!
PM: (left for his call)
Btw., my cursing was the same in the live conversation with him.9
Friday, I got a mail from my PM shortly before I wanted to leave. Basically it was, hey can you check out whether this issue [which I hadn't even heard about] is somehow related to our system? Meeting is in one hour.
My answer: I guess not, otherwise I'd have been in the loop much earlier than one hour before the meeting.
I shut down the PC like a boss and went into weekend.11
On an afternoon the day before delivery, we discovered a crashing bug. At around 2 AM, we had found the cause and fixed it. A short sleep at home, then back to office at 8 AM because the delivery was 200 devices containing that software, and they had to be updated manually because production had put in the old image.
We seized all available computers, even those from marketing who were... surprised. Half-way in the update, we calculated that we wouldn't have enough time until the freight service would show up.
So we asked the secretary that she should be a bit flirty to the parcel guy, invite him to a coffee and chat around to buy us more time. We closed the last parcel just when he figured that he had to continue with his tour.5
Not CS degree, but EE, and totally worth the effort. Not only that without degree, I wouldn't get jobs in many companies, but I actually learnt a lot. Laplace and Fourier will be as valid in a 100 years as they were 200 years ago.
Yeah, it was fucking hard. Math was rather OK, only 50% of the students failed the first exam. EE was harder, 90% failed at the first try. That wasn't regarded as problem - on the contrary, the exams were designed to weed out. After two semesters, we already had 50% student loss.
I remember what the EE prof told us in the first semester: we would learn a lot of things, but most importantly, to think like an engineer. Didn't make sense right away, but 5 years later, I knew what he had been talking about.3
Me at QA, talking about a nasty bug I found in legacy code.
QA: what was the root cause?
Me: pos code.
Me: piece o' shit.
Funniest meeting ever!
Some years ago, there was the regular department meeting where useless news from upper management were handed down. The team I was in was also there: team lead, co-worker and me. The team lead had a new girl and was daydreaming of their nights, my co-worker wasn't quite back from the football match on the weekend, and I was playing chess on my mobile.
Department lead was blah blah blah and when can we do this on your rig? We looked at each other and instantly realised that none had been paying attention.
My co-worker was the fastest to recover and straight-facedly turned to me: "Well Fast-Nop, that's your domain."
I picked the ball up before team lead could say something: "Sure, but schedule appointment is for our lead."
Our lead couldn't contradict us and then had to negotiate a schedule while trying to find out what it was about. *LOL*2
A server application pulled off some sort of listings as table. Problem was, it crashed with some thousand data files after one and a half hours. I looked into that, and couldn't stop WTFing.
A stupid server side script fetched the data in XML (WTF!) and then inserted shit node-wise (WTF!!), which was O(n^2) - in PHP and on XML! Then it converted the whole shebang into HTML for browser display although users would finally copy/paste the result into Excel anyway.
The original developer even had written a note on the application page that pulling the data "could take long". Yeah because it's so fucking STUPID that Clippy is an Einstein in comparison, that's why!
So I pulled the raw data via batch file without XML wrapping and wrote a little C program for merging the dumped stuff client-side in O(n), spitting out a final CSV for Excel import.
Instead of fucking the server for 1.5 hours and then crashing, shit is done after 7 seconds, out of which the actual data processing takes 40 bloody milliseconds!5
I'm doing code review. Unsure about the deadline, I ask my co-worker:
Me: "Guess I'm half through, when do I have to be done?"
Co-worker: "Well if you're half through, you are already half done."
Me: "No shit, Sherlock."
That moment when you have a score 115/100, 11/11 tests passed, grade A+ at https://observatory.mozilla.org/ .
That's better than devrant.com - 15/100, 5/11, grade F.
How do you fare?2
MarSecOps: "Marketing Security Operations, the idea is that security is not just the realm of website developers or the IT department anymore, but rather the marketing department has an equal if not greater interest in, and even responsibility to security."
WHAT THE FUCKING FUCK? The marketing dimwits responsible for security? Whose IT competence ends at Powerpoint drivel?!
I LOLed so hard that I could have shat a cactus!8
I had six items that I wanted to centre horizontally via CSS. Problem was that depending on the viewport width, the items could either take one, two, three or six lines. But the items broke to the next line like text so that e.g. the top line had five items and the second only one. What I wanted was three items each in this case.
Finally, I came up with a hack of media queries to make the parent container just so wide that six, three, two or one item would fit horizontally, and then centre the parent container with margin left/right auto.1
The WordPress Gutenberg editor is now starting to hit unsuspecting users who havn't been following up with the preview phase. They mostly hate it, and the arrogance from the WP pricks is stunning.
My favourite quote from WP.org admin Otto: "This is the future editor in WordPress. It is happening. There's no stopping that train now. People thinking that they can somehow stop the train are people who are standing in front of a train. That never really ends well."
Yeah you little dipshit, do you know what did end FUCKING well? Not having put myself on your bloody track in the first place so that I can sit back and enjoy my popcorn! :-)14
NOT saving the world in 2019. I already did that in 2012 when the Maya calendar ended and wasn't being thanked - on the contrary, people said "haha look, nothing happened".3
Math: the imaginary unit is i.
Electrical engineering: no, it's j.
C hacker: hands off my loop variables!14
When I finished my studies, I was looking for a job and had an interview at a smallish company.
Boss: can you do C?
Me: yes, I have already done some stuff in C.
Boss: I mean, are you really good in C?
Me, growing suspicious: well yes I already have been using it - but anyway, there's also the project documentation for looking up, right?
Boss: uhm, the code IS the documentation.
I envisioned myself being drowned in undocumented spaghetti code and wasn't really keen on that job anymore, but my following question pretty much ended the interview:
Me: oh, I see. Do you have any roadmap for getting your development to a more professional base?
His looks, priceless! He was just shocked when he realised that he had failed my interview, and that I was a fresher made it even harder to digest for him.31
Trying to concentrate. Co-worker from another room standing there, BLA BLA BLA, and she's fucking LOUD. But she hates coldness, and it's below 0 °C outside.
So I open two windows, and guess who instantly leaves! Now it's cold, but SILENT. HAR HAR!6
Today, I got some crap on my desk with possible bug reports from the field. They have been lingering somewhere for fucking MONTHS, and suddenly, an immediate answer was due. I was the unlucky one who was the least clueless about the product involved. SHIT.
OK, sifted through the reports. Some of them were duplicate, others obviously not our problem. No idea where to even start for the rest. FUCK, it's Friday!
But here comes "senior dev secret knowledge"(tm). Instead of saying WTF-IDK, I proposed an "action plan"(tm) (that BS term alone...) detailing the steps that we would need to take, and since I had no idea how long we would need, I just added enough steps in the "action plan"(tm) to make two weeks of investigation believable.
PM was very happy and just took that as direct customer reply. Now it's weekend anyway. :-)
Got some new coffee, Trung Nguyên from Vietnam. Now that's some in-your-face coffee! Strong and interesting taste, slight cocoa aftertaste. Only recommended for hardcore devs.8
So there is a WP plugin for GDPR conformity. True to form of the shitty WP plugin ecosystem, it has a major security hole that allows taking over the WP installation:
Just been watching some police soap on YT with "real police officers in action". Haha, yeah.
Huh, what's that outside, flashing blue light? Oh, a police car. No, two. Three. Actually, four. All of the guys rush into the neighbour house, WTF. Real police officers in action.
So I have implemented all the features required for the current release. Carefully reviewed my code several times, but no testing.
Tester: everything passed green. Not sure whether you're a good dev or I'm a bad tester.
Me: let's call it a draw.12
Testing had some issues with system integration. I asked them what their setup was.
Answer: "Almost similar to the real hardware."
PC-Lint is such a useless piece of shit! Tons of warnings with no actual benefit. The obvious motivation behind this crap was to throw as many warnings as this cheap sucker can even generate with no effort to minimise false positives. Typical snakeoil shit, reminds me of ZoneAlarm back then which reported every ping as "attack" just to fool the clueless into buying. Meanwhile, the actual bugs that sophisticated tools can find pass unnoticed through PC-Lint.
Just been browsing Awwwards about websites: https://www.awwwards.com/websites/
All of that is unusable crap and achieves "clean" design mostly by not having functionality. The trick seems to be a useless fat image and tucking away functionality as small as possible. This is design wankery.6
Code fuckup day or what?! After two weeks where I wasn't on my project and a co-worker handled it, I came back to my project and reviewed what he had done so far.
Me: "I don't understand how this new code part here can work?"
Him: "Uhm, actually, it doesn't, somehow."
Then he had checked in his stuff with spaces while the whole project is with tabs. And variables that were used in a different way, but still under the old name, now completely misleading. Bypassing existing infrastructure and defines with "just for this case" hacks. But the best was tracking higher level state by peeking into lower level data buffers, even pulling out their data definitions into global header files - instead of using proper states in the higher layer itself.
NOT! IN! MY! FUCKING! PROJECT!!!
So I spent the day cleaning up the shit to fight off software rot right in the beginning.4