Posts Tagged

Windows

Accidentally Breaking a Ship with Divide By Zero

Elizabeth Uncategorized October 18, 2021

The Ship

It’s 1997, and computers are making many things easier and more efficient. Enter: The Yorktown, a ‘smart’ Navy ship outfitted with new tech. This ship has been in metaphorically uncharted waters before: in 1988, when the Soviets decided nobody got to use ‘right of innocent passage’ in their chunk of the Black Sea, the Yorktown was there to push back a little and ensure that innocent passage was still an option. A Soviet cruiser attempted to push it back into international waters via hull-bumping, but because the Yorktown was extraordinarily well-outfitted and came with buddies, it didn’t go any further. The Soviets begrudgingly updated relevant handbooks to include right of innocent passage in their waters, something that had been available in the English version of the UN sea laws book but not the Russian one, and promised not to bully innocent boats out of their water again.

The Yorktown was impressive within the military, and yet it didn’t make much mainstream news beyond that Soviet incident. That’s not to say it didn’t deserve it – the Yorktown is very well-decorated across the board, in everything from safety to combat readiness. It was also already partially computerized already due to its young age. It was an excellent place to start, a great testing ground for the newly possible ‘smart’ ship technology.  Things could only get better once it had it’s new, shiny computers onboard fired up and ready to rumble. The Navy was entering a new era, one of peace, yes – but also one of significant technological catch-up to the consumer and business sides of tech.

The Incident

However, programming has always had its flaws, even when it was many times simpler than what we have today. A small bug or flaw could cripple a business until it was sorted out, and the Navy was about to learn this the hard way: a programming flaw consumed literally all of the RAM everywhere on the boat. Someone put a zero into a database field that was used in a division equation, and the computer locked up while trying to divide by zero. This wasn’t a particularly consequential computer, but it didn’t stop there! As said before, it ate all of the RAM. All of the computers shut down. All of them. Including seemingly unrelated ones in propulsion, because instead of just locking up the one computer, the error ate all of the RAM and spread in what’s known as a buffer overflow.

Luckily, it wasn’t in a lot of danger – boats float by themselves, and it was in friendly waters just off the coast of Virginia during the incident. Two days later, it was back to business and battle maneuvers. However, whether or not it had to be towed in is a point of contention: reporters who talked to important folks on the boat say that’s what they were told, but the important folks later came out and said that it got into port under its own power. There’s motivation in keeping the exact details quiet – buffer overflows were easy to make happen, should a malicious actor get into the LAN – so the exact truth is somewhat obscured.

It recovered eventually, and safeties were put into place so that system administrators could bypass the faulty input and replace it without totally wrecking the entire network in the process.

The Flaw: Divide By Zero Plus Buffer Overflow

It’s a common joke: divide by zero, destroy the universe. Convert something into nothing, break laws of physics and conservation of mass. Dividing by zero is illegal for most computers nowadays – they’re programmed not to think about it and dismiss it right away with an error message instead. If they don’t, the computer ends up locking up as it tries to figure out how to do the impossible. Yorktown’s database manager program wasn’t programmed to return an error. Even that might not have been a huge issue if it hadn’t overflowed, which was the real problem, and that might not have been an issue if the LAN wasn’t trying to resource-share where it shouldn’t have been.

The way a buffer overflow works in Windows is that an error starts overwriting surrounding lines in the database, compounding the error and consuming even more RAM to calculate, so once it got going, it was going. Other computers in the network designed to connect to this one began experiencing the buffer overflow as well, and soon the entire network had been eaten by the divide by zero error as other computers became fodder for a faulty calculation.

How would you prevent this from happening in the future?

Buffer overflows are still a widely known exploit. In an attack, a malicious actor would send code that breaks the formatting of the destination database, either to lock up the computer or replace nearby innocent code with malicious code and squeeze in further. Windows (and the version of Windows the military was using on the boat) actually doesn’t have a built-in prevention feature, either, so it really was possible to cripple ‘smart’ vessels with simple typos that would be harmless on other operating systems.

The simple answer is to just not use Windows NT. If something makes it into a database, Windows NT would not check to make sure it fit in the provided array (which is essentially a size and formatting gate for databases). A more complicated answer is reprogramming around the software to ensure it returns an error, or refuses to process bad inputs altogether, something they wouldn’t have had to do had they used a different OS. Software failures were allegedly already a known issue in Windows NT, but the only other options were UNIX or custom-building something. The Navy picked Windows because it was slightly more user-friendly, but as a result, patchwork code filled in the gaps between the stuff already there and the stuff being freshly installed to make the Yorktown a ‘smart’ ship. Some things were overlooked.

After this incident, the Navy pushed for more UNIX and less NT. UNIX, while imperfect, didn’t literally try to eat the entire network over a typo when it encountered a database error. Engineers within the Navy said they pushed back against Windows only for Windows to win anyway in a political victory; this is one of the incidents that forced the Navy to listen to engineers further down the line.

Was it worth it?

Short answer? Yes, actually. The Yorktown saved an estimated 2.9 million dollars and reduced its crew by ten percent, just by computerizing. Human error has also stranded boats; at least the computer doesn’t have a sense of lying for self-preservation. Besides, the old boats without computers doing everything were effectively wasting labor, which – in the unprecedented peace just before 9/11 – was unacceptable. Those sailors could be doing something else more productive than hand-calculating trajectory and speed.

Those first Smart boats were rough, yes, but the experience gained from that buffer overflow in safe waters was invaluable.

Sources:

https://web.archive.org/web/20060208090921/http://www.gcn.com/17_17/news/33727-1.html

https://en.wikipedia.org/wiki/1988_Black_Sea_bumping_incident

https://gcn.com/articles/1998/07/13/software-glitches-leave-navy-smart-ship-dead-in-the-water.aspx

