frama-c malloc Neon-20140301 fatal error

杀马特。学长 韩版系。学妹 提交于 2019-12-11 18:12:40

问题


Is it possible to detect memory leaks or double free with Frama-c? I have tried to test that example But

#include <string.h>
#include <stdlib.h>

#define FRAMA_C_MALLOC_STACK
#include "/usr/share/frama-c/libc/fc_runtime.c"

int main()
{
  int *x  = malloc(sizeof(int));
  free(x);
  free(x);
  return 0;
}

I get :

Now I am using Version: Neon-20140301 and libc copied from Fluorine-20130601 ( btw why fc_runtime.c and other *.c files are deleted from Neon release ? )

command:

frama-c-gui -cpp-command "gcc -C -E -I/usrhare/frama-c/libc/ -nostdinc" -slevel 1000 -val  -val-warn-copy-indeterminate @all main.

Using other defines (FRAMA_C_MALLOC_XXXX) works but is not detecting any bugs.

update: Other example

#include <string.h>
    #include <stdlib.h>

    #define FRAMA_C_MALLOC_STACK
    #include "/usr/share/frama-c/libc/fc_runtime.c"

    int main()
    {
      int *x  = malloc(sizeof(int));
      x[2] = 5;
      return 0;
    }

来源:https://stackoverflow.com/questions/25466686/frama-c-malloc-neon-20140301-fatal-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!