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

Returning body w/ >4GB data panics #1141

Closed
crepererum opened this issue Nov 8, 2022 · 0 comments · Fixed by #1142 or #1164
Closed

Returning body w/ >4GB data panics #1141

crepererum opened this issue Nov 8, 2022 · 0 comments · Fixed by #1142 or #1164

Comments

@crepererum
Copy link
Contributor

crepererum commented Nov 8, 2022

Bug Report

Version

master (e1885211495e63d962bc1d00f9be6eeaab2bb901)

Description

This test panics with thread 'codec::prost::tests::encode_big' panicked at 'assertion failed: len <= std::u32::MAX as usize', tonic/src/codec/encode.rs:127:5, but instead the stream should probably return an error:

    #[tokio::test]
    async fn encode_big() {
        let encoder = MockEncoder::default();

        let msg = vec![0u8; u32::MAX as usize + 1];

        let messages = std::iter::once(Ok::<_, Status>(msg));
        let source = futures_util::stream::iter(messages);

        let body = encode_server(
            encoder,
            source,
            None,
            SingleMessageCompressionOverride::default(),
        );

        futures_util::pin_mut!(body);

        while let Some(r) = body.data().await {
            r.unwrap();
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant