Skip to content

[aws-cpp-sdk-core]: do not flush ResponseStream before deletion #2320

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

Closed
wants to merge 1 commit into from

Conversation

grrtrr
Copy link
Contributor

@grrtrr grrtrr commented Jan 30, 2023

Flushing the ResponseStream before deletion causes undefined behaviour and segmentation faults, since the ResponseStream is destructed after the actual download has completed.

Resolves #58, #2319 and in part #1732.

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
    Tested with a reproducing command (which reliably produced the segmentation fault described in [aws-cpp-sdk-core] undefined behaviour when flushing ResponseStream before deletion #2319) that the condition no longer occurs after applying this change.
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • 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.

  • 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.

@jmklix jmklix added the needs-review This issue or pull request needs review from a core team member. label Feb 1, 2023
@SergeyRyabinin
Copy link
Contributor

Hi @grrtrr,

I have merged your commit as a part of #2351 (sorry I forgot to merge your PR first). I have made some additional changes to this class (to register callback on the underlying stream) and the completion notification logic (flush stream in TransferManager before updating the status).
Thank you again for a great finding and analysis.

Best regards,
Sergey

@grrtrr grrtrr deleted the issue_2319 branch February 17, 2023 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-review This issue or pull request needs review from a core team member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FileStream should flush on network operation complete
3 participants