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

fix(bindings/bench): Prevent IO from going out of scope #5007

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

goatgoose
Copy link
Contributor

@goatgoose goatgoose commented Jan 8, 2025

Description of changes:

#4847 moved the ownership of the IO streams into TlsConnPair. After this change, the resumption benchmark started failing. I think this change affected the TlsConnPair::split API, which consumed the TlsConnPair and returned the underlying client and server TlsConnections. However, now that the TlsConnPair also owns the IO streams, I think this caused the streams to be dropped, which caused the s2n-tls send/recv callbacks to access invalid memory after split was called.

This PR removes the TlsConnPair::split API to prevent the IO streams from being dropped, and instead provides references to the underlying client and server.

The benchmarks were further broken by #4983, which changed the paths to the bench crate. This PR also updates these paths.

Both of these issues were not caught at PR-time since the bench action currently only runs on pushes to main. To catch similar issues in the future, this PR updates the bench action to build and run on PRs (but not publish any metrics until it's merged).

Call-outs:

None

Testing:

The bench action will now run on all PRs, with the authenticate/publish steps skipped. So the bench action on this PR should build and run successfully: https://github.com/aws/s2n-tls/actions/runs/12677767236/job/35333826698?pr=5007

I temporarily allowed the metrics to be published on PRs in c84990c in order to test this step: https://github.com/aws/s2n-tls/actions/runs/12677418611/job/35332715910?pr=5007

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the s2n-core team label Jan 8, 2025
@goatgoose goatgoose changed the title Fix bench action fix(bindings/bench): Prevent IO from going out of scope Jan 8, 2025
@goatgoose goatgoose marked this pull request as ready for review January 8, 2025 19:57
@goatgoose goatgoose added this pull request to the merge queue Jan 8, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jan 9, 2025
@goatgoose goatgoose added this pull request to the merge queue Jan 9, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants