This repository has been archived by the owner on Jun 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
fix: multiple asan errors #715
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ | |
#include <dsn/utility/filesystem.h> | ||
#include <dsn/utility/flags.h> | ||
#include <dsn/utils/time_utils.h> | ||
#include <fmt/format.h> | ||
|
||
namespace dsn { | ||
namespace tools { | ||
|
@@ -58,17 +59,17 @@ static void print_header(FILE *fp, dsn_log_level_t log_level) | |
static char s_level_char[] = "IDWEF"; | ||
|
||
uint64_t ts = dsn_now_ns(); | ||
char str[24]; | ||
dsn::utils::time_ms_to_string(ts / 1000000, str); | ||
std::string time_str; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
dsn::utils::time_ms_to_string(ts / 1000000, time_str); | ||
|
||
int tid = dsn::utils::get_current_tid(); | ||
fprintf(fp, | ||
"%c%s (%" PRIu64 " %04x) %s", | ||
s_level_char[log_level], | ||
str, | ||
ts, | ||
tid, | ||
log_prefixed_message_func().c_str()); | ||
fmt::print(fp, | ||
"{}{} ({} {}) {}", | ||
s_level_char[log_level], | ||
time_str, | ||
ts, | ||
tid, | ||
log_prefixed_message_func()); | ||
} | ||
|
||
screen_logger::screen_logger(bool short_header) : logging_provider("./") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What kind of memory leak? Can you describe it in detail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"__call_tls_dtors" means the threadlocal vars are freed. But
print_header
is still reading those vars. It causes an asan error. I have no idea why this happens.