Questions tagged [frama-c]

Frama-C is an Open Source suite of tools dedicated to the analysis of C source code.

Frama-C offers ready-to-use analyses for C programs: call graph, value analysis, functional dependencies, Program Dependence Graph, runtime monitoring, etc. It also allows the verification of functional properties, temporal logic, and much more. Results can be expressed in plain text, in SARIF, or in Frama-C's graphical interface.

Each analysis is implemented as a plug-in, and plug-ins inside the platform can use the results of one another. Frama-C is Open Source and extensible: new analyses can be implemented in OCaml as additional plug-ins that take advantage of existing ones. They communicate using the ACSL specification language, which also enables describing what the program is supposed to do.

Most provided analyses in Frama-C are sound: used within a delimited perimeter, all the behaviors that can happen at run-time are included in the behaviors statically predicted by Frama-C. Notwithstanding the possibility of bugs, plug-ins must be used as documented for the property to hold. This makes it possible to use Frama-C for the formal verification of C programs.

447 questions
0
votes
2 answers

How do frama-c get CWE-ID?

I am using Frama-c for my research. How can I do to get CWE-ID from the results of Frama-C [kernel:typing:implicit-function-declaration] 1v3/juliet_suite-c-cplus/CWE401_Memory_Leak__int64_t_calloc_08.c:121: Warning: Thank you so much
0
votes
2 answers

How to use frama-c to obtain the associated statements and then print their location

Follow this question: How can I map frama-c CLI code to the original c statement? And how can I find the documentation of the api of the frama-c? I used the Ocaml code mentioned in the question(ran frama-c with frama-c -pdg -load-module print_pdg.ml…
BaiQi
  • 15
  • 4
0
votes
1 answer

Frama-C: Warning: Memory model hypotheses for function 'write'; What does it mean?

I am new to frama-c. I did some tutorials and would like to build a tiny real world application. I didn't get far, because I ran into a warning that bugs me. This is the program I would like to verify: #include /*@ assigns…
Cosinus
  • 534
  • 4
  • 10
0
votes
1 answer

Failed to establish an invariant requiring the knowledge of the content of an array

I try to use Frama-C to prove the invariant below. With the precondition that the array clean has at least one "true" in the first half, the loop should terminate before the last iteration and hence i will never be increased to BLOCK_NUM (=1000).…
0
votes
0 answers

FRAMA-C/WP Goals not being proved

I am trying to prove a simplified version of an example from the WP manual but I keep getting an error for one of the ensures clauses. Here is my code: /*@ requires \valid(a) && \valid(b); @ ensures A: *a == \old(*b) ; @ ensures B: *b == \old(*a)…
sgjl
  • 27
  • 5
0
votes
1 answer

E-ACSL wrapper script not creating files

I am new to Frama-C and wanted to ask what could be causing this issue: When I run the E-ACSL wrapper script on annotated code with no header files, the a.out.e-acsl file is properly created. However, when I try to include header files using -E and…
sgjl
  • 27
  • 5
0
votes
1 answer

Frama-C: unexpected error with _Bool values

While working with Frama-C I discovered an issue which leads to an unexpected error. The following code snippet shows a minimal reproducer of the problem (simplified as far as possible). _Bool get_bool(void){ return (_Bool)1; }; _Bool…
Gruber
  • 25
  • 5
0
votes
1 answer

Eva is not providing alarms for a code illustrating CWE122

My goal is to analyze a code illustrating CWE122 that I found in the NIST database : https://samate.nist.gov/SARD/test-cases/234158/versions/2.0.0 I dont succeed in making the tool emit an alarm for the flaw described in the link above, using eva…
thomas
  • 11
  • 1
0
votes
1 answer

Frama-Clang: Invalid integer constant

While working with Frama-Clang, I ran into a problem. The following code shows the problem broken down to the minimum: const long long value = -1; int main(){ return 0; } Running the Frama-C (Frama-Clang) analysis leads to the following…
Gruber
  • 25
  • 5
0
votes
1 answer

Multiple function call, dependencies mix up

While working with Frama-C, i encountered some strange dependencies. These occur when functions are called multiple times and pointers are passed as parameters. The following code shows the problem broken down to the minimum: int sourceA = 1,…
Gruber
  • 25
  • 5
0
votes
1 answer

Synthesize a loop program that preserves the loop invariant and variant

I want to create a program which has the following prerequisites: invariant: y = x ∗ x ∧ z = y ∗ x ∧ x ≤ n variant: n − x Program structure is as follows: while How the program should looks like…
yontu
  • 37
  • 5
0
votes
1 answer

How to trace a variable and slice all the code that it touches with Frama-C

Is it possible to trace a variable and slice all the code it touches using Frama-C? For example consider the following program: #include #define SIZE 512 int storage[SIZE]; void insert(int index, int val) { storage[index] =…
Ashfaqur Rahaman
  • 714
  • 1
  • 5
  • 21
0
votes
1 answer

How to verify Why3 output of Proof Obligations

I believe I can generate proofs using why3 with different provers, frama-c -wp -wp-prover cvc4 -wp-rte -wp-out proof swap.c frama-c -wp -wp-prover z3-ce -wp-rte -wp-out proof swap.c frama-c -wp -wp-prover alt-ergo -wp-rte -wp-out proof swap.c This…
artless noise
  • 21,212
  • 6
  • 68
  • 105
0
votes
1 answer

How to get rid of the warning: "1 state in saved file ignored. It is invalid in this Frama-C configuration."?

In some situations, e.g. when using Eva's abstract domains, loading a session always emits a warning of the form: [kernel] Warning: 1 state in saved file ignored. It is invalid in this Frama-C configuration. For instance, here's how to reproduce it…
anol
  • 8,264
  • 3
  • 34
  • 78
0
votes
1 answer

In need for clarification of Aorai's frama-c YA language

In the example provided by the official manual of Aorai plugin https://frama-c.com/download/frama-c-aorai-manual.pdf the example.ya file is the following %accept: S1, S2, S3, S4, S5, S6, S7; S1 : { CALL(main) } -> S2 ; S2 : { opa().r>=0 } ->…
GeePi
  • 89
  • 5