August 2, 2011

New Tool Allows Users To Save Data Before Crashing

MIT researchers have developed a new tool that allows computer users to save data and finish tasks before a computer crashes.

Stalled programs go into what computer scientists call an infinite loop, where it keeps executing a single block of code over and over. 

The researchers said at the 25th European Conference on Object-Oriented Programming in Lancaster, England in July that they have developed a new tool that automatically interrupts infinite loops and moves on to the next line of code in the computer program. 

The team's system restores five different programs to enable users to save data and programs to be exited safely.  The programs also provides a partial solution to the computations they were trying to perform when they got hung up.

Loops allow a programmer to specify a single procedure that has to be performed on many pieces of data in sequence.

A commercial program might contain tens of thousands of loops, and a slight error in the code for any one of them could lead to an infinite loop, which causes crashes.

Computer science professor Martin Rinard and his graduate students Michael Carbin, Sasa Misailovic and Michael Kling developed a tool they call Jolt, which recognizes infinite loops by monitoring the program's use of memory.

Jolt could be activated by a user that believes their computer has entered an infinite loop.  Jolt then takes a series of "snapshots" of the computer's memory after each iteration of the loop.

"The snapshots could be completely different," explains Carbin said in a press release. "That can be an indicator that your program is computing. It may be doing something useful for you, so maybe you don't want to break out of this. But if it's not, and it has exactly the same state, then clearly it's stuck in an infinite loop."

Jolt is a program that translates code written in a high-level programming language into rudimentary instructions that a computer can understand.

The program marks the beginning of ends of all the loops indicated in the source code, then forces it to skip ahead to the first instruction following the loop it is stuck in.

Carbin said keeping tabs on all the loops in a program causes it to run 7 or 8 percent slower.

CSAIL researches are working on a version of Jolt that operates directly on compiled applications, whose instructions consist entirely of fixed-length sequences of binary numbers.  The researchers call this binary version of Jolt, "Bolt".

Bolt also uses an infinite-loop detection mechanism, but works with binary files.  The challenge for Bolt is determining what function to jump to once a loop has been identified. 

Kling developed an algorithm that can identify the highest-level function in operation at a given time, which could help Bolt orient itself.

The researchers say randomly modifying code on the fly is an approach that has prayed off for the group.

"The vast majority of software engineering or programming-language researchers are shackled to this notion of full correctness or full soundness: You can't change anything in the program if there's even the possibility of getting a slightly wrong answer," Westley Weimer, an assistant professor of computer science at the University of Virginia, said in a press release.

"One of the things that's really characterized Martin's research over the last 10 or 15 years is casting off the shackles of soundness in favor of approaches that are probably correct but dramatically more useful in real life."

Weimer said that determining what instruction to jump to is a "difficult" problem.

"I know for a fact that he'll never be able to get it exactly right." But, Weimer says, "The vast majority of infinite loops he will be able to figure out."

He said there might be a few instances where Bolt will guess wrong, "But the comparison "” and this is important for this kind of work "” is that if he doesn't jump, you're stuck in an infinite loop. The comparison is not that it was working fine and he messed it up."


On the Net: