Skip to content
New issue

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

Issue 2568 #2569

Merged
merged 4 commits into from
Jul 12, 2023
Merged

Issue 2568 #2569

merged 4 commits into from
Jul 12, 2023

Conversation

hunjmes
Copy link
Contributor

@hunjmes hunjmes commented Jul 11, 2023

Issue #, if available:
#2568

Description of changes:
A recent change caused redundant calls to Aws::ShutdownAPI() to crash, with
SEGV, due to null pointer dereference.

This commit fixes this regression and adds a unit test that shows that
calling Aws::ShutdownAPI() multiple times no longer crashes.

Also updates function CleanupEnumOverflowContainer() to prevent a
double-free on shutdown.

Check all that applies:

  • [x ] Did a review by yourself.
  • [x ] Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • [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.

A recent change caused redundant calls to Aws::ShutdownAPI() to crash, with SEGV, due to null pointer dereference.

This commit fixes this regression and adds a unit test that shows
that calling Aws::ShutdownAPI() multiple times no longer crashes.
@@ -42,7 +42,6 @@ namespace Aws
void ShutdownComponentRegistry()
{
std::unique_lock<std::mutex> lock(s_registryMutex);
assert(s_registry);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to keep these asserts, but it will crash apps build in debug mode.

@jmklix jmklix linked an issue Jul 11, 2023 that may be closed by this pull request
@SergeyRyabinin SergeyRyabinin merged commit c33b721 into aws:main Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aws::ShutdownAPI() now SEGVs when called twice
3 participants