Patent Description:
Lockstep systems may be fault-tolerant computer systems that run a same set of operations on two different hardware systems at the same time in parallel. Present approaches to lockstep systems suffer from a variety of drawbacks, limitations, and disadvantages.

The relevant background art is represented by <CIT>.

The present disclosure provides a method as detailed in claim <NUM>. Also provided is a computer program according to claim <NUM> and a system according to claim <NUM>. Advantageous features are provided in the dependent claims.

The embodiments may be better understood with reference to the following drawings and description. The components in the figures are not necessarily to scale. Moreover, in the figures, like-referenced numerals designate corresponding parts throughout the different views.

Systems and methods of detecting a difference in behavior of processes operating in lockstep are provided. Differences may be detected by comparing operating system programmatic procedure invocations made by the processes.

For example, two or more copies of the same software may execute on different cores of a multiprocessor and the operating system calls made by each copy of the software may be compared to confirm each copy of the software behaves the same as the other copy or copies. Such systems and methods may be applied, for example, in a safety system where essentially non-detectable, non-deterministic hardware errors may occur (in other words, an error may occur in any processor and be a non-deterministic hardware error that may be difficult to detect without the systems or methods described herein).

In the non-coupled software lockstep system, the system may check whether two identical applications are running in substantially the same way. Such a redundancy based system may detect faults (potentially even transitory faults) in hardware that may otherwise go unnoticed, but yet lead to unintended results. For example, a bit flip caused by a single event upset may lead to an incorrect result. (A single event upset is a change of state caused by one single ionizing particle striking a sensitive node in a micro-electronic device, such as in a microprocessor, a semiconductor memory, or a power transistor. ) If only one copy of the application is executing, then the incorrect result may not be found or noticed. However, if two identical copies are executed and the outputs are different, the incorrect result may be noticed or detected.

The copies of the application may execute on a single computing device. Alternatively, each copy of the application may execute on a different computing device. If the copies of the application execute on the single computing device, processor affinity or core affinity may cause each copy of the application to execute using a different hardware than the other copy or copies. Processor affinity enables the binding and unbinding of a process or a thread to a central processing unit (CPU) or a range of CPUs, so that the process or thread will execute only on the designated CPU or CPUs rather than on any CPU. Techniques such Lamport's logical clocks may be used to ensure that the copies of the applications receive common inputs when reading from resources, such as hard drives and network resources.

Although traditional lockstep systems may only execute one set of operations on two different hardware systems, here both copies of the application may be run on common hardware, such as a single processor and/or a single core, in some examples. In such examples, the execution of the copies of the application may be separated by time instead of hardware. Also in such examples, the system may detect "soft" or transient errors but not likely "hard" or permanent errors.

If the operating system is a message-based operating system, simple calls to the operating system often cause messages to be moved between threads, processes, a microkernel and drivers. All or most requests to the microkernel are messages. In some examples of the message-based operating system, all or most data exchanges between processes are triggered by messages, and all or most events are messages. The term "most" means a majority or greater than <NUM> percent. Messages are commonly generated when invoking programmatic procedures of the message-based operating system even though the application invoking the programmatic procedure may be unaware of the messages.

In the non-coupled software lockstep system, a difference detector may execute on the same processor as the copies of the application. Alternatively, the difference detector may execute on a different processor than the copies of the application. The difference detector may observe the sequence of messages and the contents of those messages and ensure that message sequences and message contents are identical or nearly identical for each of the copies of the application. In the non-coupled software lockstep system, identical copies of the application may run independently of each other without synchronization points between the copies of the application. In other words, the application may not need to be programmed to identify any synchronization point or compare results at a synchronization point. If the message sequence varies between the two identical application copies or the contents of the messages vary between the two identical application copies, the difference detector may determine that the identical copies of the application are not acting or behaving identically and that likely an error has occurred. The difference detector may report the error (or difference) to a supervising application. The code in the copies of the application may not have to identify a location in the code where outputs of the copies of the application may be compared. In other words, the application does not have to be modified or be originally written to address synchronization points. Instead, the application may be unaware that any operating system call will be compared with an operating system call made by a second instance of the application.

The non-coupled software lockstep system may enable, in some examples, the copies of the application to execute on normal multi-core commercial processors running at normal speeds. In other words, no specialized hardware may be needed, and the copies of the application may execute in a production environment as well as in a test environment.

<FIG> illustrates an example of a non-coupled software lockstep system <NUM> configured to detect differences between outputs of processes <NUM> (designated P1 and P2 in <FIG>). The process designated P1 may execute the same code as the process designated P2. The system <NUM> may detect any difference between the outputs of the processes <NUM> by comparing calls (programmatic procedure invocations) made by the processes <NUM> to a message-based operating system (OS) <NUM>.

The system <NUM> may include a difference detector <NUM> that executes within the OS <NUM>, or alternatively, as shown in <FIG>, as a process that executes outside of the OS <NUM>. The OS <NUM> depicted in <FIG> is a message-based operating system. The message-based operating system handles invocations of operating system calls by processing corresponding messages from the processes <NUM>. Incidentally, the OS <NUM> may also handle invocations of operating systems calls made by the difference detector <NUM>. The OS <NUM> may also handle interprocess communication through a similar mechanism, passing messages between processes over a software bus or a channel <NUM>. The OS <NUM> may include, in some examples, a microkernel <NUM> comprising a message layer (not shown) that implements the message passing functionality of the OS <NUM>.

In addition to interprocess communication, the OS <NUM> may handle internode communication in some implementations. For example, the OS <NUM>, the processes <NUM>, and the difference detector <NUM> may be included on a first node <NUM>, while a second node <NUM> may include an operating system and one or more processes. Any of the one or more processes <NUM> on the first node <NUM> may communicate with a target process on the second node <NUM> by passing a message to the OS <NUM> of the first node <NUM>, which delivers the message over a communication channel <NUM> to the target process on the second node <NUM>.

The nodes <NUM>, <NUM> may be on the same device or, alternatively, on separate physical devices that are in communication over a network. Each node may be an instance of a server, an instance of a virtual machine, a container, a computing device, or any other device on a network, where the device may be real or virtual. Each node may be included in an endpoint. Examples of endpoints include, without limitation, any of the following: mobile devices (e.g., smartphones, tablets, laptops, wearables, gaming devices, navigation devices, cameras, etc.), computers (e.g., laptops, desktops, etc.), loT (Internet of Things) devices (e.g., vehicles, appliances, smart devices, connected devices, buildings including homes, etc.), EoT (Enterprise of Things) devices (i.e., loT devices in an enterprise) and any other nodes or combination thereof. Vehicles includes motor vehicles (e.g., automobiles, cars, trucks, buses, motorcycles, etc.), aircraft (e.g., airplanes, unmanned aerial vehicles, unmanned aircraft systems, drones, helicopters, etc.), spacecraft (e.g., spaceplanes, space shuttles, space capsules, space stations, satellites, etc.), watercraft (e.g., ships, boats, hovercraft, submarines, etc.), railed vehicles (e.g., trains and trams, etc.), and other types of vehicles including any combinations of any of the foregoing, whether currently existing or after arising.

The difference detector <NUM> may include a recorder <NUM>, a monitor <NUM>, and a handler <NUM>. The difference detector <NUM> may receive process invocation information from the OS <NUM>. The process invocation information received from the OS <NUM> may identify the programmatic procedures invoked by the processes <NUM>.

The recorder <NUM> may build a buffer (designated "P1 Buffer" in <FIG>) that identifies the programmatic procedure invocations made by the process P1 to the OS <NUM>. The monitor <NUM> may compare the programmatic procedure invocations made by the process P1 to the programmatic procedures invocations made by the process P2 to the OS <NUM>. For example, the monitor <NUM> may determine if the programmatic procedure invocations made by the process P1 deviate from the programmatic procedure invocations made by the process P2. The handler <NUM> may react to any detected difference. For example, the handler <NUM> may notify a supervisory application (not shown) or otherwise take action in response to the detection of a difference.

More generally, the recorder <NUM> may build a buffer <NUM> that identifies sequences of invocations of operating system programmatic procedures that the process <NUM> makes. For example, <FIG> illustrates two buffers <NUM>, designated P1 Buffer and P2 Buffer, respectively; one buffer for each of the two processes <NUM> illustrated (P1 and P2). In the primary example described below, the recorder <NUM> generates just the P1 buffer and the P2 buffer is not generated. However, in other examples, the recorder <NUM> generates buffers for two or more of the processes <NUM>, including, for example, the P1 buffer and the P2 buffer.

Short sequences of system calls are a good discriminator between normal and abnormal behavior of a process. A collection of the short sequences of system calls made by a process may be a relatively stable signature of behavior of the process.

For a non-trivial software program executing in a process, the complete set of programmatic procedure invocations may be enormous. However, a local (compact) ordering of the invocations may be remarkably consistent over longer periods of operation of the process. An example is provided below to illustrate the operation of the recorder <NUM>.

For example, one of the processes <NUM>, such as the process P1, may invoke the following operating system programmatic procedures in the following order: open(), read(), mmap(), mmap(), open(), getrlimit(), mmap(), and close(). A window size L may be selected, where the window size L indicates the number of sequential invocations to include in the window. The number of invocations k to follow the first invocation in the window (in other words, k is a lookahead size). The window size L equals the lookahead size k+<NUM>. Table <NUM> below illustrates a set of sequential invocations formed with a window size of four (k=<NUM>) as the window slides across the following example sequence of invocations: open(), read(), mmap(), mmap(), open(), getrlimit(), mmap(), and close().

Table <NUM> illustrates the calls (invocations) from Table <NUM> ordered by the first call in the window, and compacted. When compacted, the invocations in a respective position (such as Previous Call, Second Previous Call, or Third Previous Call) are consolidated as being acceptable for that respective position. For example, the following call sequence (ordered from the most recent to the oldest invocation), would be considered found in Table <NUM> even though the same sequence is not listed in Table <NUM>: mmap(), read(), read(), open(). The reason is that read() is considered acceptable at the Second Previous Call position for the mmap() call.

