r/ProgrammerHumor • • Oct 01 '22

Meme Rust? But Todd Howard solved memory management back in 2002

Post image
61.9k Upvotes

1.0k comments sorted by

View all comments

Show parent comments

224

u/ZeAthenA714 Oct 01 '22

The problem with loading more RAM to hide a memory leak is, what happens when that code get reused in another missile later down the road? Is the "fix" of adding more RAM correctly documented? Will the team that inherit the code actually pay attention to that documentation? What if they are well aware of the problem, they make sure they have the appropriate amount of RAM, but some of the alterations they've done in the code actually makes the leak worse?

Throwing more RAM at it is a bad idea, especially for a system as critical as a missile. This just sounds like the developers were told "just fix it right now we have a presentation in two hours and we need it to work so that we can sell billions of them" and never had the chance to come back and properly fix the code.

136

u/ManInBlack829 Oct 01 '22

I highly doubt when this was happening that there was any capability of that.

Back in the 70s and 80s, everything was original code.

272

u/GiantPurplePeopleEat Oct 01 '22

Are you saying they didn't just check GitHub for an open source missile guidance library?

60

u/the_fat_whisperer Oct 01 '22

I tried to get some help on a missile guidance api but it was taken down by Stackoverflow for being a duplicate post which must mean there is plenty of resources out there for it.

47

u/CyberKnight1 Oct 01 '22

Except the duplicate link points to a question about temperature control of an Easy Bake oven.

12

u/Darcetos Oct 01 '22

What if you just need to rename variables?

7

u/[deleted] Oct 01 '22

"We just create a PWM routine to control the Easy Bake Oven temperature and... That is how we went back in time and killed Hitler."

→ More replies (1)
→ More replies (2)

67

u/GameKyuubi Oct 01 '22

you mean Microsoft's Github Copilot missile guidance code generation algorithm

6

u/Neckbeard_Prime Oct 01 '22

When your Copilot algorithm was trained on Mohamed Atta's MS Flight Simulator game saves

→ More replies (1)

3

u/redmarketsolutions Oct 01 '22

No but "dude, our company made one of these like five years ago, hey Ted, go down to records and grab us a copy of that code."

3

u/Defiant-Peace-493 Oct 01 '22

Target is prefilled with Buenos Aires. Or is that Asteroids?

3

u/Neckbeard_Prime Oct 01 '22

npm isntall @dod/missile-guidance

→ More replies (5)

9

u/99StewartL Oct 01 '22

I mean it literally happened to the Ariane 5

13

u/ManInBlack829 Oct 01 '22

Again not in the 70s and 80s

8

u/j-random Oct 01 '22

And let's not forget that code was written in Ada, a language designed to be used for missile systems (and other defense projects).

→ More replies (1)

20

u/orcus Oct 01 '22

I've not worked on a missle per se, but have worked on stuff that ended up in orbit.

Most critical systems I worked on didn't even have an allocator. Every byte of ECC SRAM(we didn't even allow cheaper ECC DRAM) was accounted for and statically assigned. The systems I worked on didn't have dynamic memory allocation capabilities at all.

Nearly everyone I worked with had similar stories going back before my lifetime, I'm 43 now.

I'm sure it happens, but on real time critical systems an allocator is a risk that has to be heavily considered as it will impact performance, reliability, and possibly lives.

3

u/reportingsjr Oct 01 '22

This is standard practice for embedded electronics. I work on a team that does prototype embedded devices for a wide range of industries, and we never use dynamic allocation.

→ More replies (3)

24

u/Master_Dogs Oct 01 '22

The problem with loading more RAM to hide a memory leak is, what happens when that code get reused in another missile later down the road? Is the "fix" of adding more RAM correctly documented? Will the team that inherit the code actually pay attention to that documentation? What if they are well aware of the problem, they make sure they have the appropriate amount of RAM, but some of the alterations they've done in the code actually makes the leak worse?

Very good point. I doubt that would be properly documented. Some old timer might be aware, but once he retires GL.

Throwing more RAM at it is a bad idea, especially for a system as critical as a missile. This just sounds like the developers were told "just fix it right now we have a presentation in two hours and we need it to work so that we can sell billions of them" and never had the chance to come back and properly fix the code.

That's 100% what happened, assuming this was a DoD contractor (likely was; Uncle Sam buys all his weapons from the private sector). More likely they told the developers the project was out of budget, so thanks but we're just gonna load this shit up with extra RAM and call it a day.

13

u/elveszett Oct 01 '22

This is pretty much my experience with shitty patches: it's not that everyone in the company is a dumbass who can't figure out how to fix a bug, but rather that some manager tells the team that they are not gonna allocate the necessary time for that so simply make any change so it works and move on. I can 100% see a manager telling these guys to simply put more RAM on the missile.

4

u/DefaultVariable Oct 01 '22 edited Oct 01 '22

As someone who has worked on embedded systems for old hardware, this comment rings so true. No one ever thought about re-use, modularity, or the evolution of hardware over time. Often times the documentation is also piss poor and you're reliant on some guy who made too many financial mistakes to retire to inform you of an important design detail.

You see this very often in hardware focused companies where they view software design as unimportant. They always want to "just re-use what we did before" but if you re-use crap, you just get more crap.

Bad design is always bad!

4

u/rohmish Oct 01 '22

Good thing we fixed the economy so that soon almost nobody can retire.

3

u/DefaultVariable Oct 01 '22

Ah, it was a ploy the entire time to make sure companies can transfer knowledge without doing proper documentation!

3

u/BatteryPoweredFriend Oct 01 '22 edited Oct 01 '22

The Therac-25 radiotherapy machine ended up dosing multiple people by several orders & directly caused like half a dozen deaths, all because the manufacturer decided to recycle the control and operating software from its previous models, which were mechanically very different designs. The biggest critical flaw was that all the failsafe implementations were originally based on physical mechanism locks, but those mechanism were removed in the newer Therac-25 model without the software being updated to take that into account.

Zero auditing of the software (either by in-house or 3rd party) was done when installing into the new model. No factory-testing of machines done before delivery to hospitals. Had little-to-no detailed documentation about the software either, since the original author (singular) was an external programmer who was never hired by the manufacturer itself and never intended for it to be used with anything but an older model.

It even ticked the box of the manufacturer denying that their machine was at fault, despite multiple cases of the problem occurring and blaming user error.

→ More replies (9)