Skip to content

Commit

Permalink
修复开启asan后线程卡死问题
Browse files Browse the repository at this point in the history
  • Loading branch information
xia-chu committed Nov 9, 2023
1 parent 12c2ec7 commit 9331000
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Util/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ void LoggerWrapper::printLogV(Logger &logger, int level, const char *file, const
char *str = nullptr;
if (vasprintf(&str, fmt, ap) > 0 && str) {
info << str;
free(str);
delete [] str; // 开启asan后,用free会卡死
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Util/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ string demangle(const char *mangled) {
string out;
if (status == 0 && demangled) { // Demangling succeeeded.
out.append(demangled);
free(demangled);
delete [] demangled; // 开启asan后,用free会卡死
} else {
out.append(mangled);
}
Expand Down

0 comments on commit 9331000

Please sign in to comment.