An anomaly or difference in the call sequence made by the process P1 compared to the call sequence made by the process P2 may be detected by sliding a same sized window over the sequential invocations of the operating system programmatic procedures that are made by the process P2 while the process P2 is being monitored. For example, the process P2 may invoke the following operating system programmatic procedures in the following order while being monitored: open, read, mmap, open, open, getrlimit, mmap, close. Table <NUM> below illustrates deviations from Table <NUM> when comparing with a set of sequential invocations formed as a window slides across the sequence of invocations made by the process P2 while the process P2 is monitored. The deviations are shown with capitalization. In other words, "open" is ultimately preceded by "read" instead of "mmap" on the second previous call at line <NUM>; "open" is ultimately preceded by "open" instead of "read" on the third previous call at line <NUM>; "open" is preceded by "open" instead of "mmap" on the previous call at line <NUM>; and "getrlimit " is ultimately preceded by "open" instead of "mmap" at the second next call on line <NUM>.

In the message-based OS <NUM>, most - if not all - of the operating system programmatic procedure invocations are made through corresponding messages sent through the operating system <NUM>. Each of the messages may have a format similar to a message <NUM> shown in <FIG>.

The message <NUM> may include a programmatic procedure identifier <NUM>, a sender process identifier <NUM>, a receiver process identifier <NUM>, a channel identifier <NUM>, a receiver node identifier <NUM>, one or more parameters <NUM> passed to the programmatic procedure or any combination thereof. The message <NUM> may include additional, fewer, or different components. For example, the message <NUM> may include a header <NUM> that includes the programmatic procedure identifier <NUM>, the sender process identifier <NUM>, the receiver process identifier <NUM>, the channel identifier <NUM>, and the receiver node identifier <NUM>. In some examples, the header <NUM> may include an indication <NUM> of the parameters <NUM> passed to the programmatic procedure. For example, the indication <NUM> of the parameters <NUM> may be a fixed size value that includes the first N bytes of any of the parameters <NUM>. If no parameters are passed or less than N bytes of parameters are passed as parameter(s), then the indication <NUM> of the parameter <NUM> may include a place holder, such as zero, in any unused portion of the fixed size value.

The programmatic procedure identifier <NUM> may be any identifier of the programmatic procedure that was invoked. The programmatic procedure identifier <NUM> may be a text name of the programmatic procedure, a numeric value identifying the programmatic procedure, or any other value that identifies the programmatic procedure. For example, programmatic procedure identifiers may be unique numbers that the OS <NUM> assigned to the programmatic procedures of the OS <NUM>.

The sender process identifier <NUM> may be any identifier that identifies the process <NUM> that invoked the programmatic procedure identified in the message <NUM>. Similarly, the receiver process identifier <NUM> may be any identifier that identifies the process <NUM> that is to receive the message <NUM>. For example, the receiver process identifier <NUM> may identify a process executing within the OS <NUM>, any of the processes <NUM> executing on the OS <NUM> or any process on another node. The OS <NUM> may assign static process identifiers <NUM>, <NUM> so that the process identifiers <NUM>, <NUM> remain the same even after a reboot of the nodes <NUM>, <NUM>. For example, the OS <NUM> may assign a unique number or name to a program executable. For example, the "dir" executable, which provides a listing of files on some operating systems, may be assigned the name "dir". Multiple instantiations of a program executable may, in some examples, have additional information added to the process identifier <NUM>, <NUM>. For example, the second instance of the "dir" executable may be assigned "dir-<NUM>" as the sender process identifier <NUM>.

The channel identifier <NUM> may be any identifier that identifies the communication channel <NUM>, <NUM> between the processes <NUM> or between a process and the OS <NUM>. For example, for each communication channel <NUM>, <NUM> that a process creates, the OS <NUM> may assign a sequentially higher number. As an illustrative example, a first channel created by the process may be assigned the channel identifier "<NUM>", the second channel created by the process may be assigned the channel identifier "<NUM>", and so on.

The receiver node identifier <NUM> may be any identifier that identifies the node that is to receive the message <NUM>. Examples of the node identifier <NUM> may include a static network address, a media access control address (MAC address), an Ethernet address, a wireless hardware address, a static Internet Protocol (IP) address, and any other such identifier.

The parameters <NUM> may include a definition of the parameters, such as a data type of each parameter arranged in the order the parameters are passed to the programmatic procedure. The definition of the parameters may be useful in some examples to distinguish between programmatic procedures that are overloaded (multiple programmatic procedures have the same name, but different parameters). Alternatively or in addition, the parameters <NUM> may include one or more actual values passed as input to the programmatic procedure. Alternatively or in addition, the parameters <NUM> may include a reference to a value, which is sometimes referred to as "pass by reference" as opposed to "pass by value".

