The Official Status Thread
-
Status: Still on the hunt for hidden
struct
s in our C code. Today, found a beezer which was almost the same as an existing structure, except with some of the fields in a different order.It's not helped by the weird way everything is packed together on the wire, but actively reordering elements which are plain old unsigned ints? And nobody spotted this before because of the way it was written:
int32_t *sp_word = (int32_t *) sp_address; data.field_1 = *sp_word++; data.field_2 = *sp_word++; data.field_3 = *sp_word++; data.field_4 = *sp_word++; data.field_6 = *sp_word++; // ... data.field_14 = *sp_word++; data.field_5 = *sp_word++; data.field_17 = *sp_word++; data.field_18 = *sp_word++;
OK, the real names weren't as obvious as that. If they'd been that obvious, maybe even my colleagues would have spotted it. (Instead, they were all things that made sense in the application. And were a lot longer…)
But the real fun came later in the function (again, the names are lightly changed; this has shortened the lines):
(Remember,
sp_word
is aint32_t *
, and this is all code for an architecture where you really need to get your alignments right or things blow up with an abort.)uint32_t index; uint16_t *half_word; for (index = 0; index < data.sub_info_table.no_sub_info; index ++) { sub_info_t *subinfo = &data.sub_info_table.sub_info[index]; half_word = (uint16_t *) sp_word; subinfo->no_items = *half_word++; subinfo->control = *half_word++; sp_word = (int32_t *) half_word; subinfo->total_no_items = *sp_word++; subinfo->sub_sub_info = malloc( subinfo->no_items * sizeof(sub_sub_info_t)); int32_t sub_index; for (sub_index = 0; sub_index < subinfo->no_items; sub_index++) { subinfo->sub_sub_info[sub_index].field_1 = *sp_word++; subinfo->sub_sub_info[sub_index].field_2 = *sp_word++; subinfo->sub_sub_info[sub_index].field_3 = *sp_word++; subinfo->sub_sub_info[sub_index].field_4 = *sp_word++; } }
So yes, we're bouncing back and forth between word-aligned and half-word-aligned pointers. (It does this sort of thing several times.) “Fortunately”, this is a part where at least the order of data in one chunk of memory (the source, which is in slow persistent memory) is identical to that in another part (in fast, working memory) so at least it's not got the crazy reordering going on, but even so. There's also places where it's processing variable-length arrays of mixed 16- and 32-bit values, and just relying on the data producing code (i.e., some fairly ugly Python) to always pack the 16-bit values in even-sized groups. Because of course you do that! AAAAAARRRRRRGHH!
Bonus: At no point in the making of this code was
memcpy()
ever troubled. Apparently someone long ago thought that it was slow, so they wrote their own. That was also slow. And so they wrote it all out again all over the place. Can't trust those compilers to just copy data around correctly!(Strictly the immediate author of this piece of code was a student, but he's a final-year PhD student trying to get his code into our production releases and he's following patterns elsewhere in our codebase; he knows the rules about software development! He helped write the ruleset we're using, and specifically lobbied for their enforcement.)
I'm killing it all with fire. Much fire. It is a glorious thing. It will be better — if a little singed — afterwards.
-
@TimeBandit said in The Official Status Thread:
@mott555 said in The Official Status Thread:
A seemingly-random list of PCI/PCIe devices (including the ones we manufacture) only work on a subset of ZXXX machines and we never could find any tangible difference between the systems that worked and those that didn't.
Doesn't HP stand for Hope & Pray?
I hoped and prayed, and lost. Ended up building from scratch.
-
Status: Stupid $MFT file, why u no defrag?
*clicks*
Oh shit! shit shit shit shit!
Oh, okay....
-
Status:
Nononowaiwaiwaitabit... just wait.
-
This morning I woke up, turned off my alarm, realised that I'd been thinking it was Friday when it was obviously Saturday, dozed off, woke up again, realised that it was, in fact, Friday, and it was ten past eight, i.e. the time I'd ideally like to be leaving the house.
Still, I managed to do everything essential and leave the house by eight thirty, only five minutes after the very latest I can leave to get to work on time, walked as fast as I could, and made it to my desk at two minutes past nine.
-
Status: Tested my new personal website design on the server. After a few tweaks everything was working more or less like I wanted. Now I just have to go through all of my old content to bring it in line with the new setup and it'll look like something created in 2010!
-
Status: Cat brought a mouse into the house and left it in the kitchen, cat then left the house. Mouse buggered off under the kitchen cabinets and I can't find it. 1/10, I want a refund for my cat.
-
@Applied-Mediocrity said in The Official Status Thread:
Status:
Nononowaiwaiwaitabit... just wait.
Suddenly glad I saved this back when it happened:
-
@Cursorkeys said in The Official Status Thread:
Status: Cat brought a mouse into the house and left it in the kitchen, cat then left the house. Mouse buggered off under the kitchen cabinets and I can't find it. 1/10, I want a refund for my cat.
Your cat is saving it for tonight. When you want to sleep.
-
status Woot! I timed it right. Sitting at computer, looked out window - hey, rain has stopped - ok dogs, let's go! Walk them. Get back. Sit at computer. It's raining again. Hit the perfect window of opportunity.
-
No Need for Batteries nor Electricity Connection
I read that on the description for a tin opener and almost flew into a rage. I read it as internet connection. Does it need to be GDPR compliment too? Thankfully a quick Google search didn't yield anything but I can't wait for reports of tin openers being involved in ddos attacks.
-
Status: Praying that Windows 10 Update 1809 doesn't brick my computer like Fail Craters did.
-
@Gąska said in The Official Status Thread:
Status: Praying that Windows 10 Update 1809 doesn't brick my computer like Fail Craters did.
"your bricks are right where you left them..."
-
@kazitor said in The Official Status Thread:
@kazitor said in The Official Status Thread:
Status: half an hour so far.
Status: 14 hours later and it's still slightly visible.
Status: very faint, almost 3 days later. This is thrilling stuff, isn't it?
I can tell it's not imagined because I can't remember which should be red and which green, but after checking it always matches.
-
@kazitor said in The Official Status Thread:
This is thrilling stuff, isn't it?
@Tsaukpaetra is sad because he cannot participate in the thrill...
-
Status: display driver problems or something. This crap is such a time-suck.
-
status: Apex Legends ain't half bad.
-
Status: who knew shoving
/dev/zero
onto all the disks was such a cpu intensive operation?
-
@pie_flavor said in The Official Status Thread:
status: Apex Legends ain't half bad.
badness(product("Apex Legends")) != 0.5
-
@Tsaukpaetra said in The Official Status Thread:
Status: who knew shoving
/dev/zero
onto all the disks was such a cpu intensive operation?All those zero bytes aren't going to compute themselves, you know!
-
@Zerosquare said in The Official Status Thread:
@Tsaukpaetra said in The Official Status Thread:
Status: who knew shoving
/dev/zero
onto all the disks was such a cpu intensive operation?All those zero bytes aren't going to compute themselves, you know!
It takes time to strip all those
1
s down to0
.
-
More quotes from my "favorite" professor I mentioned last year:
If you're still a programmer by 35, you've failed at life.
Spending 5 years at university just to learn programming is horrible idea. Nobody in other countries [than Poland] cares about diplomas.
I expect you to spend about 20 hours every week on the project for this class.
-
@Tsaukpaetra Status: Dat's a lotta fail....
-
@Zerosquare said in The Official Status Thread:
@Tsaukpaetra said in The Official Status Thread:
Status: who knew shoving
/dev/zero
onto all the disks was such a cpu intensive operation?All those zero bytes aren't going to compute themselves, you know!
The zeroes come from a HPC, don't you know...
-
Status: fine, let's wipe using another machine.
I can't believe it's fucking working.....
Edit: for those who may be confused and the image is too poor-quality, the left two drives are connected using the motherboard SATA cables. The two stacked on top of one another is a USB 2.0 adapter, using both the IDE and SATA connectors simultaneously. The other two drives are similarly connected with a USB 3.0 adapter.
DBAN says it's going to take two days to run three passes over the drives. This is of course, at the current write rate, which falls down to half by the end of the drive. I'll report back in week...
-
Status: Pissing off a mod in another forum, who was foolishly trying to help in a non-help sub-forum.
Where are we?
Off-topic, of course!
-
STATUS
wow velocity for the sprint is very impressive but it just appears to be a lot of small tickets and none of the big tickets were completed.
maybe if you let us fix the under lying issue instead of playing wacamole for two weeks, derailing us from the main work it would of got done.
-
@Gąska said in The Official Status Thread:
Nobody in other countries [than Poland] cares about diplomas.
He's obviously never been to France.
If you're still a programmer by 35, you've failed at life.
"Hey, that's OK. It could be worse, I could be a professor."
-
@Zerosquare said in The Official Status Thread:
@Gąska said in The Official Status Thread:
Nobody in other countries [than Poland] cares about diplomas.
He's obviously never been to France.
Or anywhere else in the world, for that matter.
If you're still a programmer by 35, you've failed at life.
"Hey, that's OK. It could be worse, I could be a professor."
He's one of those people who got incredibly lucky in the first few years of the chaos that ensued after the fall of USSR and got rich very fast, and he's teaching at university more for fun than for profit.
-
A long time ago @Applied-Mediocrity said in The Official Status Thread:
Status: It looks like RS-422, it's wired like RS-422, but it does not quack, at all. I have to entertain the possibility that it may not really be RS-422.
Status: Turns out the data port controller had some magic smoke missing. Whether it was me or it was already dead when I got it (with "me letting +12V DC into what was possibly a +5V TTL receiver" being more likely), who knows.
The time between me posting the RS-422 stuff and today roughly indicates how much nobody cares when engineers say something. I suspect someone will rush to care now that a pretty fat replacement board invoice needs to be paid. Me, I'd rather leave it that way. The machine still works, it's just the data port that instead of being mostly useless has now upped its game and become absolutely useless
-
@Tsaukpaetra said in The Official Status Thread:
Status: who knew shoving
/dev/zero
onto all the disks was such a cpu intensive operation?How's that possible considering disks are orders of magnitude slower than CPU?
(And a sane implementation would of course re-use a single page of zero bytes it sends to the controller, but alas)
-
@Gąska said in The Official Status Thread:
More quotes from my "favorite" professor I mentioned last year:
If you're still a programmer by 35, you've failed at life.
If that's what I like doing, why do I need to be "promoted" to management?
Something something Dilbert principle.
-
@topspin I asked him about architects who still write lots of code as part of their job. He mumbled something about different responsibilities and promptly changed the subject.
-
status: Giggity.
-
@topspin said in The Official Status Thread:
If that's what I like doing, why do I need to be "promoted" to management?
I worked for a company once that didn't get that. So I maxed out my salary because they ran out of non-mgmt salary bands (wow, a whole $200/yr raise). A friend who transitioned from programmer to mgmt and back kinda forced the issue. (at least that year, my boss tried his best to get my bonus as large as he possibly could)
-
status: There is now a blob of cement on my tooth where a bracket used to be. It's sure not on or around my pillow, so there is a very real chance I have swallowed it.
-
Status:
There was an error on my screen this morning, it appeared two times and was red!
Ok, did you take a picture or write down the error?
No.
Can you remember anything more about what it said?
No.
-
@dcon said in The Official Status Thread:
transitioned from programmer to mgmt and back
"Transitioned"? You mean that programmer and management are genders now?
-
@Zerosquare said in The Official Status Thread:
@dcon said in The Official Status Thread:
transitioned from programmer to mgmt and back
"Transitioned"? You mean that programmer and management are genders now?
It's more of a fluid thing.
-
@Cursorkeys said in The Official Status Thread:
Status:
There was an error on my screen this morning, it appeared two times and was red!
Ok, did you take a picture or write down the error?
No.
Can you remember anything more about what it said?
No.Get back to me when you can!
-
Status: Are y'all preparing a war again? What's with the sonic booms?
-
@topspin That's basically where I've left it, nothing obviously wrong. Nothing abnormal in the event log. E_NOREPRO
-
@topspin said in The Official Status Thread:
What's with the sonic booms?
-
Status:
src/main.c:396:16: warning: declaration of 'x' shadows a global declaration
Who the hell declares
x
globally?
-
@Tsaukpaetra said in The Official Status Thread:
@Zerosquare said in The Official Status Thread:
@dcon said in The Official Status Thread:
transitioned from programmer to mgmt and back
"Transitioned"? You mean that programmer and management are genders now?
It's more of a fluid thing.
No, more of a frustration thing!
-
@Cursorkeys People who want you to use multi letter variables?
-
@pie_flavor said in The Official Status Thread:
@Cursorkeys People who want you to use multi letter variables?
What else do you use for a counting variable in
for
s and the like?count
andindex
looks too verbose,idx
looks odd, andcnt
looks rude.People who use
i
should also be looked at suspiciously, there's a strong possibility they've been around too much PHP.
-
@Cursorkeys said in The Official Status Thread:
People who use
i
should also be looked at suspiciously, there's a strong possibility they've been around too much PHP.It's worse than that. They might know… mathematics!
-
@Cursorkeys said in The Official Status Thread:
People who use
i
should also be looked at suspiciously, there's a strong possibility they've been around too much PHP.Luckily I can use
i
in my C code with impunity. Our PHP code uses$nIndex
.
-
Status: Who TF wrote this code?
This is god damn retarded! I hate you!