We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The code in [1] calls std::localtime, which might not thread safe [2]. Sample as
std::localtime
WARNING: ThreadSanitizer: data race (pid=119895) Write of size 8 at 0x7b04000007d0 by thread T50: #0 free /home/admin/llvm/llvm-project-17.0.3.src/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:722:3 (cz_fs_unittest+0x28fba05) #1 tzset_internal /home/lyukefan/deps/glibc-2.18/time/tzset.c:440:3 (libc.so.6+0xab3da) #2 qcloud_cos::LogUtil::GetLogPrefix(int) <null> (cz_fs_unittest+0x3526295) Previous write of size 8 at 0x7b04000007d0 by thread T65: #0 malloc /home/admin/llvm/llvm-project-17.0.3.src/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:663:5 (cz_fs_unittest+0x28fb2ac) #1 __strdup /home/lyukefan/deps/glibc-2.18/string/strdup.c:42:15 (libc.so.6+0x84a7a) #2 qcloud_cos::LogUtil::GetLogPrefix(int)
[1] https://github.com/tencentyun/cos-cpp-sdk-v5/blob/549a3affecc0d851a8947b9684c2a09e458aadf8/src/util/log_util.cpp#L20C47-L20C62 [2] https://github.com/tencentyun/cos-cpp-sdk-v5/blob/549a3affecc0d851a8947b9684c2a09e458aadf8/src/util/log_util.cpp#L20C47-L20C62
The text was updated successfully, but these errors were encountered:
@Huberyxiao would you mind take a look?
Sorry, something went wrong.
No branches or pull requests
The code in [1] calls
std::localtime
, which might not thread safe [2]. Sample as[1] https://github.com/tencentyun/cos-cpp-sdk-v5/blob/549a3affecc0d851a8947b9684c2a09e458aadf8/src/util/log_util.cpp#L20C47-L20C62
[2] https://github.com/tencentyun/cos-cpp-sdk-v5/blob/549a3affecc0d851a8947b9684c2a09e458aadf8/src/util/log_util.cpp#L20C47-L20C62
The text was updated successfully, but these errors were encountered: