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

on_chunk_data_biomes3d_bitmasks: index out of bounds: the len is 0 but the index is 0 (chunk_data.bitmasks.data[0] empty array) #654

Open
Dreamail opened this issue Jan 20, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@Dreamail
Copy link

[main.rs:254][INFO] Starting steven
[main.rs:346][INFO] Shader version: #version 150
[main.rs:99][INFO] Detected server protocol version 756
[server/mod.rs:1916][INFO] Received chat message: [GSit] 新版本可用: 1.0.5!
[server/mod.rs:1916][INFO] Received chat message: [GSit] 当前使用版本: 1.0.4!
[server/mod.rs:1916][INFO] Received chat message: [GSit] 下载最新版本:
[server/mod.rs:1916][INFO] Received chat message: [GSit] https://www.spigotmc.org/resources/62325
[server/mod.rs:1916][INFO] Received chat message: [Themis] You're running an outdated version of Themis, you should update as soon as possible!
[server/mod.rs:1916][INFO] Received chat message: An update for PlaceholderAPI (PlaceholderAPI v2.11.1)
[server/mod.rs:1916][INFO] Received chat message: is available at https://www.spigotmc.org/resources/placeholderapi.6245/
[server/mod.rs:1916][INFO] Received chat message: unhandled: multiplayer.player.joined
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', src/server/mod.rs:1957:17
stack backtrace:
0: _rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::panic_bounds_check
3: stevenarella::server::Server::entity_tick
4: stevenarella::server::Server::tick
5: stevenarella::tick_all
6: stevenarella::main2::{{closure}}
7: <winit::platform_impl::platform::app_state::EventLoopHandler as winit::platform_impl::platform::app_state::EventHandler>::handle_nonuser_event
8: winit::platform_impl::platform::app_state::Handler::handle_nonuser_event
9: winit::platform_impl::platform::app_state::AppState::cleared
10: winit::platform_impl::platform::observer::control_flow_end_handler
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21: winit::platform_impl::platform::event_loop::EventLoop::run
22: winit::event_loop::EventLoop::run
23: stevenarella::main
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

@iceiix
Copy link
Owner

iceiix commented Aug 28, 2022

thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', src/server/mod.rs:1957:17

If this was on build 9a8d357, from 1/17/2022, appears the crash is an OOB in reading chunk data:

    fn on_chunk_data_biomes3d_bitmasks(
        &mut self,
        chunk_data: packet::play::clientbound::ChunkData_Biomes3D_Bitmasks,
    ) {
        self.world
            .load_chunk117(
                chunk_data.chunk_x,
                chunk_data.chunk_z,
                true,
                chunk_data.bitmasks.data[0] as u64, // TODO: get all bitmasks  // <-- HERE
                16,                                 // TODO: get all bitmasks
                chunk_data.data.data,
            )
            .unwrap();
        self.load_block_entities(chunk_data.block_entities.data);
    }

so chunk_data.bitmasks.data is empty, but this case isn't handled. But if there is no data, is there any chunk to load? Are these "empty" chunks, should they be skipped?

@iceiix iceiix changed the title Client crash when connect to server on_chunk_data_biomes3d_bitmasks: index out of bounds: the len is 0 but the index is 0 (chunk_data.bitmasks.data[0] empty array) Aug 28, 2022
@iceiix iceiix added the bug Something isn't working label Aug 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants