Closed grrtrr closed 1 year ago
Thanks for finding this taking the time to make a PR. I will try to get the reviewed and merged
This doesn't pass some of our tests required before merging. Does this effect your program in any way or do you only find it when running TSAN analyzer?
This doesn't pass some of our tests required before merging. Does this effect your program in any way or do you only find it when running TSAN analyzer?
Do you mean #1996, and what kind of tests are failing?
The logging system needs to be shut down after the components that use it, otherwise segmentation faults will result - regardless of TSAN or not. We have had these in production.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
The
ShutdownAPI
call insource/Aws.cpp
first callsAws::Utils::Logging::ShutdownCRTLogging()
(if logging was enabled), and thenAws::CleanupCrt()
.This causes issues on shutdown of the CRT subsystem - threads that are in the process of being shut down may still emit logging messages to the (already shut down)
CRTLogSystemInterface
, leading to undefined behaviour and a race condition (please see below).Expected Behavior
ShutdownAPI
cleanly shuts down all involved components.Current Behavior
When running test using the clang TSAN analyzer, one can observe the above described race conditions:
Reproduction Steps
Run programs / integration test under clang TSAN analyzer.
Possible Solution
Shut down the CRT subsystem first, before shutting down its logging system.
Additional Information/Context
No response
AWS CPP SDK version used
1.9.x (1.9.170, but problem also on master).
Compiler and Version used
clang11
Operating System and version
Linux, ubuntu 18.04