4. Tool Analysis

4.1. Potential Errors

4.1.1. Installation

Error identifier

Use case

Description

Risk

Mitigation

Detectable

Identifier: RUSTC_ERR_INSTALL_01

RUSTC_UC0_INST

Ferrocene was not correctly installed

Undefined behavior

RUSTC_AVD_CHECK_INSTALL_001

NO

4.1.2. Rust Driver

Error identifier

Use case

Description

Risk

Mitigation

Detectable

Identifier: RUSTC_ERR_DRIVER_02

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

An used environment variable is set to an incorrect value

Undefined behavior

RUSTC_AVD_CHECK_CLEAN_ENV_002

YES

Identifier: RUSTC_ERR_DRIVER_03

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

An invalid option is passed

Undefined behavior

RUSTC_AVD_CHECK_BUILD_SCRIPT_003

YES

Identifier: RUSTC_ERR_DRIVER_04

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

Error diagnostics are not correctly emited

Undefined behavior

RUSTC_AVD_CHECK_BUILD_SCRIPT_003 AND RUSTC_AVD_TEST_007

NO

Identifier: RUSTC_ERR_DRIVER_05

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

The output is generated with missing part

Wrong code

RUSTC_AVD_CHECK_BUILD_SCRIPT_003

NO

Identifier: RUSTC_ERR_DRIVER_06

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

The behavior is incorrect because of concurrent modification

Undefined behavior

RUSTC_AVD_PARALLEL_BUILD_006

NO

Identifier: RUSTC_ERR_DRIVER_07

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

A warning is generated instead of an error

Undefined behavior

RUSTC_AVD_WARNING_AS_ERROR_005

NO

Identifier: RUSTC_ERR_DRIVER_08

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

The compilation has a wrong behavior

Wrong code

RUSTC_AVD_TEST_007

NO

Identifier: RUSTC_ERR_DRIVER_09

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

An incomplete input is accepted leading to an undefined behavior

Undefined behavior

RUSTC_AVD_TEST_007

YES

Identifier: RUSTC_ERR_DRIVER_10

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

Some object files are silently not generated

Use an artifact from a previous build

RUSTC_AVD_CLEAN_004

NO

4.1.3. Rust Front-End

Error identifier

Use case

Description

Risk

Mitigation

Detectable

Identifier: RUSTC_ERR_RUST_FE_11

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

Input has invalid contents

Invalid code generated

RUSTC_AVD_TEST_007

YES

Identifier: RUSTC_ERR_RUST_FE_12

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

Error diagnostics is invalid

Invalid code generated

RUSTC_AVD_WARNING_AS_ERROR_005

NO

Identifier: RUSTC_ERR_RUST_FE_13

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

Invalid output generated from valid input

Invalid code generated

RUSTC_AVD_TEST_007

NO

Identifier: RUSTC_ERR_RUST_FE_14

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

The behavior is incorrect because of concurrent modifications

Invalid code generated

RUSTC_AVD_PARALLEL_BUILD_006

NO

Identifier: RUSTC_ERR_RUST_FE_15

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

Invalid input is accepted

Undefined behavior

RUSTC_AVD_TEST_007

YES

Identifier: RUSTC_ERR_RUST_FE_16

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

Incorrect number of inputs are accepted

Undefined behavior

RUSTC_AVD_CHECK_BUILD_SCRIPT_003

YES

4.1.4. LLVM

Error identifier

Use case

Description

Risk

Mitigation

Detectable

Identifier: RUSTC_ERR_LLVM_17

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

Input parameter has invalid value

Most likely LLVM will crash. Invalid code could also be generated

RUSTC_AVD_TEST_007

NO

Identifier: RUSTC_ERR_LLVM_18

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

An object file is invalid

Invalid code generated

RUSTC_AVD_CHECK_BUILD_SCRIPT_003

NO

Identifier: RUSTC_ERR_LLVM_19

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

An object file or static library is not correctly translated to machine code

Undefined behavior

RUSTC_AVD_TEST_007

NO

Identifier: RUSTC_ERR_LLVM_20

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

The behavior is incorrect because of concurrent modifications

Invalid code generated

RUSTC_AVD_PARALLEL_BUILD_006

NO

Identifier: RUSTC_ERR_LLVM_21

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

An object or static library exposes additional symbols

Internal functionality might become callable from the outside

RUSTC_AVD_TEST_007

NO

Identifier: RUSTC_ERR_LLVM_22

RUSTC_UC1_RLIB, RUSTC_UC2_STATICLIB, RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

Output does not contain expected variables or functions

Invalid code generated

RUSTC_AVD_CHECK_CLEAN_ENV_002 AND RUSTC_AVD_CLEAN_004 AND RUSTC_AVD_TEST_007

NO

4.1.5. Linking

Error identifier

Use case

Description

Risk

Mitigation

Detectable

RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

Invalid input is accepted

Undefined behavior

RUSTC_AVD_CHECK_BUILD_SCRIPT_003

NO

RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

Invalid executable or library produced

Undefined behavior

RUSTC_AVD_TEST_007

NO

RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

The behavior is incorrect because of concurrent modifications

Undefined behavior

RUSTC_AVD_PARALLEL_BUILD_006

NO

RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

Incorrect number of inputs are accepted

Undefined behavior

RUSTC_AVD_CHECK_BUILD_SCRIPT_003

YES

RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

An input is missing

Invalid code generated but won’t run

RUSTC_AVD_CHECK_INSTALL_001

YES

RUSTC_UC3_EXEC, RUSTC_UC4_EXEC_RLIB, RUSTC_UC5_EXEC_CLIB

Error diagnostics not emmited

Invalid or missing code not detected by user may be linked against subsequent stage

RUSTC_AVD_TEST_007

NO

4.2. Detection Measures and Usage Restriction

Measure identifier

Description

Identifier: RUSTC_AVD_CHECK_INSTALL_001

The toolchain Installation shall be checked in order to ensure the validity of the build results.

Identifier: RUSTC_AVD_CHECK_CLEAN_ENV_002

User must verify that environment variables used by the toolchain are correctly set.

Identifier: RUSTC_AVD_CHECK_BUILD_SCRIPT_003

User must verify that the list of build actions is correct.

Identifier: RUSTC_AVD_CLEAN_004

Before building, the user must ensure that the build environment is clean of former compilation artifacts.

Identifier: RUSTC_AVD_WARNING_AS_ERROR_005

All Warnings should be considered errors, the build should NOT display any warning.

Identifier: RUSTC_AVD_PARALLEL_BUILD_006

Concurrent file updates during the build operations are prohibited.

Identifier: RUSTC_AVD_TEST_007

Testing must be performed on the final application or libraries, or on any parts built, using an environment as close as possible to the final build.

4.3. Potential Errors by Classes Traceability Matrix

Potential errors are the result of the HazOp analysis, it should be documented in the HazOp Report documents.

4.4. ISO 26262 Tool Classification

During this analysis, we highlighted some of the potential errors concerning Ferrocene that impacts the safety-related software code. Hence, the tool impact is TI2.

Moreover, this analysis shows us that the likelihood of detecting these potential errors is very low. Therefore, the tool error detection class is TD3.

Using clause 11.4.5.4 in part 8 of the [ISO-26262:2018] standard, we can conclude that in the worst case the Tool Classification Level is TCL3 and therefore we choose the following qualification methods:

  • 1b. Evaluation of the tool development process in accordance with 11.4.8

  • 1c. Validation of the software tool in accordance with 11.4.9

According to clause 11.4.2 in part 8 of the [ISO-26262:2018] standard, this choice depends on the user’s software development life-cycle and their validation strategy. The user has the responsibility to determine whether this level, or a better one, is applicable.

4.5. IEC 61508 Tool Classification

Ferrocene provides a development environment capable of compiling and linking programs for the target architecture to conform with industrial [IEC-61508:2010] class T3.

4.6. IEC 62304 Tool Classification

[IEC 62304:2006 + AMD 1:2015] does not provide an own scheme to classify and qualify tools used in its context, but recommends the application of techniques and tools as defined in [IEC-61508:2010]. Therefore, with the qualification of Ferrocene adhering to an IEC 61508 Tool Classification, Ferrocene can be used for development, release and maintenance of medical device software up to Class C.