aws-sdk-cpp icon indicating copy to clipboard operation
aws-sdk-cpp copied to clipboard

[aws-cpp-sdk-core] shut down CRT logging after shutting down CRT

Open grrtrr opened this issue 3 years ago • 1 comments

Issue #, if available: Resolves #1995.

Description of changes: Shut down CRT logging only after the CRT subsystem has been shut down, since logging does happen during shutdown. Currently CRT logging is shut down first, which causes undefined behaviour.

Check all that applies:

  • [X] Did a review by yourself.
  • [X] Added proper tests to cover this PR. (If tests are not applicable, explain.) Ran before/after tests with clang TSAN. Confirmed that this fixes the race condition documented in #1995.
  • [X] Checked if this PR is a breaking (APIs have been changed) change.
  • [X] Checked if this PR will not introduce cross-platform inconsistent behavior.
  • [X] Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • [X] Linux
  • [ ] Windows
  • [ ] Android
  • [ ] MacOS
  • [ ] IOS
  • [ ] Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

grrtrr avatar Jul 12 '22 23:07 grrtrr

@jmklix - please take a look at https://github.com/aws/aws-sdk-cpp/pull/1996/commits/752d68788923c1412033490d85b1165eac06d433 - there was an error in the previous commit: both the CRT and the AWS logging system must be shut down after shutting down CRT. The reason is that the CRT logging subsystem by default redirects to the AWS logging system.

grrtrr avatar Jul 27 '22 19:07 grrtrr

This is failing on cspell - issue may have to do with cspell configuration.

grrtrr avatar Oct 12 '22 18:10 grrtrr