Eli5 why does a program/app “hang up” and fail to load, but trying again makes it happen?

523 views

Eli5 why does a program/app “hang up” and fail to load, but trying again makes it happen?

In: Technology

4 Answers

Anonymous 0 Comments

That can have a plethora of reasons.

For example an app may need access to some online service in order to load data. If that service is unavailable or some error occured during the connection process then this app may end up in a state that it can’t recover from.

Usually software developers try to prevent the program from ensing up in such states but some things may go untested or may have been untestable with the environment the developer had to work with.

Restarting the app gets it out of this state and then the aop can receive a proper response from the online service.

One example from a recent project I worked on: I had to address several devices by doing a search over the entire possible address space of these devices. Each time the program would send out the question “are there any lights below address X?” And all devices either answered “yes” or didn’t answer if their address was higher (or if they didn’t participate in the process).

Now the problem here is, if one device is not fully functional at one point and gets out of sync with the others then this “yes” may end up corrupting the signal for all other “yes” responses as they all answer simultaneously. Now if this device corrupts the signal within the search process then the program can end up writing addresses to non-existent devices and end up taking longer (or theoretically infinite) to end the search process.

Restarting can make them sync up again and thus fixes the problem at hand.

Some of these “edge cases” simply can’t be tested well enough within a small environment. For example if you only have 3 devices to test, then you can’t necessarily encounter edge cases that exist with hundreds of devices. Your app works fine in your environment but only because you didn’t test for such edge cases.

Anonymous 0 Comments

No 5 year old could understood that easily, but here i go…

Sometimes when a code is running a lot of stuff can go wrong. Errors are common and even expected in every program, but the developers will not usually “catch” and deal with them all, since everything could happen. Most of code is usually made with a certain expectation in mind but sometimes some rare thing happens to mess with the programs “plan”. The important thing is that when a program runs, two things are going on where error is prone to appear. First, you got the executable code, which is always the same. This executable is the stuff you download and install in your computer. So, when you start this executable, it will load some data from your computer storage to your computer’s memory. The data in memory will change according to your input, what you click, what you type, etc. The data in memory is not saved sometimes, kinda like when we used to play games without a memory card in the PS2. Sometimes, there can be an error on this memory, and the whole process will be compromised because it will not be able to comprehend the data and parse it, although it may try, and from them we can have all sorts of errors. Some viruses use this unpredictability to make the process go so wrong it does something it is not supposed to. I this case, restarting the app will force the process to generate all of the memory data again. Also, if the memory data gets saved in your storage to be loaded in the future, some errors may persist. Some apps are smart enough to delete corrupted data from storage once they’ve detected an error, but others will require a full reinstall, following the same logic.

Anonymous 0 Comments

Lots of reasons. An app may want to “phone home” and look for updates before continuing and your internet connection isn’t good. App appears to hang. App may need more memory and the OS is busy with all the other apps and is thrashing. Your app appears hung. Every resource your app needs from network to memory or screen or storage it has to call the operating system and typically wait. Then again it may have crummy code and certain startup conditions get it confused and in some infinite loop or deadly embrace for resources and appear unresponsive. You restart it and it detects a failed start and defaults to a common startup conditions and works. Hard to tell, really.

Anonymous 0 Comments

There’s a lot of reasons why, but it usually boils down something like:

– the app is waiting for something to happen that never will (ie, because it physically can’t, or because it already happened)

– the app gets stuck in a loop or trips a fatal error, due to a rare set of circumstances (ie, some data gets corrupted while loading, or a timestamp that has a decimal value of 0)

– the app encounters a memory conflict, (ie tries to use a piece of RAM that’s supposed to be empty but is actually being used by another program, so they fight in the background until the system locks up.)