https://slate.com/technology/2018/06/why-the-military-cant-quit-windows-xp.html

https://www.wired.com/1998/07/sunk-by-windows-nt/

Apple And Differentiation

Elizabeth Uncategorized October 6, 2021

You might remember Apple’s smart mouse having it’s left-right click removed. Now there is only mono-click. All hail mono-click.

Differentiation

Differentiating yourself from your competitors is generally a good thing. After all, if every company is producing the same product, customers will choose whichever is cheaper. However, differentiation is also not as simple as price or quality: at some point, this differentiation gets so huge that customers literally cannot switch back over without learning the competitor’s product from scratch.

Little differences make the electronics market incredibly diverse!

History

Apple and Microsoft have been the two big dogs in the industry for forever. Microsoft focused on software, while Apple focused on computers – Apple famously nearly bankrupted itself once by focusing too much of their resources at projects like the Newton, which would have been one of the first PDA devices able to recognize handwriting, in 1997. They also made a deal with Microsoft to secure an investment and get the company back into solvency, which lead to a much more user-friendly version of Windows for their computers. Essentially, Apple traded some of it’s UI in order to get back on track financially. Since then, Apple and Microsoft have taken wildly different paths, and while they’re always trying to go faster, they’re doing it in different ways:

Apple’s focus is very much on the human side of computer/human interaction, while Microsoft’s more concerned with the computer and it’s functionalities. After all, people are easier to teach new things to than the computer!

As a result, the two use very different machines to get to their ultimate goal of a happy customer. Even then, Microsoft can appear on any number of devices, from Dell to Azer or Asus and more, while Mac’s OS appears almost exclusively on Apple devices.

Hardware

Let’s start small. Most mice have two separate plates for left- and right- click. Most mice also have a few millimeters of give on them for clicks, so they have to be divided. The newest generation of Magic Mouse defies both of these, and the left-right click is handled by one, singular button. The plastic is more flexible than on traditional mice to accommodate the twisting it needs to do to function.  This fundamentally changes a user’s experience, as do the paper-thin buttons and the placement of the charging port. This new gen of Apple mice is also missing a physical scroll wheel!  

Slightly Bigger

 Apple’s laptops and peripherals are becoming wafer-thin. Their tablets, too, are typically thinner than tablets of the same speed and power brought out by Dell or Microsoft. Meanwhile, Alienware (produced by Dell) laptops play up how much thicker and beefier their products are when compared to the sleek, small Apple devices. Differentiation here allows the customer to pick a device more suited to what they need: Alienware’s goal is to look like a gaming device. Apple’s is to look like a personal computer. The million other shapes and sizes of Azer, Asus, Dell, etc. computers fall somewhere in the middle. Looks still tell consumers a lot about a machine, so physical differentiation is critical for marketing!

Even Bigger

Apple’s UI is one of a kind. Because the hardware is so different, the software itself needs to do more with less.

The Magic Mouse, for example, can’t be used while it’s charging. The charging port is at the bottom. It’s also missing buttons for separate left-right clicks, which presents an issue as the mouse gets older and becomes prone to mis-interpreting physical inputs. Both of these mean that Apple’s touch screens and touch pads have to be phenomenal to keep up with the features they’re getting rid of for sleekness – the built-in trackpad is often compensating for the finicky nature of the buttons.

Secondarily, the lack of physical buttons (like that scroll wheel) doesn’t mean those functionalities are gone, they’re just controlled by gestures instead. Apple’s newest Magic Mouse can actually “see” human hands and interpret certain movements as gestures! It’s even customizable to a limited extent. The software in the mouse alone is incredibly different from anything users see from Windows. That might be a good thing, as users are often frustrated by this 75+$ mouse when it glitches or misinterprets an input.

Meanwhile, third party and Windows-compatible mice don’t futz with gestures at all, bringing down the price dramatically.

Built Different

The computers themselves are built differently. It is possible to download the iOS on a third party computer – however, most computers come with either Windows or that iOS already installed. While Linux can run on Windows, it had to be specially modified to get to Linux on an Apple-made device. Apple also prioritizes computer resources differently – thinner machines have to sacrifice some function to get wafer-thin. It keeps the stuff that an average user needs, and cuts wants down to the bone so it all fits inside. You may notice that Apple tablets struggle with more intense App games, and that’s not a mistake. Game studios have to create a separate version of their game especially for Apple devices, not only for the programming but for the hardware: Apple uses less powerful GPU units than most Windows manufacturers, since Apple is catering to casual users first.

Apple’s also notoriously finnicky about warranty – open up your Apple device yourself and risk voiding the warranty on the machine. They barely tolerate third-party repair shops, and it seems, at times, like they want to punish the end user for buying something Apple-made with expensive and easily breakable parts (notably their easily breakable phone screens, up until a couple of years ago). Windows devices, which are really an assortment of all sorts of third party machines, can get repaired basically anywhere.

Final Verdict? Apple’s main focus is always going to be on the user experience first and performance second, where other devices may let user experience slink to second or third place to favor other aspects of computers. In Cult of Mac’s article, you can see just how many of these principles are to make the user experience easier, vs. Windows, which often didn’t bother to spell things out for the user until much later in its history. They’re radically different in more than just appearance!

Sources:

https://discussions.apple.com/thread/5054751

https://magicutilities.net/magic-mouse/help/scrolling-and-swipes

https://www.geeksforgeeks.org/difference-between-windows-and-ios/

https://appleinsider.com/articles/18/08/06/august-6-1997—-the-day-apple-and-microsoft-made-peace

https://www.businessinsider.com/how-steve-jobs-took-apple-from-near-bankruptcy-to-billions-in-13-years-2011-1#1998-introducing-the-imac-2