RuleChecker and Astrée can now be used separately. This is implemented as follows.
Note that invoking RuleChecker in the Astrée mode as opposed to the standalone mode maximizes precision on semantical rules.
The release notes for RuleChecker are now published separately as well.
Analysis precision has been improved for:
warn-on-field-overflows
enabledNULL
gauges=yes
.
For example, given the loop
for (unsigned K=30, N=15; INPUT < K/2; K-=2) N--;it can now prove that the loop terminates and thus
N
and K
cannot overflow
if the float variable INPUT
is known to be larger than or equal to 1.0
.x
from the NULL pointer:
ALARM (A): subtracting pointers on different memory blocks { NULL } and { x }
a
is allocated to the address 1001, Astrée will detect that *(unsigned short*)(a + 3)
accesses an aligned address but *(unsigned short*)(a + 2)
does not. For the latter,
it now produces the following alarm message:
ALARM (A): invalid dereference: misaligned memory access at 1001 + 2 may not be a multiple of 2
__ASTREE_absolute_address((int, 0));
1e50
.lhs = f(..)
where
lhs
has no read accesses and f(..)
is a function call.memcpy
, bzero
,
and array accesses through pointers (as in p[i]
where p
is a pointer)char_sign=yes
and bits_of_char=16
.unsigned char a, b; __ASTREE_absolute_address((char[2], 0x150)); /* allocate memory for a and b */ __ASTREE_absolute_address((a, 0x150)); /* allocate a into existing memory block */ __ASTREE_absolute_address((b, 0x151)); /* allocate b into existing memory block */ unsigned short f(void) { return *(unsigned short*)&a; /* Read both a and b */ }
When enabling the gauge domain, in rare cases the analyzer may underestimate the value ranges of certain variables. Make sure that the gauge domain is disabled (this is the default setting of the analyzer), or contact support@absint.com for details on scenarios that trigger the undesired behavior.
anonymous-global-structs-and-unions
.int a[10]; int n = sizeof(a) / sizeof(*a); int (*q)[n] = &a; /* this line no longer triggers a warning */
__asm
and __asm__
statements are now
also handled automatically. It is no longer necessary to define parser filters
to remove such statements from the code.&g[1] - &g[0]
.
Such expressions, which are supported by some compilers, are still reported
as violations of MISRA-C:2004 rule 1.1 and MISRA-C:2012 rule 1.2.int f(unsigned x, int (*p)[x])
.##
operator is followed by an empty macro parameter.M
defined as
#define M N #define N() some_expansion
The wizard now simplifies the setup of analysis projects in all the different modes: Astrée, RuleChecker, and Astrée + RuleChecker.
A line with more than one finding is now marked by a special icon. The number of findings is shown when hovering over it.
Fixed the “Reset to analyzer defaults” action which in some cases would not correctly reset the ABI settings.
Reorganized the options to clarify which ones affect both Astrée and RuleChecker, and which affect only one of them.
The identifier search now allows searching for struct/union member declarations and distinguishes between member reads, writes, taking the address of a member, and using it in a directive.
The dialog for starting the program slicer now allows selecting a variable that is written in the current expression.
This new view displays the function calls in each process.
For each variable, this view now also displays the number of distinct locations at which it is read or written.
This view affects the information displayed in Overview → Data Flow.
The call graph view now also allows searching for arbitrary substrings of function names.
Fixed cases of missing invariants for statements.
__ASTREE_assert
)
that was introduced via an AAL annotation, it is now possible to invoke the context menu
on either the displayed directive in the code or on the corresponding entry in the Annotations view,
and select the new action “Display findings”, which then displays the list of alarms reported
for that directive.main { +1 statement} insert before : __ASTREE_print(("start"); /*This is a comment.*/
Diagnostics messages formerly issued as errors or notifications (e.g. C constraint violations) are now covered by the new rule set “A. Diagnostics”. Make sure to enable this rule set for all Astrée analysis projects.
For old analysis projects specified in DAX, the new diagnostics can be enabled by adding the following section to the DAX file:
<rulechecks> <rules enable="none"> <A>yes</A> </rules> </rulechecks>
/* Project metrics */ |-----------------| | Project metrics | |-----------------| | RPATH | 0 | |-----------------| /* File metrics */ |----------------------------------------------| | File metrics | CDFILE | LINE | FUN | PLINE | |----------------------------------------------| | src/Func1.c | 0.00 | 19 | 1 | 16 | | src/Func2.c | 0.00 | 34 | 1 | 31 | | src/Func3.c | 0.00 | 13 | 1 | 8 | |----------------------------------------------| /* Function metrics */ |------------------------------------------------------------------------------------------------------------------| | Function metrics | CYCL | RETURN | GOTO | STMT | PARAM | MLINE | LEVEL | PATH | CALLS | CALLING | LSCOPE | CDFUN | |------------------------------------------------------------------------------------------------------------------| | Func1 | 2 | 2 | 0 | 7 | 2 | 13 | 2 | 2 | 0 | 2 | 1.94 | 0.00 | | Func2 | 6 | 3 | 0 | 16 | 2 | 28 | 3 | 18 | 2 | 1 | 2.31 | 0.00 | | Func3 | 2 | 2 | 0 | 5 | 1 | 5 | 2 | 2 | 0 | 1 | 1.62 | 0.00 | |------------------------------------------------------------------------------------------------------------------|
The XML report file now also contains code metrics,
if the option metrics=yes
was enabled for the analysis.
format=html|text|csv
.%REPORT_TYPE%
%FILE_TYPE%
%PROJECT%
%REVISION%
%USER%
%VERSION%
%BUILD%
%MODE%
<dax/>
tag as
<dax mode="rulechecker" version="1.4"> ... </dax>or
<dax mode="astree" version="1.4"> ... </dax>respectively. If not specified, the mode defaults to
astree
.<parser-ignore/>
tag:
file
attribute used to import .par
files from older Astrée versions is no longer availablereplacement
<findings/>
tag
have been renamed as follows:
DAX 1.3 | DAX 1.4 |
---|---|
<alarms/> | <include-alarms/> |
<errors/> | <include-errors/> |
<notifications/> | <include-notifications/> |
import
attribute
of the <abi/>
tag are now allowed to import an ABI from yet another DAX file.<patterns-ignore/>
section is now ignored if it contains
the new attribute enabled="no"
.coverage-ignore="yes"
for <file/>
tags in the <preprocess/>
section
allows to exclude the corresponding preprocessed file from the project coverage.<include-configuration mode="contents"|"name"/>
controls the inclusion
of the report configuration in custom reports.<alarm-classification>
in the custom report configuration
controls the output of the number of reported alarms for each file/function in the project
together with their classification.You can now pick from several option profiles to automatically set the most appropriate options accordingly. The following profiles are available:
The Setup profiles are a good choice for initial analysis runs to help you check and complete the setup. The Analysis profiles can then be used for final analysis runs, with different levels of precision.
generate-undeclared-absolute-addresses
With this option enabled, accessing an undeclared absolute address will raise an alarm
but the analysis will continue assuming that the address is valid. Once the analysis has finished,
suggestions for __ASTREE_absolute_address
directives will be displayed in the Output view.
This corresponds to the analyzer’s behavior in release 16.10.
With the option disabled, the analysis stops for the current context when accessing an undeclared absolute address. This corresponds to the analyzer’s behavior in all releases before 16.10.
The suggested workflow is to set this option during analysis setup, review the generated directives, copy them into the “wrapper and stubs” file, and disable the option for subsequent analysis runs.
separate-with-caller-stack-pointers
auto-unroll-size
auto-unroll
). The default value is 10.assume-unknown-pointers-are-valid
__ASTREE_initialize
applied to a local pointer variable
changes an invalid pointer into a possibly valid pointer, so that the analysis may proceed.global-initialization
is disabled and a global pointer
is read without being first written to, the analysis does not stop. Instead, an alarm
is emitted and the analysis continues with the assumption that the pointer was either
NULL or pointed to some unknown variable not declared in the analyzed code.auto-generate-stubs
partition-double-if
if
sequences when the branches
of the if
are too big or when the conditions don’t test the same variable.partition-array-access
aggressive-partition-array-access=yes
.separate-function=*
). Analyses using this heuristic can become faster
and slightly less precise.global-initialization
has two new sub-options
that offer better control over the zero initialization of global objects without initializers:
tentative-initialization
extern-initialization
Disabling one of these options will cause the analyzer to assume arbitrary initial values for such objects.
ignored-source-files
has been removed. Files to be checked
are now explicitly specified in the new RuleChecker configuration. See also release notes
about DAX and rule checks.__ASTREE_suppress
now also accepts rules_category
as type,
causing all rule checks to be suppressed for the specified code region.The min_size
parameter of the __ASTREE_partition_ranges
directive
has been replaced by a new size
parameter with slightly different semantics.
The analyzer now tries to adjust all partitions to exactly the specified size
.
If the partitioned range cannot be exactly divided by size
, remaining values
are collected in an additional partition with smaller size.
Please note that the size
parameter can still be overridden by the max_partitions
parameter.
That is, if the partitioned range divided by size
results in a number
of partitions that is larger than max_partitions
, the analyzer will limit
the number of partitions to max_partitions
. All of these partitions
have approximately the same size, thus effectively ignoring the size
parameter.
The new semantics of the size
parameter is particularly useful if a value needs
to be partitioned in even intervals.
__ASTREE_alarm
are now checked more strictly
during parsing to give immediate feedback about configuration issues.
Here are two examples of new error messages for invalid arguments:
Invalid directive (message argument missing or empty). Directive is ignored at ...
Invalid directive (message argument not allowed with rule checker alarm). Directive is ignored at ...
__ASTREE_partition_ranges((...));
now accepts
arbitrary constant expressions for its size
and max_partition
arguments.__ASTREE_assert
assertion fails in multiple partitioning contexts,
only the contexts in which it failed are now reported.max_partition
option of __ASTREE_partition_ranges
.__ASTREE_global_assert
may now also be placed inside of function code
and thus can be applied to block-scope variables (like function-local automatic or static variables).no
to yes
. This results in more
compact and stable file paths for modified destination directories.__STDC_VERSION__
.For the C stub libraries wchar_t
and wint_t
, it is now possible
to override the types and related macros by defining the following macros during preprocessing:
__ASTREE_WCHAR
__ASTREE_WINT
__ASTREE_WCHAR_MIN
__ASTREE_WCHAR_MAX
__ASTREE_WEOF
These macros are expected to expand to the desired definition of the wchar/wint type or macro, respectively.
SetStandardReports
.Rte_Start
.InvokeAstree()
optionally uses this stored setting if available.exclude-signed-in-unsigned-overflows
which in rare cases caused the analyzer to crash.__ASTREE_annotation(( /* comment was not loaded and displayed */ ...));
The release notes for RuleChecker are now published separately.