Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix_function_attribute and clean_ast functions causing problems to the AST #17

Open
oscarcornejolu opened this issue Mar 4, 2020 · 0 comments

Comments

@oscarcornejolu
Copy link

I'm trying to generate mutants for the following source code:

#include <stdio.h>
#include <stdlib.h>

void func() {
  int a = 5 ;
  int b = 2;
  int ret = 0 ;
  
  if(a<b){
    ret = a;
  }
  if(a>b){
    ret = b;
  }
  printf( "Max value is : %d\n", ret );
}

void main(int argc, char** argv){
  func();
  exit();
}

When launching Milu with the parameter '--func-name=func', I'm obtaining a segmentation fault in the line if(g_strcmp0(func_name, tmp_node->text)==0) of the milu_project_load_function_settings function in Project.c.
In particular, gdb says the following about tmp_node->text variable:

$1 = (gchar *) 0xe <Address 0xe out of bounds>

However, if within the function 'libclang_parse_file' in ASTUnit.c I comment the 'fix_function_attribute' and the 'clean_ast' calls I get Milu to work and to correctly produce mutants.

Do you know how to fix those both functions to make work Milu correctly?
Thanks in advance,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant