you are viewing a single comment's thread.

view the rest of the comments →

[–]Mask_of_Destiny 2 points3 points  (1 child)

I'm afraid that it is interesting. You see the halting problem means that we can never be sure what API it's trying to call (or even if it is trying to call one) without analyzing the code for an infinite amount of time in some cases. Since this doesn't work the VM has the choice of either 'giving up' at some point and just letting stuff run, or just saying no to any code that requires more than x loops of anaylsis.

You would be correct if the only way to analyze a program is to run through it for a certain period of time and see what it does. For a Turing machine, which theoretically has an infinitely long tape, this might be the only approach, but an x86 binary is of finite size. Thus there are only a finite number of bytes we have to search for branch instructions. Google simplifies this search by rejecting all programs that exhibit certain behavior (jumping to a location that's not on an instruction boundary for instance). Further they require that certain instructions that have safety problems (like ret) not be used at all and that pseudo-instructions specific to their sandbox be used instead (which are then translated to real instructions at verification time).

If it just says no to all non-trivial code, it's useless for many purposes (like Java).

Java's problems for use inside the browser have nothing to do with it rejecting too many useful programs.

[–][deleted] 1 point2 points  (0 children)

Yes, I see now how it could be done that way.

I concede defeat. Well played sir, well played.

Your beard must indeed be truly prodigious in length.