Frama-C Bug Tracking System

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002416Frama-CPlug-in > E-ACSLpublic2018-12-11 18:202018-12-11 19:42
Reporterrmalak 
Assigned Tosignoles 
PrioritynormalSeverityminorReproducibilityalways
StatusacknowledgedResolutionopen 
Platformx86_64OSLinux 4.18 Ocaml 4.07.0OS VersionDebian Sid
Product VersionFrama-C 18-Argon 
Target VersionFixed in Version 
Summary0002416: missing E-ACSL code, control flow graph, function pointer
DescriptionHi,

Is there a workaround for the function pointer limitation

//////////////// cfg.c
void func(void)
{
  int i = 0 ;
  int *ptr = &i;
  /*@ assert \valid(ptr); */
  *ptr = 0 ;
}

int main(int argc, char **argv)
{
  void (*ptr_func)(void) = &func;
  (*ptr_func)();
  return 0;
}
////////////////
Steps To Reproduce$ frama-c -machdep gcc_x86_64 cfg.c -e-acsl -then-last -print -ocode cfg.e-acsl.c
[kernel] Parsing FRAMAC_SHARE/e-acsl/e_acsl_gmp_api.h (with preprocessing)
[kernel] Parsing FRAMAC_SHARE/e-acsl/e_acsl.h (with preprocessing)
[kernel] Parsing cfg.c (with preprocessing)
[e-acsl] beginning translation.
[e-acsl] cfg.c:12: Warning:
  function pointers may introduce too limited instrumentation.
[e-acsl] translation done in project "e-acsl".

$ gcc -DE_ACSL_SEGMENT_MMODEL -Wno-attributes -I$(frama-c -print-share-path)/e-acsl/ -o cfg.e-acsl cfg.e-acsl.c $(frama-c -print-share-path)/e-acsl/e_acsl_rtl.c $(frama-c -print-share-path)/../../lib/libeacsl-dlmalloc.a $(frama-c -print-share-path)/../../lib/libeacsl-gmp.a -lm

$ ./cfg.e-acsl
Assertion failed at line 5 in function func.
The failing predicate is:
\valid(ptr).
Aborted
Additional InformationI would like to find a solution that do not involve :

- the use of EVA

OR

- modifying the code
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0006695)
signoles (manager)
2018-12-11 19:28

Yes, you should use the option -e-acsl-full-mmodel (at the price of a slower generated code).
(0006696)
rmalak (reporter)
2018-12-11 19:40

Thanks !

Maybe at some point, I will start to understand that each time I have a question about missing E-ACSL annotation, I should first try this magic option !

And it was written in the manual : "systematically instrument the code for handling potential memory-related annotations even when it is not required"
(0006697)
signoles (manager)
2018-12-11 19:42

Indeed, this option is most of the time necessary for dealing with large/complex pieces of code (for the time being).

- Issue History
Date Modified Username Field Change
2018-12-11 18:20 rmalak New Issue
2018-12-11 18:20 rmalak Status new => assigned
2018-12-11 18:20 rmalak Assigned To => signoles
2018-12-11 19:28 signoles Note Added: 0006695
2018-12-11 19:30 signoles Status assigned => acknowledged
2018-12-11 19:40 rmalak Note Added: 0006696
2018-12-11 19:42 signoles Note Added: 0006697


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker