General - Reactis for C#
What is Reactis for C?#
Reactis for C brings many of features of Reactis to projects that do not use Simulink. Instead, this version of Reactis may be applied directly to the C code that implements an application. You can generate tests from C code, detect run-time errors, track coverage: (Statement, Decision, Condition, MC/DC). When an error is detected, you can replay a concrete execution sequence leading to the problem in order to understand, diagnose, and fix the bug.
Reactis for C can be used along with Reactis for Simulink to offer a robust solution for back-to-back testing of C code against a Simulink model.
What version(s) of C does Reactis for C support?#
Reactis for C supports a very large subset of the ANSI C99 standard. A list of unsupported features can be found here.
How do I bring code into Reactis for C?#
You first create a Reactis Build File to enumerate the C files that make up your project. You then create a harness to specify:
an initialization function to be called at the start of a test
an entry function to be repeatedly called at each step of a test
a set of inputs
a set of outputs
More details can be found here.
What kinds of errors does Reactis for C detect?#
Reactis for C automatically detects many kinds of memory errors, including buffer overruns, out-of-bound array indices, and accessing heap or stack memory after the memory has been recycled. Reactis for C also automatically detects common numeric errors such as integer overflows, integer divide by zero, and invalid shifts. In addition, Reactis for C detects violations of user-defined assertions.
Is Reactis for C a static analysis tool?#
Reactis for C performs some limited static analysis, but its primary engine for runtime error detection works by dynamic simulation of C programs. Reactis for C performs static analysis to identify unreachable coverage targets, such as statement targets within a function that is never called.
Does Reactis for C detect errors during floating-point operations?#
Yes. Reactis for C can be configured to flag an error if a program generates an Inf or NaN value. Reactis for C follows the IEEE 754 standard, which specifies that positive overflows produce a result of positive infinity, negative overflows produce a result of negative infinity, and dividing x by zero (in floating-point) produces a result of positive infinity if x is positive, negative infinity if x is negative, and NaN (not-a-number) if x equals zero.
My program runs fine normally, but under Reactis for C I keep getting a memory error. Is this a bug in Reactis for C?#
Probably not. Many programs with memory errors will run correctly most of the time. For example, a program with a buffer overrun may happen to overwrite a variable which is not used after the overwrite occurs. Reactis for C will detect such overwrites and halt program execution as soon as they occur. Many buffer overruns do not cause problems until they are exploited by a malicious agent to hijack control of your system.
Of course, there is always a chance (as there is with any error detection tool) that Reactis for C has incorrectly reported an “error” where none exists. If you believe this is the case, please contact Reactive Systems.
What is the difference between Reactis for C and Reactis for C Plugin?#
Reactis for C works with standalone C code not incorporated in any model, whereas Reactis for C Plugin only works with Simulink S-functions and Stateflow custom code which are written in C.
Does Reactis for C work with Simulink S-functions or Stateflow custom code?#
No, because S-functions and custom code use MATLAB libraries which are not included with Reactis for C. It is of course possible to use S-function and custom code fragments which do not depend on MATLAB library code with Reactis for C.
What machine architectures does Reactis for C support?#
Currently, Reactis for C executes programs in a virtual x86 (32-bit) machine architecture. Both the 32-bit and 64-bit versions of Reactis for C provide the same virtual 32-bit architecture.
What is the difference between the 32-bit and 64-bit versions of Reactis for C?#
In terms of the virtual machine used to execute compiled C programs, there is no difference. On host machines with at least 4GB of memory, the 64-bit version may be able to take advantage of the extra memory to improve performance and handle larger programs and test suites. However, the 64-bit version will typically use more memory than the 32-bit version, so there is a trade-off involved. Other than this, there is no observable difference between the two versions.
Which C compilers work with Reactis for C?#
Reactis for C does not use an external C compiler. It uses its own built-in compiler instead.
Can I use object files, DLLs, or other binary code with Reactis for C?#
No. Reactis for C does not work binary code. Reactis for C only works with C source code.
Can I use a different version of stdio.h instead of the one provided by Reactis for C?#
Unlikely. The system header files (stdio.h, stdlib.h, etc.) are usually not portable.