The only way this would be valuable for every day use would be for programs that produce "close" output. Think of things like large scale simulations where sub-simulations might go infinite, but if they do and this causes the output of the sub-simulation to change, it isn't likely to cause major changes in the macro-simulation. Very little code is written that way, but when code is written that way, it allows much mo…
MIT develops new tool that can interrupt infinite loops
41–50 of 72 posts
Re: MIT develops new tool that can interrupt infinite loops
#42Not even a single mention of the halting problem?
I was surprised too. I expected a mention of it, and a link to the poetic and intuitive proof-story of why its a problem would be good for the story too. In case other HNers haven't read Scooping the Loop Snooper, I (re)submitted it: http://news.ycombinator.com/item?id=2838488
Re: MIT develops new tool that can interrupt infinite loops
#43Earlier quoted context omitted.
Basically the halting problem states that it is impossible to determine whether or not a given program halts under the assumption that it is executed in a turing complete machine. Due to the fact that a program is a composition of programs which at the lowest level are loops and instructions this also means that it is impossible to determine whether or not a loop halts.
Due to the fact that a program is a composition of programs which at the lowest level are loops and instructions this also means that it is impossible to determine whether or not a loop halts. It is easily provable that this is theoretically possible, but the required time is too long for it to be applicable. Suppose your memory has N states. Run your program through N+1 computation steps and if it's not already fini…
Re: MIT develops new tool that can interrupt infinite loops
#44Not even a single mention of the halting problem?
Noob question time: what's the halting problem?
However, the actual halting problem is moot in most of the references I see to it, as the halting problem is usually misused by the half-educated to make claims that 'nothing useful can ever be inferred about the behavior of any program, ever'.
For example, we built a tool to either estimate a reasonable ceiling on the stack usage (whole-program) or give up; it works very well and can detect when the structure of the program prevents this tool from operating correctly (nasty stack mischief or stack adjustments appearing in 'unusual' places). Quite useful for us, especially because we control the source code and know that we don't do naughty things to our own stack.
Entertainingly, on the way to build this tool, we encountered at a couple screeds about how this problem just plain can't be solved because it's equivalent to 'solving the halting problem'. Well, yes - in theory, but no - in practice.
Re: MIT develops new tool that can interrupt infinite loops
#45But going to the next line...
Re: MIT develops new tool that can interrupt infinite loops
#46Earlier quoted context omitted.
Noob question time: what's the halting problem?
The halting problem is an profound bit of theoretical CS well-explained on this thread. However, the actual halting problem is moot in most of the references I see to it, as the halting problem is usually misused by the half-educated to make claims that 'nothing useful can ever be inferred about the behavior of any program, ever'. For example, we built a tool to either estimate a reasonable ceiling on the stack usage…
Re: MIT develops new tool that can interrupt infinite loops
#47Earlier quoted context omitted.
Due to the fact that a program is a composition of programs which at the lowest level are loops and instructions this also means that it is impossible to determine whether or not a loop halts. It is easily provable that this is theoretically possible, but the required time is too long for it to be applicable. Suppose your memory has N states. Run your program through N+1 computation steps and if it's not already fini…
def is_collatz(n): s = set() while n not in (1, 2, 4): if n % 2: n = 3 * n + 1 else: n /= 2 if n in s: # Non-Collatz loop return False s.add(n) return True This is theoretically bounded far below modern memory limits. Feel free to tell me the first natural number for which it returns False. :3
Secondly, you're making the logic error A => B implies not A => not B. If state spaces as large as modern memory limits allow are too large, that doesn't imply that state spaces far below modern memory limits are small enough to handle.
Thirdly, your program trivially terminates doing nothing.
Re: MIT develops new tool that can interrupt infinite loops
#48As the economist famously joked in response to 'how are you'... "Compared to what?" The comparison here is to killing the program and losing all the data.
Obviously there are some big limitations on this - especially given that the state of the program isn't necessarily entirely defined in terms of the process itself, but also a series of possibly stateful network connections and os resources.
Another big limitation is that a straight-up infinite loop at the level of the binary isn't necessarily the only way that a program could get stuck - we could be going around quite a complex loop at the binary level in response to an _interpreted_ loop, and killing the whole interpreter isn't necessarily going to return the program into a usable state.
That being said, what else are you going to do in this case? A number of the alternate solutions here seem to involve time travel.
Some fun possibilities - if you can replicate the OS state, and there's no important network state held open by the program, you can make a bunch of copies of the broken program and try lots of different approaches. You might also be able to fire up the program cleanly, get to the main event loop, identify what that looks like, and just magically splice that state back on top of the broken program in the hope that whatever is happening in global data structures is self-contained enough to recover from.
I understand that there are many reasons why this probably won't work... that being said, the baseline here is zero (especially if the users are made very aware that this program isn't a safety net of any kind and don't become more careless thinking that there's a magic 'fixit' program out there).
Re: MIT develops new tool that can interrupt infinite loops
#49Earlier quoted context omitted.
Noob question time: what's the halting problem?
The halting problem: Given a program and an input, determine whether that program, given that input, will ever halt, or if it will loop infinitely. One of the fundamentals of academic computer science is learning that it is mathematically impossible to solve the halting problem - which is why the grandparent comment simply notes "the halting problem" with no further explanation; it's a famous problem. (Don't feel bad…
Re: MIT develops new tool that can interrupt infinite loops
#50Earlier quoted context omitted.
The halting problem is an profound bit of theoretical CS well-explained on this thread. However, the actual halting problem is moot in most of the references I see to it, as the halting problem is usually misused by the half-educated to make claims that 'nothing useful can ever be inferred about the behavior of any program, ever'. For example, we built a tool to either estimate a reasonable ceiling on the stack usage…
That problem gets hard very quickly when you deal with recursion. How did you deal with that? (if you did)
We have a 'little bit' of recursion where we know that we won't go around the recursion more than once and we've hand-hacked that it. We have similar hacks to deal with indirect calls.
I'm not saying we've solved the problem for arbitrary code; I'm saying that solutions that fall very far short of solving problems for arbitrary codes are still enormously useful. Many compiler optimizations don't work for 'arbitrary code' either, for example, and know just enough to bail out when they see an irreducible flowgraph or a bizarre indirect jump, etc.