Slashdot Mirror


Hindsight: Reversible Computing

One of the more interesting tech pieces that came out this week has been Hindsight [PDF]. Hindsight is made by Virtutech and is billed as the "the first complete, general-purpose tool for reverse execution and debugging of arbitrary electronic systems." The demos were received extremely well and it just looks cool.

23 of 178 comments (clear)

  1. UI by GigsVT · · Score: 5, Interesting

    They say the way they accomplish this is running the program in some sort of sandbox and taking checkpoints every so often and then when you step back, it actually runs forward from the closest checkpoint and stops one instruction short.

    My question is how UI interactions are handled. If the execution between the checkpoint and current-1 instruction includes a UI interaction, it might be very confusing to the programmer to know what or how many UI interactions need to be carried out to accomplish the backstep.

    --
    I've had enough abrasive sigs. Kittens are cute and fuzzy.
    1. Re:UI by lazer_nm · · Score: 1, Interesting

      well, i dont know, i am embedded programmer, and as the flyer says, finding what happened when is a crucial part of our life. I always use Lauterbach debugger with ETM (enhanced Trace Module) to do my set of debugging, and ofcourse, I can reset what ever I want and step as much back i need to, without the "reverse gear"

    2. Re:UI by TuringTest · · Score: 2, Interesting

      Furthermore, this won't work for finding bugs on concurrent programs due to race conditions or parallel threads corrupting a shared resource.

      Those bugs might be catched if the environment would record instructions one-by-one, but as is you may find a bug in your execution, roll back to the checkpoint and find that the bug is gone in the replay. Hey, that would be funny if it happened on a TV football game...

      --
      Singularity: a belief in the "God" idea with the "demiurge" relation inverted.
    3. Re:UI by DanShearer · · Score: 2, Interesting

      The beauty of full systems simulation is that you are simulating the full system :-) So UI interactions also take place in the simulated world.

      The trick is to have a simulator fast enough so that you can do UI interactions, because the user isn't in the simulated world. As it happens Simics is fast enough and this is exactly how it works. I'm on the Simics product team, and one way we have of proving the point is to run operating systems and their applications backwards for which we cannot have the source code, eg Microsoft Windows. If someone still thinks we've inserted magic tricks after seeing CLOCK.EXE launched, run backwards and then unlaunch, well, there's not a lot more we can do. That also illustrates the point of the whole computer plus OS running backwards, not just a particular application.

      You can get humorously stuck actually with UI interactions... if you run forward to a certain point going point click etc, and then have an animated discussion with somebody for five minutes having forgotten to pause the simulation... unless you do something clever when you engage the reverse gear you have to sit and wait for nothing to un-happen for five minutes until you see the UI get reversed!

      --
      Dan Shearer
  2. "Last Technical Hurdles"? by Catiline · · Score: 1, Interesting

    Yeah, I can see some technical hurdles here ... like storing all old variable/register contents, jump addresses, etc.

    How in the world did they pull this off?

  3. But what about external events by bangzilla · · Score: 4, Interesting

    It's all very well to be able to run code backwards/forwards/slo-mo/etc, but how to handle non deterministic external events coming in from the network? Does this tool presume that all applications to which it will be applied live in isolation?

    --
    Rich people are eccentric. Poor people are strange. Me, I'd be happy with odd.
    1. Re:But what about external events by G.+W.+Bush+Junior · · Score: 2, Interesting

      Then the example in TFA is pretty bad.
      It's exactly an example of an external packet containing a wrong checksum.

      If the system is in isolation, you would have to come up with the idea of sending a malformed packet yourself instead of just letting it run until it crashed. that doesn't seem a very likely thing to try.

      --
      "I don't know that Atheists should be considered as citizens, nor should they be considered patriots." -George H.W. Bush
  4. Re:That's just nutty... by frobnoid · · Score: 2, Interesting

    Take a look at
    http://www.lambdacs.com/debugger/debugger.html I'm sure a Hindsight sales person would (correctly) say this isn't a complete solution, but its the closest thing I've seen before this article.

  5. Not by a decade. by Murmer · · Score: 5, Interesting
    This technology has existed, in GPL form, for ten years. It's just had exactly zero uptake.

    I read this usenet post every now and then when I'm trying to fix something, and it makes me want to cry every time I do.

    --
    Mike Hoye
  6. Reverse Execution of Code? Haha! Oh wait... by AceJohnny · · Score: 2, Interesting
    We've seen a few april fools claiming to be able to run code backwards. This is impossible, at the lowest level. For example, take the logical OR: C = A + B (excuse the layout, the top line is the value of B, the first column the value of A)
    A\B | 0 | 1 |
    0 | 0 | 1 |
    1 | 1 | 1 |
    We know the result, C. How do we know if A, B, or both was 1? We lost information (2 bits of info became 1), and cannot get it back. So at first I dismissed any ridiculous claims of reverse execution. But we aren't the 1st of April...

    Hindsight seems to work based on a checkpoint mode when running backwards, it goes back to a checkpoint then runs forwards to the expected point. However how does it work with hardware?
    Anybody tried this out for real?
    --
    Misleading titles? Inflammatory blurbs? Keep in mind that Slashdot is a tabloid.
    1. Re:Reverse Execution of Code? Haha! Oh wait... by 0x461FAB0BD7D2 · · Score: 2, Interesting
      How do we know if A, B, or both was 1?

      There is a way to do this, although it is a bit ugly. The reverse-runner forks the program into 3, one for each of the possibilities. It then continues this until values have been solved.

      It would produce a decision tree, and the debugger could work backwards.

      Of course, this is purely theoretical. If A and B were strings, the number of processes would be infinite, in which case heuristics would be required, and it wouldn't be perfect.

  7. OCaml anyone? by fab13n · · Score: 4, Interesting
    OCaml as been offering timestamps and backward debugging for years, in addition of a great programming language (backward debugger's implementation is based on Unix's forking and copy-on-write, so running it on windows requires cygwin). Simply compile your stuff to byte-code rather than with the native optimizing compiler, run the debugger and use backstep/backward just as you used to do with step/forward. Breakpoints block execution in both directions.

    And what about GUI and other side effects? Debugging a program in which such side-effects are deeply interleaved with algorithmics can be tricky indeed, although smart timestamping from the debugger will reduce glitches. But if you don't know better than randomly mixing algo and front-end in the first place, then you'd better fix the programmer than the program...

  8. Re:hrmmm by Anonymous Coward · · Score: 1, Interesting

    Uhh, ladebug on Tru64 has this `snapshot` and rewind feature..this isnt new. Congrats on getting an x86 version going, but lets not pretend you invented the concept.

  9. Any relation to ReVirt? by eddy · · Score: 4, Interesting

    ReVirt:

    The ability to replay the execution of a virtual machine is useful in many ways besides intrusion analysis. For example, it enables one to replay and debug any portion of a prior execution. We have built an extension to gdb that uses virtual-machine replay to provide the illusion of time travel. In particular, we provide the ability to do reverse debugging, though commands such as reverse watchpoint and reverse breakpoint. graph. See our paper in USENIX 2005 for details.

    --
    Belief is the currency of delusion.
  10. Elephants never forget by same_old_story · · Score: 5, Interesting
    John McCarthy has been talking about giving programming langues the notion of time for quite some time (no pun intended).

    In this paper, he proposes the Elephant language that can refer to the past in computer programs.

    Pretty cool stuff!

  11. Is This Really New? by Ginnungagap42 · · Score: 3, Interesting

    I remember that several of the older compilers like Borland's Turbo Pascal, Turbo C and Microsoft C and MASM could run reverse execution through the debugger. They also had the "animate" feature that let you step through the code automatically, but slowly so you could watch each line of code as it was executed. I remember setting my PC up with two video cards: a monochrome Hercules card and an EGA card. A lot of the compilers from those days supported mutiple graphics card output - the code would appear on the monochrome monitor and the running executable would appear on the color monitor.

    Being able to trace backwards ware extraordinarily useful, and it's one thing I miss in modern compilers. I always assumed that this capability was taken out with the advent of event-driven (GUI) programming. That's when a lot of this kind of functionality seemed to disappear.

  12. Obligotory jwz reversible gdb link by Anonymous Coward · · Score: 1, Interesting

    A while ago there was a jwz post about being able to run a debugger backwards (for some reason I thought this needed kernel patches). If the checkpointing happened at "machine" level this would be possible regardless of the language...

    (Actually someone has already posted the links jwz was talking about)

  13. Where do they store the entropy? by goombah99 · · Score: 2, Interesting
    If computing is reversable then the system is not losing information. All that entropy has to go somewhere. while built up heat can radiate away on the fan, the entropy must keep building up. At some point its going to explode!

    more seriously, that would mean that there is no crypto on these machines since all encoding would be reversible.

    --
    Some drink at the fountain of knowledge. Others just gargle.
  14. Re:That's just nutty... by VAXman · · Score: 3, Interesting

    The only way to "back up" execution is to save your state as you go.

    At first I wasn't sure that your statement was true, but after thinking about it for 30 seconds or so, I realized it definitely was. Every instruction produces a deterministic calculation and can be reversed, right? If we have "ADD EAX, EBX", and know the current values of EAX and EBX, going backwards is easy, right?

    Well, one really difficult case is jumps. How do you know what the previous instruction executed was? On X86 this would be pretty difficult since the encodings are non-regular, but even on an ISA with regular encodings it would be non-trivial because it would be difficult to figure whether you got to the instruction via a jump (which could be anywhere in memory), or from the previous instruction.

    Add things such as Self-Modifying Code, and you have a real headache. Yes, you definitely need to track state as you go, though I'm not sure you'd need to save anything more than just the Instruction Pointer (which X86 does have a mechanism for). If you know what instructions were executed, it should be pretty easy to backtrack in time. I think.

  15. Re:Damn misleading articles. by fraudrogic · · Score: 2, Interesting

    ...you can't do the same with most binary operations since all the common ones except NOT...

    I'm not trying to be an ass here, but isn't that why they call NOT a unary operation, because of one operand?

    --
    I only mod up parents of "mod parent up" posts...
  16. Re:That's just nutty... by Hynee · · Score: 3, Interesting
    The only way to "back up" execution is to save your state as you go.
    At first I wasn't sure that your statement was true, but after thinking about it for 30 seconds or so, I realized it definitely was. Every instruction produces a deterministic calculation and can be reversed, right? If we have "ADD EAX, EBX", and know the current values of EAX and EBX, going backwards is easy, right?

    Try this UTM program:

    Set A and B to the values 1 and 2
    Add values of A and B and put them in C
    Put value x1 and y1 into A and B

    Now, what UTM's could leave a machine in this state? Remember the states of the Universal Turing Machine are A, B, C, not what's written on the tape, i.e., the instructions.

    The answer is, of course, a whole lot, but one simple subset of programs that can leave C in this state is any program like the above one, except the first instruction is Set A and B to values x0 and y0, where x0+y0=1+2=3, which is infinitely many, eg, 2+1=3,3+0=3,4+-1=3, etc. So that's infinitely many programs with the same form as the actual program, but with only a couple of constants changed.

    (Note: true Turing Machines states aren't limited to a fixed set, like 0-255 etc, they use an encoding like 0100,1100,110100,111100, which can accomodate any size of number.)

    That doesn't quite answer why it's generally complex to run a computer backwards, but you can put any number of instructions in between step 2 and 3, and as long as they don't touch A and B, once you've gone past that last instruction, you have no clue what states A and B were in until you go all the way back to the start of that program.

    I guess a good checkpointing algorithm would be to save the states of any registers that are overwritten.

    --
    Damn, I already moderated this topic. Now I'll have to log in with my sock puppet to comment.
  17. There are a few issues but... by Morticae · · Score: 2, Interesting

    Since this appears to be a sandbox tool, what's the problem? The only real problem I can see, and that people bring up (since everything else is deterministic in a closed environment) would be random or psuedo random number generation. Could it not (or does it) simply save the results of system clock queries? Since the system clock is used to seed most random number generators, saving the return values and feeding them back could eliminate the problem. Clearly in encryption intensive programs this would act like some kind of memory bomb, but it would solve probably 99.9% of applications. As a safeguard, it could simply be alloted a certain area of memory that, once filled, would return to a 'closest fit' senario.

  18. Replay with nondeterministic events by DavidHopwood · · Score: 2, Interesting

    It is possible to replay the execution of programs that communicate with the outside world, rather than just in an isolated virtual machine: you have to log nondeterministic events. See http://www.erights.org/elang/concurrency/determini sm/overview.html.

    The first language I know of that supported replay is the Abundance database language, back in 1986. Also see http://c2.com/cgi/wiki?ReversibleProgrammingLangua ge.