The difference detector <NUM> may generate (<NUM>) an invocation hash <NUM> based on the message <NUM> or, more generally, based on information identifying the invocation of the programmatic procedure. The invocation hash <NUM> may be a non-cryptic hash of all or any portion of the message <NUM>. Alternatively, the invocation hash <NUM> may be a cryptic hash of all or any portion of the message <NUM>. The difference detector <NUM> may generate the invocation hash <NUM> using any suitable hash function. A hash function may be any function that maps data of arbitrary size to data of fixed size. If the difference detector <NUM> is configured to monitor the processes <NUM> in real-time, then the hash function chosen may be one that completes relatively quickly. The invocation hash <NUM> may be <NUM> bits, <NUM> bits, or any other size.

In one example, the invocation hash <NUM> may be a hash of the programmatic procedure identifier <NUM> and the receiver process identifier <NUM>. Alternatively, the invocation hash <NUM> may be a hash of the programmatic procedure identifier <NUM>, the sender process identifier <NUM>, and the receiver process identifier <NUM>. Alternatively, the invocation hash <NUM> may be a hash of the programmatic procedure identifier <NUM>, the sender process identifier <NUM>, the receiver process identifier <NUM>, the channel identifier <NUM>, the receiver node identifier <NUM>, the indication <NUM> of the parameters <NUM> passed to the programmatic procedure, or any combination thereof. In other words, the invocation hash <NUM> may be a hash of the message <NUM> or any combination of the components of the message <NUM>. The sender process identifier <NUM> may be excluded from the invocation hash <NUM> in examples where P1 and P2 execute on the same node. If the invocation hash <NUM> is based at least in part on the indication <NUM> of the parameters <NUM>, any "pass by reference" indication may be excluded from the invocation hash <NUM>.

The invocation hash <NUM> is an innovative structure that identifies a programmatic procedure invocation. The more components of the message <NUM> passed to the hash function, the more narrowly the programmatic procedure invocation is identified. For example, passing the receiver node identifier <NUM> to the hash function will cause the invocation hash <NUM> to distinguish between invocations to multiple nodes even if the invocations are otherwise identical.

Because the invocation hash <NUM> may be relatively large in size, an innovative translation mechanism is provided. <FIG> illustrates an example of the buffer <NUM> embodying the translation mechanism. As indicated earlier above, the buffer <NUM> identifies sequences of invocations of operating system programmatic procedures that a corresponding one of the processes <NUM> made. In particular, the buffer <NUM> may include a translation table <NUM> (or other suitable translation data structure) and identified call sequences <NUM>.

During operation of the recorder <NUM> of the difference detector <NUM>, the recorder <NUM> may generate the buffer <NUM> for one or more of the corresponding processes <NUM>.

The difference detector <NUM>, and in particular for some examples, the recorder <NUM>, may receive the message <NUM> indicating that a programmatic procedure of the operating system <NUM> was invoked. For example, the difference detector <NUM> or the recorder <NUM> may have registered with a tracing feature of the OS <NUM> in order to receive a copy of the message <NUM> (and copies of other messages corresponding to programmatic procedure invocations) in real time. Alternatively, the difference detector <NUM> or the recorder <NUM> may be part of the OS <NUM> and may be configured to receive a copy of the message <NUM> (and other messages corresponding to programmatic procedure invocations) in real time. In yet another example, the difference detector <NUM> or the recorder <NUM> may read the message <NUM> (and other messages indicating that programmatic procedures of the operating system <NUM> was invoked) from a trace file in real time or any arbitrary time after the programmatic procedure was invoked.

The recorder <NUM> may generate (<NUM>) the invocation hash <NUM> based on the message <NUM> as described above. As described above, generating (<NUM>) the invocation hash <NUM> based on the message <NUM> includes generating a hash of the entire message <NUM> or generating a hash of one or more components of the message <NUM>.

The recorder <NUM> may translate the invocation hash <NUM> to an invocation identifier <NUM>. Like the invocation hash <NUM>, the invocation identifier <NUM> is an identifier that identifies the programmatic procedure invocation. However, the invocation identifier <NUM> is smaller in size than the invocation hash <NUM>.

To perform the translation, the recorder <NUM> may use a translation table <NUM> or other translation data structure. The translation table <NUM> may include rows comprising invocation hashes and corresponding invocation identifiers. To translate the invocation hash <NUM> to the invocation identifier <NUM>, the translation table <NUM> may be searched for a row that has an invocation hash matching the invocation hash <NUM> just generated. If there is such a row, then the invocation identifier <NUM> is read from the row of the translation table <NUM>. Alternatively, if there is no matching entry, then the invocation hash <NUM> may be added to the invocation table <NUM> in addition to a newly assigned corresponding invocation identifier <NUM>. The invocation identifier <NUM> may be any identifier that is unique to the rows in the invocation table <NUM> (or unique to the entries in any other translation data structure).

Alternatively or in addition, the invocation identifiers may be the row numbers in the translation table <NUM>. In such examples, the invocations identifiers may not need to be stored in the rows of the translation table <NUM>. In some examples, the rows may include programmatic procedure identifiers for faster lookup performance. In such examples, rows may be searched for programmatic procedure identifiers matching the programmatic procedure identifier <NUM> in the message <NUM>, and the resultant matching rows may then be searched for the invocation hash <NUM>. If the invocation hash <NUM> needs to be added to such a table, the programmatic procedure identifier <NUM> may be included in the row.

