AoU: ETAS_RTACAR_SM_OS_197¶
The ETAS_RTACAR_SM_OS_197 AoU provides a list of OS API functions not allowed to be called from Idle Hook function implementations.
The relevant functions are declared as:
Os_Cbk_Idle()
Rationale for the validation
The validation process follows these steps:
Generation of the base code call graph
Collection of source code files to be analyzed, as specified by the compile_commands.json file.
Generation of the Abstract Syntax Tree (AST) for each source file.
Processing of the AST to identify function implementations and related calls.
Resolution of all the calls to the linkable target implementation.
Inspection of relevant functions within the source code files.
Inspection of the call graph contained within the relevant function to verify that do not call process OS API functions.
Identify all function calls within the relevant function.
Check each function call against the list of prohibited calls.
If the analysis process encounters a call to a function for which the implementation is not available, it is considered a potential violation of the AoU.
Known Limitations¶
During the generation of the call graph and the collection of source code files to be analyzed, files with the following extensions are ignored:
.cpp
.hpp
.s
.S
.asm
.inc
The generation of the call graph is based on static analysis of the source code. This means that the tool analyzes the code without executing it, which can lead to certain limitations:
It may not capture all dynamic behaviors, such as those resulting from runtime conditions or external inputs.
It cannot account for all possible execution paths, especially in the presence of complex control flows.
The accuracy of the call graph is dependent on the completeness and correctness of the source code being analyzed.
Important
Link Os as external library functions
This behavior is important for maintaining the integrity of the analysis process. The tool expects that the functions implementing the OS are linked as external library functions, and therefore does not expect the source code for these functions to be available within the analyzed base code.
Note
Os function names prefix
Function names generated by adding the “Os_” prefix to the names in the given list of allowed or disallowed OS API functions are also considered part of the original list.
The tool’s ability to detect function calls is limited by the information available from the source code, and it’s possible that the tool encounters limitations:
Important
Handling of External Functions
The tool may be unable to resolve function calls if their implementations are not available in the analyzed source code, such as functions provided by the OS, RTE, or external libraries.
Important
Analysis Limitations
The tool’s static analysis may not detect all function calls, particularly in cases involving complex code structures or the use of function pointers.
When the tool detects a limitation in its analysis, it shall report the issue to the user for manual review, indicating the specific code section that requires attention. Please refer to the OS reviews section for more information on how to handle such cases.
Rule Id |
ETAS_RTACAR_SM_OS_197 |
|---|---|
Title |
Os_Cbk_Idle implementation must not call prohibited functions. |
Description |
This rule verifies that no prohibited functions are called within the implementation of the ‘Os_Cbk_Idle’ function. |
Message Description¶
Id |
id_000 |
Message |
The rule cannot be evaluated due to an internal exception during the analysis execution. Please refer to the log file for more detailed information. |
Kind |
Open |
Level |
None |
Description |
An internal exception occurred during the execution. This can happen if there are insufficient resources available on the host machine. For more details, please consult the RTA-SQF log file. |
How To Fix |
Restart the command to exclude any internal exceptions. Alternatively, please contact ETAS GmbH support for assistance. When reporting the error, include a sample configuration and command line that reproduces the issue. |
Id |
id_001 |
Message |
No ‘Os_Cbk_Idle’ implementation is found in the analyzed file artifacts. |
Kind |
Pass |
Level |
None |
Description |
No ‘Os_Cbk_Idle’ implementation is detected in the analyzed files. The check is limited to the scenario(s) documented in the RTA-SQF User Manual. Please refer to the manual for more information. |
How To Fix |
Everything is in order. No action is required. |
Id |
id_002 |
Message |
No prohibited function calls has been found in the analyzed artifacts. |
Kind |
Pass |
Level |
None |
Description |
No prohibited function calls have been detected in the analyzed artifacts. The check is limited to the scenario(s) documented in the RTA-SQF User Manual. Please refer to the manual for more information. |
How To Fix |
Everything is in order. No action is required. |
Id |
id_003 |
Message |
The analysis of the ‘Os_Cbk_Idle’ implementation revealed that the ‘{0}’ prohibited function is called. |
Kind |
Fail |
Level |
Error |
Description |
The analysis of the ‘Os_Cbk_Idle’ implementation indicates that a prohibited function is being called. The check is limited to the scenario(s) documented in the RTA-SQF User Manual. Please refer to the manual for more information. |
How To Fix |
Please review the ‘Os_Cbk_Idle’ implementation and remove any prohibited function calls, if present. |
Id |
id_004 |
Message |
The analysis of the ‘Os_Cbk_Idle’ implementation was not fully completed due to the presence of an unexpected code pattern. |
Kind |
Review |
Level |
None |
Description |
During the analysis of the ‘Os_Cbk_Idle’ implementation (and the call flow), an unexpected code pattern was encountered. The analysis of the implementation was not fully completed and requires manual review. The check is limited to the scenario(s) documented in the RTA-SQF User Manual. Please refer to the manual for more information. |
How To Fix |
Please review the ‘Os_Cbk_Idle’ implementation to ensure it is free of any prohibited function calls. |