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

Stack overflow when reading length of a big message #7

Open
griffi-gh opened this issue Jun 22, 2022 · 1 comment
Open

Stack overflow when reading length of a big message #7

griffi-gh opened this issue Jun 22, 2022 · 1 comment

Comments

@griffi-gh
Copy link

griffi-gh commented Jun 22, 2022

2022-06-22T11:26:08.570096Z  INFO bevy_eventwork::tcp: Message length: 131113
2022-06-22T11:26:08.570585Z  INFO bevy_eventwork::tcp: Reading message into buffer
2022-06-22T11:26:08.571064Z  INFO bevy_eventwork::tcp: Message read
2022-06-22T11:26:08.609159Z  INFO bevy_eventwork::tcp: Message deserialized and sent to eventwork

// (beeg message starts here?)

2022-06-22T11:26:08.609828Z  INFO bevy_eventwork::tcp: Reading message length

thread 'main' has overflowed its stack
error: process didn't exit successfully: `target\debug\client.exe` (exit code: 0xc000041d)
@griffi-gh
Copy link
Author

griffi-gh commented Jun 22, 2022

pub const CHUNK_SIZE: usize = 16;
pub const CHUNK_HEIGHT: usize = 256;

#[derive(Serialize, Deserialize, Debug, Clone, Copy)]
pub struct Block {
  block_type: u16
}

#[serde_as]
#[derive(Serialize, Deserialize, Clone)]
pub struct ChunkData (
  #[serde_as(as = "Box<[[[_; CHUNK_SIZE]; CHUNK_HEIGHT]; CHUNK_SIZE]>")]
  pub Box<[[[Block; CHUNK_SIZE]; CHUNK_HEIGHT]; CHUNK_SIZE]>
);

#[derive(Serialize, Deserialize, Clone)]
pub struct ChunkDataMessage {
  pub data: ChunkData,
  pub x: i64,
  pub y: i64
}

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

No branches or pull requests

1 participant