csmith-project / creduce

C-Reduce, a C and C++ program reducer
Other
1.31k stars 123 forks source link

C-reduce crashes on some input #203

Closed Changochen closed 4 years ago

Changochen commented 4 years ago

With the following command: creduce/bld/creduce/../clang_delta/clang_delta --transformation=callexpr-to-value --counter=1 poc.c

And poc.c as:

int main ( ) {
       struct s {
      struct s {
     struct s1 {
    struct s1 ;
     }
      }
       }
       foo ( struct s1 {

Creduce met a seg fault.

chenyang78 commented 4 years ago

Thanks for reporting the issue. Looks like the code triggered some crash bug in Clang 8.0.

$ clang -c crashes/poc.c                                                                      
crashes/poc.c:3:5: warning: declaration does not declare anything [-Wmissing-declarations]                                                                                                                  
    struct s1 ;                                                                                                                                                                                             
    ^                                                                                                                                                                                                       
clang-8: /backup/work/compilers/compiler-source/llvm-8.0.0.src/include/llvm/Support/Casting.h:106: static bool llvm::isa_impl_cl<To, const From*>::doit(const From*) [with To = clang::TagDecl; From = clang
::Decl]: Assertion `Val && "isa<> used on a null pointer"' failed.                                                                                                                                          

@Changochen I would suggest you report the issue to Clang if its latest version still crashed with the code.

Since there is nothing we could do on the C-Reduce side, I am closing the issue. Thanks.

eeide commented 4 years ago

I will mention hat I am working toward a new release of C-Reduce that will us a newer version of LLVM. (My progress has been slow due to other work deadlines, but I hope to complete it soon!)