jam1garner / jam1garner/gm_data_win

Pizza Tower panics

Open
#2 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
13
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Running `gm_modding_tool -a -s -t` crashes with `thread 'main' panicked at 'slice index starts at 18446744073708544524 but ends at 9180', src/file_structs/track_slice.rs:22:14`. It looks like this has to do with fonts. Backtrace:
```
stack backtrace:
0: rust_begin_unwind
at /rustc/5c8bff74bc1c52bef0c79f3689bb227f51f3e82d/library/std/src/panicking.rs:575:5
1: core::panicking::panic_fmt
at /rustc/5c8bff74bc1c52bef0c79f3689bb227f51f3e82d/library/core/src/panicking.rs:65:14
2: core::slice::index::slice_index_order_fail_rt
at /rustc/5c8bff74bc1c52bef0c79f3689bb227f51f3e82d/library/core/src/slice/index.rs:97:5
3: core::slice::index::slice_index_order_fail
at /rustc/5c8bff74bc1c52bef0c79f3689bb227f51f3e82d/library/core/src/slice/index.rs:91:14
4: gm_data_win::file_structs::font::get_char_entry_at_offset
5: as alloc::vec::spec_from_iter::SpecFromIter>::from_iter
6: gm_data_win::file_structs::font::get_font_entry_at_offset
7: as alloc::vec::spec_from_iter::SpecFromIter>::from_iter
8: ::take
9: gm_data_win::file_structs::Section::take
10: gm_data_win::file_structs::take_data_win_file
11: gm_data_win::main
12: gm_modding_tool::main
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the crash with `gm_modding_tool -a -s -t`, then start at `src/file_structs/track_slice.rs:22:14` and trace the font parsing calls shown in the backtrace, especially `get_char_entry_at_offset` and `get_font_entry_at_offset`. Done means the command no longer panics while processing the font data and the affected parsing behavior is covered by a suitable check.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.