📜 ⬆️ ⬇️

New Year Bug Stories

Do you believe in magic? From a logical point of view - of course not! Programmers, developers are serious people with a good education and a realistic view of the world. Maybe you did not like fairy tales in your childhood? No, I will not be responsible for you anymore. Just ask to pour a mug of tea, clean the mandarin, look at the snowflakes outside the window and only after that start reading this Story.

Here is a story about the evil bug. About how he repeatedly tried to spoil the New Year holidays. Often he managed to embody his insidious plans, but, fortunately, in every Tale “evil” is opposed to real “good”.

Picture 3

Herringbone-virus


On December 17, 1987, a student at German University Clausthal-Zellerfield, while still a very young programmer, decided to originally congratulate his friends. He sent all the near and dear Christmas tree! Of course, he did not cut it down in the forest and did not even buy it at the store. Do not forget, our hero is a programmer, so he wrote a program in REXX for VM / CMS , which, after launching, displayed a cute Christmas tree and warm greetings.
')

Figure 1 - The program Christmas Tree - herringbone virus


Figure 1 - The program Christmas Tree - herringbone virus

With good intentions and a sincere desire to do good, our hero wrote the code. But the Malicious Bug wedged into the process, the network was overloaded and Christmas's self-replicating program paralyzed IBM Vnet's private mail for two days (chain: university network - EARN - BitNet - IBM-Vnet) worldwide. There were doubts: wasn’t the hero an anti-hero, and a touching greeting is a virus? Prove the evil intent of the author of the program Christmas Tree failed. But without the influence of the Evil Bug there definitely wasn’t.

The attraction of unprecedented generosity


Christmas and New Year are holidays for which gifts are given. Beautiful boxes under the Christmas tree or cute souvenirs in Christmas socks hanging by the fireplace - this is what traditional New Year's gifts look like. But surprises are especially pleasant.

Amazon is one of the first Internet services, where tens of thousands of various goods are sold and bought every day. The perfect place to choose gifts! This is exactly what the users were doing on December 12, 2014. Special excitement caused an amazing price for thousands of goods - just 1 penny. Thanks to the service for a great Christmas present, people enthusiastically went shopping. And Malicious Bug was grinning on the sidelines, waiting for the reaction of the sellers, who still did not know that they had suffered huge losses.

Error crept into the software RepricerExpress , responsible for the synchronization of prices in online stores. With it, it is easier for sellers to compete in the market, quickly responding to price changes for similar products.

What did the evil bug do? It penetrated RepricerExpress at the design and testing stage, but did not declare itself until such time as ... One of the suppliers, having started in the pre-holiday bustle, accidentally set a single price for his entire range - 1 penny. The program took this value as the minimum and lowered the price of goods from other vendors.

The reason for this behavior is due to the fact that during the development of the user interface it was not possible to set its own minimum price for the product. In addition, at certain time intervals there was an autocorrect price. During the next update, the bug was fixed.

Figure 2 - The correct system interface (Your Minimum Price column appeared)


Figure 2 - The correct system interface (Your Minimum Price column appeared)

The day that this error occurred, Amazon sellers will remember for a long time. They lost thousands of dollars, many were on the verge of bankruptcy. If it were not for the operational measures of Amazon, which managed to cancel most of the orders, the reputation of the largest online store would have been completely spoiled.

RepricerExpress developers apologized for the software crash by posting a statement on their official blog .

Apple vs New Year


Remember the movie "The Grinch - The Christmas Thief "? Apparently, the Evil bug was inspired by its plot, deciding to hit the "apple" device. In February 2016, Apple owners discovered an interesting bug. In social networks, a legend has arisen that if you set the date of January 1, 1970, and then restart the device, the system will crash completely, and instead of a smartphone or tablet you will have a brick with an “apple” emblem. However, there is no possibility to roll back the action. There was information about the presence of this error on devices with a 64-bit processor: Apple A7, A8, A8X, A9 and A9X: iPhone 5S and later, iPad Air and iPad Mini 2 and newer, as well as the 6th generation iPod Touch. The operating system version did not matter.

Picture 2


Were those willing to experimentally check for a bug? Sure! Around the world, a wave of murders of Apple gadgets. Fortunately, the craftsmen have found a way to return to work "bricks". In Apple, the official cause of the error was not voiced, but they announced the possibility of such a bug, when manually installing on an iOS device, a date in May 1970 or earlier.

Users conducted their own investigation. As a result, the following version was formed: a variable with a negative value that stores time in UNIX format could lead to an error. Why could this happen?

Option 1. Due to the fact that time is represented in UNIX-format, the starting point is from January 1, 1970, i.e. is zero. When the time zone changes, the variable may take a value less than zero.

Option 2. The bug is typical for 64-bit devices, so it is possible that the 32-bit timestamp is calculated first, then the time zone is shifted, the label is converted to the pointer size, for this reason the upper bits are filled incorrectly and ... Welcome in the XXII century!

Sleep from iphone


