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

Panic in GetObject on MinimumThroughputDownloadBody #1214

Closed
1 task
trueb2 opened this issue Nov 13, 2024 · 3 comments
Closed
1 task

Panic in GetObject on MinimumThroughputDownloadBody #1214

trueb2 opened this issue Nov 13, 2024 · 3 comments
Labels
bug This issue is a bug. p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to 'closing-soon' in 7 days.

Comments

@trueb2
Copy link

trueb2 commented Nov 13, 2024

Describe the bug

It looks like the length underflowed in the MinimumThroughputDownloadBody. On indexing, it panicked.

impl<const N: usize> LogBuffer<N> {
...
    /// Mutably returns the tail of the buffer.
    ///
    /// ## Panics
    ///
    /// The buffer MUST have at least one bin in it before this is called.
    fn tail_mut(&mut self) -> &mut Bin {
        debug_assert!(self.length > 0);
        &mut self.entries[self.length - 1]
    }

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Graceful erroring, no panicking.

Current Behavior

After much usage (month+ uptime) and many, many API calls, I notice the following panic.

thread 'actix-server worker 2' panicked at /Users/username/.cargo/registry/src/index.crates.io-6f17d22bba15001f/aws-smithy-runtime-1.5.4/src/client/http/body/minimum_throughput/throughput.rs:199:14:
index out of bounds: the len is 10 but the index is 18446744073709551615
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic_bounds_check
   3: aws_smithy_runtime::client::http::body::minimum_throughput::http_body_0_4_x::<impl http_body::Body for aws_smithy_runtime::client::http::body::minimum_throughput::MinimumThroughputDownloadBody<B>>::poll_data
   4: <http_body::combinators::map_err::MapErr<B,F> as http_body::Body>::poll_data
   5: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll
   6: aws_smithy_runtime::client::orchestrator::try_attempt::{{closure}}::{{closure}}
   7: <aws_smithy_async::future::timeout::Timeout<T,S> as core::future::future::Future>::poll
   8: <aws_smithy_runtime::client::timeout::MaybeTimeoutFuture<InnerFuture> as core::future::future::Future>::poll
   9: aws_smithy_runtime::client::orchestrator::try_op::{{closure}}::{{closure}}
  10: <aws_smithy_async::future::timeout::Timeout<T,S> as core::future::future::Future>::poll
  11: <aws_smithy_runtime::client::timeout::MaybeTimeoutFuture<InnerFuture> as core::future::future::Future>::poll
  12: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll
  13: aws_smithy_runtime::client::orchestrator::invoke_with_stop_point::{{closure}}
  14: aws_sdk_s3::operation::get_object::builders::GetObjectFluentBuilder::send::{{closure}}
  15: asdfasdfasdf::get_object::{{closure}}::{{closure}}
  16: <tracing::instrument::Instrumented<T> as core::future::future::Future>::poll
  17: asdfasdfasdf::get_object::{{closure}}

I bumped in May and noticed this new panic recently.

-aws-config = { version = "1.1.3", features = ["behavior-version-latest"] }
-aws-sdk-s3 = "1.13.0"
+aws-config = { version = "1.4.0", features = ["behavior-version-latest"] }
+aws-sdk-s3 = "1.29.0"

Reproduction Steps

Same as #1133

Possible Solution

Prevent underflow and/or add checks for underflow.

Additional Information/Context

No response

Version

├── aws-config v1.5.0
│   ├── aws-credential-types v1.2.0
│   │   ├── aws-smithy-async v1.2.1
│   │   ├── aws-smithy-runtime-api v1.6.1
│   │   │   ├── aws-smithy-async v1.2.1 (*)
│   │   │   ├── aws-smithy-types v1.1.10
│   │   ├── aws-smithy-types v1.1.10 (*)
│   ├── aws-runtime v1.2.2
│   │   ├── aws-credential-types v1.2.0 (*)
│   │   ├── aws-sigv4 v1.2.1
│   │   │   ├── aws-credential-types v1.2.0 (*)
│   │   │   ├── aws-smithy-eventstream v0.60.4
│   │   │   │   ├── aws-smithy-types v1.1.10 (*)
│   │   │   ├── aws-smithy-http v0.60.8
│   │   │   │   ├── aws-smithy-eventstream v0.60.4 (*)
│   │   │   │   ├── aws-smithy-runtime-api v1.6.1 (*)
│   │   │   │   ├── aws-smithy-types v1.1.10 (*)
│   │   │   ├── aws-smithy-runtime-api v1.6.1 (*)
│   │   │   ├── aws-smithy-types v1.1.10 (*)
│   │   ├── aws-smithy-async v1.2.1 (*)
│   │   ├── aws-smithy-eventstream v0.60.4 (*)
│   │   ├── aws-smithy-http v0.60.8 (*)
│   │   ├── aws-smithy-runtime-api v1.6.1 (*)
│   │   ├── aws-smithy-types v1.1.10 (*)
│   │   ├── aws-types v1.3.0
│   │   │   ├── aws-credential-types v1.2.0 (*)
│   │   │   ├── aws-smithy-async v1.2.1 (*)
│   │   │   ├── aws-smithy-runtime-api v1.6.1 (*)
│   │   │   ├── aws-smithy-types v1.1.10 (*)
│   ├── aws-sdk-sso v1.26.0
│   │   ├── aws-credential-types v1.2.0 (*)
│   │   ├── aws-runtime v1.2.2 (*)
│   │   ├── aws-smithy-async v1.2.1 (*)
│   │   ├── aws-smithy-http v0.60.8 (*)
│   │   ├── aws-smithy-json v0.60.7
│   │   │   └── aws-smithy-types v1.1.10 (*)
│   │   ├── aws-smithy-runtime v1.5.4
│   │   │   ├── aws-smithy-async v1.2.1 (*)
│   │   │   ├── aws-smithy-http v0.60.8 (*)
│   │   │   ├── aws-smithy-runtime-api v1.6.1 (*)
│   │   │   ├── aws-smithy-types v1.1.10 (*)
│   │   ├── aws-smithy-runtime-api v1.6.1 (*)
│   │   ├── aws-smithy-types v1.1.10 (*)
│   │   ├── aws-types v1.3.0 (*)
│   ├── aws-sdk-ssooidc v1.27.0
│   │   ├── aws-credential-types v1.2.0 (*)
│   │   ├── aws-runtime v1.2.2 (*)
│   │   ├── aws-smithy-async v1.2.1 (*)
│   │   ├── aws-smithy-http v0.60.8 (*)
│   │   ├── aws-smithy-json v0.60.7 (*)
│   │   ├── aws-smithy-runtime v1.5.4 (*)
│   │   ├── aws-smithy-runtime-api v1.6.1 (*)
│   │   ├── aws-smithy-types v1.1.10 (*)
│   │   ├── aws-types v1.3.0 (*)
│   ├── aws-sdk-sts v1.26.0
│   │   ├── aws-credential-types v1.2.0 (*)
│   │   ├── aws-runtime v1.2.2 (*)
│   │   ├── aws-smithy-async v1.2.1 (*)
│   │   ├── aws-smithy-http v0.60.8 (*)
│   │   ├── aws-smithy-json v0.60.7 (*)
│   │   ├── aws-smithy-query v0.60.7
│   │   │   ├── aws-smithy-types v1.1.10 (*)
│   │   ├── aws-smithy-runtime v1.5.4 (*)
│   │   ├── aws-smithy-runtime-api v1.6.1 (*)
│   │   ├── aws-smithy-types v1.1.10 (*)
│   │   ├── aws-smithy-xml v0.60.8
│   │   ├── aws-types v1.3.0 (*)
│   ├── aws-smithy-async v1.2.1 (*)
│   ├── aws-smithy-http v0.60.8 (*)
│   ├── aws-smithy-json v0.60.7 (*)
│   ├── aws-smithy-runtime v1.5.4 (*)
│   ├── aws-smithy-runtime-api v1.6.1 (*)
│   ├── aws-smithy-types v1.1.10 (*)
│   ├── aws-types v1.3.0 (*)
├── aws-sdk-s3 v1.30.0
│   ├── aws-credential-types v1.2.0 (*)
│   ├── aws-runtime v1.2.2 (*)
│   ├── aws-sigv4 v1.2.1 (*)
│   ├── aws-smithy-async v1.2.1 (*)
│   ├── aws-smithy-checksums v0.60.8
│   │   ├── aws-smithy-http v0.60.8 (*)
│   │   ├── aws-smithy-types v1.1.10 (*)
│   ├── aws-smithy-eventstream v0.60.4 (*)
│   ├── aws-smithy-http v0.60.8 (*)
│   ├── aws-smithy-json v0.60.7 (*)
│   ├── aws-smithy-runtime v1.5.4 (*)
│   ├── aws-smithy-runtime-api v1.6.1 (*)
│   ├── aws-smithy-types v1.1.10 (*)
│   ├── aws-smithy-xml v0.60.8 (*)
│   ├── aws-types v1.3.0 (*)
│   ├── aws-config v1.5.0 (*)
│   ├── aws-sdk-s3 v1.30.0 (*)


### Environment details (OS name and version, etc.)

macOS 12.6

### Logs

_No response_
@trueb2 trueb2 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 13, 2024
@trueb2 trueb2 changed the title Panic in GetObject Panic in GetObject on MinimumThroughputDownloadBody Nov 13, 2024
@aajtodd
Copy link
Contributor

aajtodd commented Nov 13, 2024

I believe this has been fixed (see smithy-lang/smithy-rs#3744). Can you try updating to latest SDK and runtime to see if the issue is resolved?

@aajtodd aajtodd added response-requested Waiting on additional info and feedback. Will move to 'closing-soon' in 7 days. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Nov 13, 2024
@trueb2
Copy link
Author

trueb2 commented Nov 13, 2024

I will update my dependencies!

Since this took a long time to hit on my end, I am okay with closing the issue and re-opening down the road if it reoccurs.

@trueb2 trueb2 closed this as completed Nov 13, 2024
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue response-requested Waiting on additional info and feedback. Will move to 'closing-soon' in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants