I am facing an incoherent behavior with the -rte
option in Magnesium version (installed directly from ubuntu). I am wondering if someone is aware of that problem or if I am doing something wrong.
I have a program with an incorrect acces outside an array. When lauching frama-c-gui
with no options and value analysis, the out-of-bounds access is detected and the corresponding annotation is displayed with an orange circle. When using the -rte option, two annotations are displayed (for the lower and upper bound of the array), and a green circle is displayed for both (which is incorrect).
/*@ assert rte: index_bound: 0 ≤ cpt; */
/*@ assert rte: index_bound: cpt < 5; */
The console says :
tableau_erreur.c:11:[value] Assertion 'rte,index_bound' got status valid.
I suspect there is a mismatch between the two annotations because they both have the same "name" : index_bound
.
Also, the part of code after the loop containing the faulty access is colored in red, suggesting that the analysis correctly inferred that it is not reachable because of an error before.
Here is my program :
int main(){
int t[5] = {1,2,3,4,5};
int cpt =0 ;
int tmp ;
while (cpt<10){
tmp = getchar() ;
if ( t[cpt] > tmp )
{ return 1 ; }
cpt++ ;
}
return 10 ;
}
Here is a capture of my display (using frama-c-gui -rte tableau_erreur.c
).
When I do not use the -rte
option the result is correct (orange circle) :
I had a look at the bug tracker but did not find trace of that. I did not manage to compile a more recent version of Frama-C to test it.