Not Logged In Log In   Sign Up   Points Leaders
Follow Us    2:03 PM

Message Forum - Read Message

Category: Suggest a GasBuddy improvement > Topics Add to favorite topics   Post new topicPost New Topic
Author Topic: Corruption detector for mobile apps. Back to Topics
CampKohler

Champion Author
Sacramento

Posts:11,548
Points:1,845,290
Joined:May 2007
Message Posted: Jan 3, 2013 5:55:33 PM

There should be some code in the apps that checks the other code in the apps (as installed) to determine if it has become corrupted. If the checksum (or whatever method is used) finds that an app is corrupted, it could notify the user to reload the app.

Even if the code to do this is as big as the app itself, there is so much storage available nowadays that it would be worth it to know that the app is intact. I have had the iPhone app begin failing (fixed by reloading it) and who knows how many others have experienced the odd behavior without knowing if something is really wrong or not. If the app was intact AND there were still problems reported, GB wouldn't have to wonder if it's real and they would be that much closer to solutions.
REPLIES (newest first) Post a Reply
Profile Pic
CampKohler
Champion Author Sacramento

Posts:11,548
Points:1,845,290
Joined:May 2007
Message Posted: Jan 28, 2013 2:23:03 PM

rocknvox: Ah, there's the problem—you're on the wrong site. You need Twitter: the whole world in 140 chars or it's just not worth your time.

GoGo: As you say, the data varies, so why should it be included in the check sum? Rather check only that which is, after installation, unchangeable.

Wouldn't it be interesting if the apps did that automatically and, in addition to warning the user, reported to GB the number of corrupted chars? GB could then see the overall corruption rate of all installs and know how serious a problem it was.
Profile Pic
rocknvox
Champion Author Bakersfield

Posts:2,185
Points:437,370
Joined:Nov 2012
Message Posted: Jan 28, 2013 11:13:35 AM

how about shorter or limited length messages. some people with too much time go on and on, often restating the same point.
Profile Pic
GoGoGoodyear
Champion Author Los Angeles

Posts:3,455
Points:691,060
Joined:Mar 2010
Message Posted: Jan 9, 2013 7:56:56 AM


Nothing wrong with the idea CK, just that your explanation suggested some over-engineering usually reserved for mission critical uses.

Once installed the file(s) which contain program instructions are generally not written to again, only read from the storage medium to launch the program. This makes it less likely that the program instructions file(s) will become corrupted. Since the program instructions file(s) are static and unchanging it is possible to employ various methods to calculate their contents, store the calculated check value and compare them again at any time to detect corruption.

A program's developer could include a routine that calculates the check value on program startup and compares it with the value calculated by the developer when the program was released, which should not change. A mismatch could warn the user that the program needs to be reinstalled or take some other action.

Because the data used by a program is changeable, any calculated check value must be re-calculated each time the contents of a data file changes. This makes it more complex but not undoable. Because the data file(s) are written to, and usually often, they are more likely to be corrupted by system errors, power glitches etc.

A developer could also include a routine as part of a program that re-calculates a check value after each time a file is written to, or once when the program shuts down after use. The biggest problems here is it takes development time to create and test these routines, these extra calculations can slow down a program, and there is little return on the developer's investment since corruption seldom happens, and if it does the result for the end user is the same, a program must be re-installed (or restored from a backup) whether it's just misbehaving for an unknown reason or something warns that it has been corrupted.

I've worked on commercially developed software, some of it quite expensive, where the developers didn't even take the time to trap common error conditions so as to provide a meaningful message and either recover from the error or shut down gracefully, leaving it to the underlying programming language to provide it's obscure error code and crash the program.

You can see where i'm going with this, since developer resources here are very thin. Another idea is since there's millions of apps out there for smart phones maybe there's something that scans the program files on the phone and calculates the check values. A subsequent scan would find a program that no longer matches it's previously stored check value and could be considered suspicious or corrupted. Norton and some other utilities can do this on computers.
Profile Pic
CampKohler
Champion Author Sacramento

Posts:11,548
Points:1,845,290
Joined:May 2007
Message Posted: Jan 8, 2013 7:32:58 PM

Let me give my reasoning for wanting to make sure the app is OK when it's behavior suggests something might be amiss. I agree no moon shot or surgical procedure is going to depend upon the GB app working properly, but as I am using it driving around, I don't really want to spend the time in that (moving) environment to run many tests to try to nail down problems (or the lack thereof). I want a simple way to tell me if the app is intact.

As I have personally experienced app corruption that required a new install, I know that an iPhone app is not as likely to survive as a PC app is (I don't believe I have ever have had to download a new PC app; restarting it yes, but re-downloading, no). Without any previous experience in serious programming, I am throwing ideas out how it might be possible to determine an app's condition. I have the feeling that it would not be that hard to do. But just a feeling.
Profile Pic
Gas_Buddy
Champion Author Maryland

Posts:28,548
Points:3,371,100
Joined:Aug 2004
Message Posted: Jan 8, 2013 3:11:55 PM

I have to agree with GoGoGoodyear.

There is way too much overthought in "...have two versions of the apps (I & II, left & right, big-endian & little-endian?), both having a button to activate the built-in code to check the other by comparison with itself."

At least there is to me, especially for what should be (to me) a relatively simple website; post gas prices so others know local prices without unnecessarily driving out of their way, learning gas prices others posted so you're a more knowledgeable shopper, and you get points for your contributions. The suggestion, to me and apparently to GoGoGoodyear, is putting gas price posting on par with major industry level monitoring. Maybe I'm naive about the level of importance for this website (and the mobile apps, but, again, it's seems way too much overthought.
Profile Pic
GoGoGoodyear
Champion Author Los Angeles

Posts:3,455
Points:691,060
Joined:Mar 2010
Message Posted: Jan 8, 2013 5:25:26 AM


You're WAY overthinking it. This isn't a fail-safe mandatory life support system. Digital signature or even checksum verification is sufficient, and it's done all the time on computers and other digital devices.

Basically if a simple check fails, the user can download and reinstall the program (and maybe do a malware scan too) right on the device online.
Profile Pic
CampKohler
Champion Author Sacramento

Posts:11,548
Points:1,845,290
Joined:May 2007
Message Posted: Jan 7, 2013 4:27:14 PM

Another approach would be to have two versions of the apps (I & II, left & right, big-endian & little-endian?), both having a button to activate the built-in code to check the other by comparison with itself. If a difference were to be detected, the user would not know "which of his two clocks was giving the correct time," but he would know to reinstall both. Meanwhile, he could switch to the other app as a backup to get his GB work done.

A variant would be to have a separate checking app whose sole function would be to compare the two main apps. I know what you are thinking, "who is watching the watcher?" A valid question. Perhaps if you put an intentional difference between the two, if it found the exaxt difference, that would be proof that the checker is working. (This starting to sound like a spy thriller where one suspected spy is set to the job of finding a known spy. If he won't, it prooves his own guilt.)
Profile Pic
GoGoGoodyear
Champion Author Los Angeles

Posts:3,455
Points:691,060
Joined:Mar 2010
Message Posted: Jan 5, 2013 11:22:40 PM


Are the GB mobile apps digitally signed by the developer? If so the calculated 'fingerprint' might be used to do that, but usually that only takes place when a program is installed. The dev could include code to re-verify on each startup, and it would only add a small amount to the program size and complexity, but there's no easy way to check for corruption in the variable data that is stored by a program. Errors are more likely to creep into files that contain data which changes just because those files are written to.
Post a reply Back to Topics