clang:错误:无法执行命令:分段错误clang:错误:clang前端命令由于信号失败(使用-v查看调用)

时间:2019-05-22 14:57:30

标签: linux clang

试图编译一个简单的函数 /home/oussama/afl-2.52b/afl-clang-fast -fno-inline -o test test.cc 我有这样简单的代码,并尝试使用上面的命令行进行编译,但是我遇到了这个错误:

clang: error: clang frontend command failed due to signal (use -v to see invocation)
#include <stdlib.h>
#include <unistd.h>

void test(char *buf) {
    if (buf[0] == 'C') {
        if (buf[1] == 'r') {
            if (buf[2] == 'a') {
                if (buf[3] == 's') {
                    if (buf[4] == 'h') {
                        if (buf[5] == ' ') {
                            if (buf[6] == 'M') {
                                if (buf[7] == 'e') {
                                    abort();
                                }
                            }
                        }
                    }
                }
            }
        }
    }
} 
int main (int argc, char* argv[]){
    char buf[10];
    read(STDIN_FILENO,buf,sizeof(buf));
    test(buf);
    return 0;
}

0 个答案:

没有答案
相关问题