Any other suitable data structure may be used instead the translation table <NUM>. For example, a translation data structure may include a first hash table having a key comprising programmatic procedure identifiers and corresponding values comprising a second hash table. The second hash table may have a key comprising invocation hashes for the corresponding programmatic procedure identifier and values comprising corresponding invocation identifiers.

The invocation of the programmatic procedure identified in the message <NUM> may be one invocation in a series of invocations of programmatic procedures made from the process <NUM> identified by the sender process identifier <NUM> of the message <NUM>. With the invocation identifier <NUM> obtained, the invocation identifier <NUM> may now be included in a translated call sequence <NUM> that comprises invocation identifiers for a series of programmatic procedure invocations. For example, the translated call sequence <NUM> may include invocation identifiers identifying programmatic procedure invocations that occurred before the invocation of the programmatic procedure identified by the invocation hash <NUM> (and by the invocation identifier <NUM>). The number of invocation identifiers in the translated call sequence <NUM> may equal to the window size L.

The recorder <NUM> may determine whether the translated call sequence <NUM> is included in previously identified call sequences <NUM>. Each of the identified call sequences comprises invocation identifiers identifying the programmatic procedure invocations in the respective call sequence. The invocation identifiers in the identified call sequences <NUM> are each mapped to invocation hashes in the translation table <NUM> or other translation data structure. The identified call sequences <NUM> may be stored in any suitable data structure. For example, the identified call sequences <NUM> may be stored in a call sequence permutation table <NUM>. The identified call sequences <NUM> may be a compact set of call sequences. If compact, the identified call sequences <NUM> may indicate, for the invocation identifier <NUM> of the current programmatic procedure invocation, a set of acceptable invocation identifiers for each corresponding previous position in the translated call sequence <NUM>, where the set of acceptable invocation identifiers for any previous position is independent of the sets of acceptable invocation identifiers for the other previous positions in the translated call sequence <NUM>. Accordingly, determining whether the translated call sequence <NUM> is included in the identified call sequences <NUM> may be more involved than looking for a row in a table that matches the content of the translated call sequence <NUM>. For example, the sets of acceptable invocations may be sequentially checked for the previous positions in the translated call sequence <NUM>.

If the translated call sequence <NUM> is not already included in the identified call sequences, then the recorder <NUM> may add the translated call sequence <NUM> to the identified call sequences <NUM>.

The recorder <NUM> may repeat the procedure described above to develop the buffer <NUM> for one or more of the processes <NUM>. When repeating, the invocation identifiers in the translated call sequence <NUM> may be shifted, removing the invocation identifier for the oldest invocation thereby making room for the invocation identifier of the next programmatic procedure invocation.

<FIG> illustrates a flow diagram of example logic of the non-coupled software lockstep system <NUM> configured to detect differences between outputs of processes <NUM>. The logic may include additional, different, or fewer operations.

As the process P1 executes, the P1 buffer <NUM> for the process P1 may start being populated (<NUM>) by the recorder <NUM> as described above. The identified call sequences <NUM> in the P1 buffer <NUM> begins to grow. As the recorder <NUM> generates the P1 buffer <NUM>, the monitor <NUM> may, in parallel, detect invocations of programmatic procedures of the OS <NUM> made by the process P2 and compare with those made by the process P1 that are identified in the P1 buffer <NUM>.

For example, the message <NUM> may be received (<NUM>) by the monitor <NUM> indicating an invocation of a programmatic procedure of the OS <NUM> was made by the process P2. As described above, the message <NUM> may include, for example, the programmatic procedure identifier <NUM>, the sender process identifier <NUM>, and the receiver process identifier.

The invocation hash <NUM> may be generated (<NUM>) based on the message <NUM>. For example, the monitor <NUM> may generate (<NUM>) the invocation hash <NUM> based on the programmatic procedure identifier <NUM>, the sender process identifier <NUM>, and the receiver process identifier <NUM>, or based on any other combination of the components of the message <NUM>. The sender process identifier <NUM> may be excluded from the invocation hash <NUM> in examples where P1 and P2 execute on the same node.

The invocation hash <NUM> may be translated (<NUM>) into the invocation identifier <NUM> as described above. For example, the monitor <NUM> may translate the invocation hash <NUM> to the invocation identifier <NUM> using the translation table <NUM>. If the invocation hash <NUM> cannot be found in the translation table <NUM>, then the invocation identifier <NUM> may be set to a placeholder value that indicates an unknown invocation. The placeholder may guarantee that the translated call sequence <NUM> is not found in the identified call sequences <NUM>.

The invocation identifier <NUM> may be included (<NUM>) in the translated call sequence <NUM>. The translated call sequence <NUM> here is for the process P2. As explained above, the translated call sequence <NUM> comprises invocation identifiers for a series of invocations of programmatic procedures, which in this case, were made by the process P2. If the length of the translated call sequence <NUM> is the window size L before including the invocation identifier <NUM>, then the invocation identifier corresponding to the oldest invocation may be removed to make room for the invocation identifier <NUM> just obtained. Alternatively, if the length of the translated call sequence <NUM> is not yet the window size L, then operations may return to receive (<NUM>) the next message indicating the process <NUM> invoked another programmatic procedure.

A determination (<NUM>) may be made whether the translated call sequence <NUM> for P2 is included in the identified call sequences <NUM> of the P1 buffer <NUM>. For example, the monitor <NUM> may search the identified call sequences <NUM> for the translated call sequence <NUM>. As explained above, such a search may involve, for example, sequentially checking the sets of acceptable invocation identifiers for each position in the translated call sequence <NUM>.

If the translated call sequence <NUM> for the process P2 is not included in the identified call sequences <NUM> of the P1 buffer <NUM>, then the translated call sequence <NUM> may be identified (<NUM>) as a difference or deviation between the behaviors of the process P1 and the process P2. Otherwise, the translated call sequence <NUM> for the process P2 may be determined (<NUM>) to be the same as a corresponding call sequence for the process P1.

If the translated call sequence <NUM> is determined to be the same as a corresponding call sequence for P1, then operations may return to receive (<NUM>) the next message indicating the process P2 invoked another programmatic procedure. However, if the translated call sequence <NUM> is identified as a difference between the behaviors of P1 and P2, then operations may end by, for example, raising an alarm.

Alternatively or in addition, any type of action may be taken if the translated call sequence <NUM> is identified as a difference between the behaviors of P1 and P2. For example, operations may continue to try to detect differences by returning to receive (<NUM>) the next message indicating the process <NUM> invoked another programmatic procedure. The handler <NUM> may process any detected difference between the behaviors of the processes <NUM> by, for example, notifying a supervising application, raising an alarm to an end user, logging the difference, restarting the processes <NUM>, and halting the processes <NUM>.

Furthermore, the handler <NUM> may handle the sensitivity of difference detection. For example, if the translated call sequence <NUM> for the process P2 is identified (<NUM>) as a difference, then the handler <NUM> may increment a counter instead of immediately flagging the processes <NUM> as having different outputs. The handler <NUM> may wait to flag the processes <NUM> as having different outputs until after the counter passes a threshold value.

In the primary example described above, the recorder <NUM> generates just the P1 buffer and the P2 buffer is not generated. However, in other examples, the recorder <NUM> generates buffers for two or more of the processes <NUM>, including, for example, the P1 buffer and the P2 buffer. The monitor <NUM> may then compare the identified call sequences <NUM> in the buffers with each other.

In some examples, the buffer or buffers <NUM> generated by the recorder <NUM> may be trimmed over time in order to keep the buffers <NUM> from growing too large. For example, entries in the buffers <NUM> may be removed if the entries have not been generated or used for longer than a threshold time or if the entries have not been generated or used since a threshold number of calls have subsequently been made by the corresponding process.

The non-coupled software lockstep system <NUM> may be implemented differently than described in <FIG>. <FIG> illustrates a flow diagram of a second example logic of the non-coupled software lockstep system <NUM>.

An invocation of a programmatic procedure of the OS <NUM> made by the process P1 may be detected or captured (<NUM>). For example, the monitor <NUM> may receive the message <NUM> from the OS <NUM> that describes the invocation made by the process P1. The invocation of a programmatic procedure of the OS <NUM> may be referred to as an application programming interface call or API call.

An invocation of a programmatic procedure of the OS <NUM> (API call) made by the process P2 may be detected or captured (<NUM>). For example, the monitor <NUM> may receive the message <NUM> from the OS <NUM> that describes the API call made by the process P2.

The operating system programmatic procedure invocations made by the process P1 and the process P2 may be compared (<NUM>). For example, the monitor <NUM> may generate the invocation hash <NUM> of the header <NUM> and the parameters <NUM> of the message <NUM> for the API call made by the process P1. The monitor <NUM> may generate the invocation hash <NUM> of the header <NUM> and the parameters <NUM> of the message <NUM> for the API call made by the process P2. The API calls made by the process P1 and the process P2 may be compared (<NUM>) by comparing the invocation hashes. If the hashes are the same, then no difference is detected and operations may return to detect (<NUM>) the next API call made by the process P1. Alternatively, if the hashes are different, then a difference may be detected (<NUM>). The process may end, for example, by the handler <NUM> processing the detected difference. The sender process identifier <NUM> may be excluded from the invocation hash <NUM> in examples where P1 and P2 execute on the same node.

Some buffering may occur. For example, if the process P1 makes a second API call before the process P2 makes a first API call corresponding to the first API call that the process P1 made, then the recorder <NUM> may store the invocation hash <NUM> for the second API call made by the process P1 in the P1 buffer <NUM>. Alternatively or in addition, if the process P2 makes a second API call before the process P1 makes the first API call, then the recorder <NUM> may store the invocation hash <NUM> for the second API call made by the process P2 in the P2 buffer.

Alternatively, in order to compare (<NUM>) the API calls, the monitor <NUM> may iterate over one or more of the components of the message <NUM> for the process P1 and compare with the corresponding components of the message <NUM> for process P2 without generating any invocation hashes.

Accordingly, the non-coupled software lockstep system <NUM> may detect a difference if the API calls listed in Table <NUM> below are made by process P1 and process P2, respectively. This is because the API call to read <NUM> characters made by the process P1 is different from the API call to read <NUM> characters made by the process P2. The invocation hash <NUM> for each will be different because the parameter values passed in the API calls are different from each other.

The system <NUM> may be implemented with additional, different, or fewer components. For example, the system <NUM> may be implemented on a traditional type operating system like UNIX instead of a message-based operating system. Programmatic hooks may be registered for all or a subset of the application programming interface of the operating system. The hooks may provide the information that is available in the messages of a message-based operating system. In other words, the hooks may provide information identifying the invocation of the programmatic procedure. The information identifying the invocation of the programmatic procedure may include, for example, the programmatic procedure identifier <NUM>, the one or more parameters <NUM> passed to the programmatic procedure, or any combination thereof. The hooks may be in a stub layer of the OS <NUM>. The stub layer may include a stub for each corresponding operating system programmatic procedure. The stub is invoked by any application that invokes the corresponding operating system programmatic procedure. The stub may pass the parameters (if there are any) to an implementation of the corresponding operating system programmatic procedure. In addition, the stub may make a copy of information identifying the corresponding operating system programmatic procedure. The stub may provide the copied information to a central repository or to an application registered to receive the copied information.

Accordingly, the operating system programmatic procedure invocations may be detected by intercepting the operating system programmatic procedure invocations in the OS <NUM>. In a message-based operating system, the invocations may be intercepted by obtaining a copy of the messages. Alternatively or in addition, the invocations may be intercepted by hooks in a stub layer.

As another example, <FIG> illustrates an example of the system <NUM> that includes a memory <NUM> and a processor <NUM>. The processor <NUM> may be in communication with the memory <NUM>. In one example, the processor <NUM> may also be in communication with additional elements, such as a network interface (not shown). Examples of the processor <NUM> may include a general processor, a central processing unit, a microcontroller, a server, an application specific integrated circuit (ASIC), a digital signal processor, a field programmable gate array (FPGA), a digital circuit, and an analog circuit.

The processor <NUM> may be one or more devices operable to execute logic. The logic may include computer executable instructions or computer code embodied in the memory <NUM> or in other memory that when executed by the processor <NUM>, cause the processor <NUM> to perform the features implemented by the logic of the difference detector <NUM>, the system <NUM> or a combination thereof. The computer code may include instructions executable with the processor <NUM>. The processor <NUM> may include multiple cores <NUM>, multiple processors (not shown), multiple central processing units (CPUs) (not shown), or any combination thereof. A multi-core processor may be a single computing component comprising two or more independent processing units (each of the processing units referred to as a "core" or a "processor"). The "cores" or "processing units" are units or processors that may read and execute program instructions in parallel with each other.

The memory <NUM> may be any device for storing and retrieving data or any combination thereof. The memory <NUM> may include non-volatile memory, such as a read-only memory (ROM), an erasable programmable read-only memory (EPROM), and a flash memory, volatile memory, such as a random access memory (RAM), or a combination of non-volatile and volatile memory. Alternatively or in addition, the memory <NUM> may include an optical, magnetic (hard-drive) or any other form of data storage device.

The memory <NUM> may include the node <NUM>, the second node <NUM>, the difference detector <NUM>, the recorder <NUM>, the monitor <NUM>, the handler <NUM>, the OS <NUM>, or any combination thereof.

Each component may include additional, different, or fewer components. For example, the difference detector <NUM> may include only the monitor <NUM>. As another example, the message <NUM> may not include the indication <NUM> of the parameters <NUM>.

The system <NUM> may be implemented in many different ways. Each module, such as the difference detector <NUM>, the recorder <NUM>, the monitor <NUM>, and the handler <NUM>, may be hardware or a combination of hardware and software. For example, each module may include an application specific integrated circuit (ASIC), a Field Programmable Gate Array (FPGA), a circuit, a digital logic circuit, an analog circuit, a combination of discrete circuits, gates, or any other type of hardware or combination thereof. Alternatively or in addition, each module may include memory hardware, such as a portion of the memory <NUM>, for example, that comprises instructions executable with the processor <NUM> or other processor to implement one or more of the features of the module. When any one of the module includes the portion of the memory that comprises instructions executable with the processor, the module may or may not include the processor. In some examples, each module may just be the portion of the memory <NUM> or other physical memory that comprises instructions executable with the processor <NUM> or other processor to implement the features of the corresponding module without the module including any other hardware. Because each module includes at least some hardware even when the included hardware comprises software, each module may be interchangeably referred to as a hardware module.

Some features are shown stored in a computer readable storage medium (for example, as logic implemented as computer executable instructions or as data structures in memory). All or part of the system and its logic and data structures may be stored on, distributed across, or read from one or more types of computer readable storage media. Examples of the computer readable storage medium may include a hard disk, a floppy disk, a CD-ROM, a flash drive, a cache, volatile memory, non-volatile memory, RAM, flash memory, or any other type of computer readable storage medium or storage media. The computer readable storage medium may include any type of non-transitory computer readable medium, such as a CD-ROM, a volatile memory, a non-volatile memory, ROM, RAM, or any other suitable storage device. However, the computer readable storage medium is not a transitory transmission medium for propagating signals.

The processing capability of the system <NUM> may be distributed among multiple entities, such as among multiple processors and memories, optionally including multiple distributed processing systems. Parameters, databases, and other data structures may be separately stored and managed, may be incorporated into a single memory or database, may be logically and physically organized in many different ways, and may implemented with different types of data structures such as linked lists, hash tables, or implicit storage mechanisms. Logic, such as programs or circuitry, may be combined or split among multiple programs, distributed across several memories and processors, and may be implemented in a library, such as a shared library (for example, a dynamic link library (DLL)).

All of the discussion, regardless of the particular implementation described, is exemplary in nature, rather than limiting. For example, although selected aspects, features, or components of the implementations are depicted as being stored in memories, all or part of the system or systems may be stored on, distributed across, or read from other computer readable storage media, for example, secondary storage devices such as hard disks, flash memory drives, floppy disks, and CD-ROMs. Moreover, the various modules are but one set of example implementations of such functionality and any other configurations encompassing similar functionality are possible.

The respective logic, software or instructions for implementing the processes, methods, and techniques discussed above may be provided on computer readable storage media. The functions, acts or tasks illustrated in the figures or described herein may be executed in response to one or more sets of logic or instructions stored in or on computer readable media. The functions, acts or tasks are independent of the particular type of instructions set, storage media, processor or processing strategy and may be performed by software, hardware, integrated circuits, firmware, micro code and the like, operating alone or in combination. Likewise, processing strategies may include multiprocessing, multitasking, parallel processing and the like. In one example, the instructions are stored on a removable media device for reading by local or remote systems. In other examples, the logic or instructions are stored in a remote location for transfer through a computer network or over telephone lines. In yet other examples, the logic or instructions are stored within a given computer, central processing unit ("CPU"), graphics processing unit ("GPU"), or system.

Furthermore, although specific components are described above, methods, systems, and articles of manufacture described herein may include additional, fewer, or different components. For example, a processor may be implemented as a microprocessor, microcontroller, application specific integrated circuit (ASIC), discrete logic, or a combination of other type of circuits or logic. Similarly, memories may be DRAM, SRAM, Flash or any other type of memory. Flags, data, databases, tables, entities, and other data structures may be separately stored and managed, may be incorporated into a single memory or database, may be distributed, or may be logically and physically organized in many different ways. The components may operate independently or be part of a same program or apparatus. The components may be resident on separate hardware, such as separate removable circuit boards, or share common hardware, such as a same memory and processor for implementing instructions from the memory. Programs may be parts of a single program, separate programs, or distributed across several memories and processors.

A second action may be said to be "in response to" a first action independent of whether the second action results directly or indirectly from the first action. The second action may occur at a substantially later time than the first action and still be in response to the first action. Similarly, the second action may be said to be in response to the first action even if intervening actions take place between the first action and the second action, and even if one or more of the intervening actions directly cause the second action to be performed. For example, a second action may be in response to a first action if the first action sets a flag and a third action later initiates the second action whenever the flag is set.

To clarify the use of and to hereby provide notice to the public, the phrases "at least one of <A>, <B>,. and <N>" or "at least one of <A>, <B>,. <N>, or combinations thereof" or "<A>, <B>,. and/or <N>" are defined by the Applicant in the broadest sense, superseding any other implied definitions hereinbefore or hereinafter unless expressly asserted by the Applicant to the contrary, to mean one or more elements selected from the group comprising A, B,. In other words, the phrases mean any combination of one or more of the elements A, B,. or N including any one element alone or the one element in combination with one or more of the other elements which may also include, in combination, additional elements not listed.

Claim 1:
A method implemented on a system (<NUM>) comprising a processor (<NUM>) and a memory (<NUM>), wherein the system (<NUM>) includes a message-based operating system, OS, (<NUM>) and a difference detector (<NUM>) including a recorder (<NUM>), a monitor (<NUM>) and a handler (<NUM>), the method comprising:
receiving, by the difference detector (<NUM>) from the OS (<NUM>), a first series of operating system programmatic procedure invocations invoked by a first process (<NUM>);
populating (<NUM>) in a buffer (<NUM>), by the recorder (<NUM>) of the difference detector (<NUM>), a first ordered set of identified call sequences comprising invocation identifiers (<NUM>) identifying the operating system programmatic procedure invocations in the first series;
receiving (<NUM>, <NUM>), by the difference detector (<NUM>) from the OS (<NUM>), a second series of operating system programmatic procedure invocations invoked by a second process;
generating (<NUM>), by the monitor (<NUM>) of the difference detector (<NUM>), a second ordered set of call sequences comprising invocation identifiers identifying the operating system programmatic procedure invocations in the second series; and
detecting (<NUM>), by the difference detector (<NUM>), a hardware error based on the monitor (<NUM>) of the difference detector (<NUM>) detecting a difference (<NUM>) between outputs of the first process (<NUM>) and the second process (<NUM>) by comparing programmatic procedure invocations made by the processes (<NUM>).