Prolonged sleep, not interrupted by the sound of an alarm clock, is it not the dream of most of us? iPhone - not Gazprom, but fulfills the dreams of its users! All those who wanted to cheerfully start the new 2013 and set the alarm on January 1, overslept safely. The evil bug obviously intended to introduce a huge number of users into the “sleeping princess” mode, since until January 3, the alarm clock on the iPhone did not work.

Picture 7


Apple decided to keep silent again. But the version of the causes of the error still spread. To display the year, the standard ISO week date is used, it is widely used in financial organizations to facilitate the formation of the reporting (fiscal) year. Its feature is that the new year is considered new only from that week, which contains the first Thursday of the year. The calendar in the ISO standard date contains 52 or 53 weeks (364 or 371 days). Thus, the iPhone lived in the old year, and the new 2013 came only on January 7 - from the new full week of the year.

There was also an alternative version, in which Steve Jobs himself acted as the Evil Bug. Allegedly, the founder of Apple loved to sleep, so he came up with this feature. Of course, this is a joke. But the consequences of this seemingly unserious bug turned out to be more than unpleasant: people overslept work, lost money, were late for important meetings ( Source ).

Flight canceled


The cost of software errors is a factor that developers should never ignore. The proof is in the next pre-Christmas story about the bug.

December 12, 2014, a software malfunction occurred in the British ATC center of the National Air Traffic Service of the United Kingdom (NATS). The work of some airports, including such busy giants as Heathrow, Gatwick, Stansted, Birmingham, Cardiff and Glasgow, was stopped. The problem was aggravated by the time that the evil bug chose to attack - Friday, afternoon, the eve of the Christmas holidays.

The failure lasted just over half an hour - 36 minutes, but its consequences indicate the extremely high cost of the error. Evil bug tried to glory:


This situation could not be ignored. An investigation was conducted. The Civil Aviation Authority (CAA) and NATS in the final report describe a bug in the System Flight Server (SFS) software. This server is responsible for ensuring that the NATS control system receives real-time data to the workstation controller. In the system there are two identical SFS - working and spare. Both compute the same data. When the main SFS is disabled, a spare comes into operation. The system worked with hardware failures, but for some reason none of the servers provided protection against software exceptions.

The maximum number of simultaneously functioning workstations (flight control and monitoring sites) is 193. Theoretically. In fact, a completely different value is written in the SFS code - 151. Therefore, when an attempt was made to connect 153 workstations at the same time, a reboot and subsequent system crash began. Later it turned out that the “hidden software malfunction” was made back in 1990. It is surprising that she did not manifest before.

Problem 2000 and 2038


2000 was one of the most anticipated. The change of the millennium, in the opinion of a number of experts in various fields, must necessarily be accompanied by the End of the World or, no less terribly, by the uprising of machines.

What was the reason for the fear of the Terminators? Logic! The first computers were slow, so in order not to waste such valuable performance on trivialities, the developers decided to use two-digit code representation in dates. For example, March 23, 1991 looked like 03/23/91. Visually, this designation does not "cut the eyes"; this option of recording the date seems absolutely familiar. But from the point of view of a computer, things are not so simple: 2000 and 1900 receive the same designation: 00. Thus, upon the occurrence of 2000, the internal computer clock will be switched to 1900.

The consequences of such a failure seemed extremely terrible: the failure of programs, the spontaneous launch of rockets, the collapse of the financial market. And the most terrible events were to take place in Russia, as in the country least prepared for the new calendar.

But very soon 2017 will come, which means the End of the World has not happened.

However, some failures during the millennium change did occur:


Some bugs were quite funny:


Issue 2000 is a prime example of how the media can affect humanity. The next wave of panic for a similar occasion can be expected in 2038. January 19, 2038 at 03:14:07 GMT, computers and other devices with a 32-bit system will no longer be able to count the time correctly. Many computing devices count the system time from January 1, 1970, in seconds, using a 32-bit value, and the second is stored as a signed int (a signed 32-bit integer). In 2038, there will be 2,147,483,648th seconds, which simply will not be possible to record by the system, and then the counter will take a negative value.

How to prevent a system error? Replace all 32-bit processors with 64-bit ones.

How to help the Good?


According to tradition, Good conquers Evil, but the struggle does not stop for a moment. Is it possible to destroy all the evil bugs? Most likely, no, but it is quite realistic to ensure that their army suffers significant damage. For this programmers who are fighting for good, i.e. quality code, must responsibly choose aids. Arm yourself with the PVS-Studio static analyzer! And also you can watch a horror short film about how the Unicorn PVS-Studio rescues Penguin Linux from the Evil Bug.

Inspired? Then we offer all developers to help the Good! The PVS-Studio team has already made a significant step in this direction by offering a free version of the analyzer .

Picture 6


Dear programmers, we wish you good luck in the New Year and may your stories about Malicious bugs always end with the victory of Good!

Source: https://habr.com/ru/post/318312/


All Articles