In a method for the controlled execution of a program (26), the program (26) being intended for a virtual machine (VM, VM′), on a portable data carrier, wherein the data carrier has a processor that executes at least a first and a second virtual machine (VM, VM′), the program (26) is executed both by the first and by the second virtual machine (VM, VM′). If, during execution of the program (26), a difference is found between the operating state of the first virtual machine (VM) and the operating state of the second virtual machine (VM′), execution of the program is aborted. A data carrier and a computer program product exhibit corresponding features. The invention provides a technique for the controlled execution of a program, which technique prevents security risks due to an attack or a malfunction of the data carrier.