|
@@ -16,11 +16,12 @@ void sig_crash(int sig) {
|
|
|
printf("crash---->sig=%d \n",sig);
|
|
|
FILE *fd;
|
|
|
struct stat buf;
|
|
|
- stat("./crash.log", &buf);
|
|
|
+ const char * crash_path = "./video_similarity_comparison_crash.txt";
|
|
|
+ stat(crash_path, &buf);
|
|
|
if (buf.st_size > 10 * 1000 * 1000) { // 超过10兆则清空内容
|
|
|
- fd = fopen("/datalog/crash.log", "w");
|
|
|
+ fd = fopen(crash_path, "w");
|
|
|
} else {
|
|
|
- fd = fopen("/datalog/crash.log", "at");
|
|
|
+ fd = fopen(crash_path, "at");
|
|
|
}
|
|
|
|
|
|
if (NULL == fd) {
|
|
@@ -61,7 +62,7 @@ void sig_crash(int sig) {
|
|
|
size_t pos2 = symbol.find_last_of("]");
|
|
|
std::string address = symbol.substr(pos1 + 1, pos2 - pos1 -1);
|
|
|
char cmd[128] = {0, };
|
|
|
- sprintf(cmd, "addr2line -e test %s", address.c_str()); // test为应用程序名称,需要改为用户自己的应用程序名
|
|
|
+ sprintf(cmd, "addr2line -e video_similarity_comparison %s", address.c_str()); // test为应用程序名称,需要改为用户自己的应用程序名
|
|
|
FILE *fPipe = popen(cmd, "r");
|
|
|
if(fPipe != NULL){
|
|
|
char buff[1024];
|