Frama-C Bug Tracking System

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002413Frama-CPlug-in > E-ACSLpublic2018-12-05 15:112018-12-06 12:41
Reporterrmalak 
Assigned Tosignoles 
PrioritynormalSeveritymajorReproducibilityalways
StatusconfirmedResolutionopen 
Platformx86_64OSLinux 4.18 OCaml 4.07.0OS VersionDebian Sid
Product VersionFrama-C 18-Argon 
Target VersionFixed in Version 
Summary0002413: missing E-ACSL code when ignoring asm annotation
DescriptionHi,

//////////////// asm.c
void func()
{
    int i = 0;
    int *ptr=&i;
    /*@ assert \valid(ptr); */
    *ptr = 0;
}
int main(int argc, char **argv)
{
    func();
    __asm__ ("");
    return 0;
}
////////////////
Steps To Reproduce$ frama-c -machdep gcc_x86_64 asm.c -e-acsl -then-last -print -ocode eacsl_asm.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 asm.c (with preprocessing)
[e-acsl] beginning translation.
[e-acsl] asm.c:11: Warning:
  E-ACSL construct `asm' is not yet supported. Ignoring annotation.
[e-acsl] translation done in project "e-acsl".

$ gcc -DE_ACSL_SEGMENT_MMODEL -Wno-attributes -I$(frama-c -print-share-path)/e-acsl/ -o asm eacsl_asm.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

$ ./asm
Assertion failed at line 5 in function func.
The failing predicate is:
\valid(ptr).
Aborted
Additional InformationWhen one comments the __asm__ line and compare the generated code, it seems that the list of missing functions are :

__e_acsl_memory_clean
__e_acsl_store_block
__e_acsl_delete_block
__e_acsl_initialize
__e_acsl_full_init

The problem is similar on Chlorine and Argon.

i and ptr could also be global static variables, it doesn't change anything

TagsNo tags attached.
Attached Filesc file icon asm.c [^] (186 bytes) 2018-12-05 15:11 [Show Content]

- Relationships

-  Notes
(0006690)
signoles (manager)
2018-12-05 16:46

Thank you for the report.

A workaround consists in adding the option -e-acsl-full-mmodel to E-ACSL (or -M when using e-acsl-gcc.sh).
(0006692)
rmalak (reporter)
2018-12-06 12:41

Thanks !

- Issue History
Date Modified Username Field Change
2018-12-05 15:11 rmalak New Issue
2018-12-05 15:11 rmalak Status new => assigned
2018-12-05 15:11 rmalak Assigned To => signoles
2018-12-05 15:11 rmalak File Added: asm.c
2018-12-05 16:46 signoles Note Added: 0006690
2018-12-05 16:46 signoles Status assigned => confirmed
2018-12-06 12:41 rmalak Note Added: 0006692


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker