Closed vsoch closed 5 years ago
Here is the full backtrace
Singularity rustarok_latest.sif:/code> RUST_BACKTRACE=full cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.60s
Running `target/debug/rustarok`
[00:00:04.421] (7fc375044f40) INFO GRF loading: 4421ms
[00:00:04.944] (7fc375044f40) INFO rsw loaded: 123ms
[src/asset/gat.rs:137] non_walkable_cells.iter().filter(|&&it| it).count() = 60788
[src/asset/gat.rs:184] rectangles.len() = 1317
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 30, kind: Other, message: "Read-only file system" }', src/libcore/result.rs:1084:5
stack backtrace:
0: 0x55e7d2ae990b - backtrace::backtrace::libunwind::trace::h89fcc71e59e3bc5b
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.34/src/backtrace/libunwind.rs:88
1: 0x55e7d2ae990b - backtrace::backtrace::trace_unsynchronized::h0bad9be1379e729a
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.34/src/backtrace/mod.rs:66
2: 0x55e7d2ae990b - std::sys_common::backtrace::_print::hd3382a1f33c473da
at src/libstd/sys_common/backtrace.rs:47
3: 0x55e7d2ae990b - std::sys_common::backtrace::print::h0ec6f03cfb8e76a6
at src/libstd/sys_common/backtrace.rs:36
4: 0x55e7d2ae990b - std::panicking::default_hook::{{closure}}::h96cbf7b454e3f557
at src/libstd/panicking.rs:200
5: 0x55e7d2ae95e6 - std::panicking::default_hook::h95a8f00337383d83
at src/libstd/panicking.rs:214
6: 0x55e7d2aea07d - std::panicking::rust_panic_with_hook::h92f98b46e22f14ed
at src/libstd/panicking.rs:477
7: 0x55e7d2ae9c02 - std::panicking::continue_panic_fmt::h25abfbb4e5b7043a
at src/libstd/panicking.rs:384
8: 0x55e7d2ae9ae6 - rust_begin_unwind
at src/libstd/panicking.rs:311
9: 0x55e7d2b06b9d - core::panicking::panic_fmt::h7e9f94035af782b3
at src/libcore/panicking.rs:85
10: 0x55e7d2b06c97 - core::result::unwrap_failed::hf7591c1dd9412006
at src/libcore/result.rs:1084
11: 0x55e7d18dfb80 - core::result::Result<T,E>::unwrap::he99716b5bd479fb8
at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libcore/result.rs:852
12: 0x55e7d1cfd5f2 - rustarok::asset::gat::Gat::load::h5f7cfb0dbf5f6a46
at src/asset/gat.rs:98
13: 0x55e7d1b8d2ad - rustarok::asset::AssetLoader::load_gat::h6df7cf26be4c8b32
at src/asset/mod.rs:225
14: 0x55e7d1a7f08b - rustarok::runtime_assets::map::load_map::{{closure}}::h8167556557d793ca
at src/runtime_assets/map.rs:103
15: 0x55e7d1c2de82 - rustarok::common::measure_time::h4c287301525f77ad
at src/common.rs:7
16: 0x55e7d19eb436 - rustarok::runtime_assets::map::load_map::h65ca5dfd2f8caa64
at src/runtime_assets/map.rs:103
17: 0x55e7d1d3cf95 - rustarok::main::hb7c72c5818772e1c
at src/main.rs:158
18: 0x55e7d1b6eb30 - std::rt::lang_start::{{closure}}::h81a88e942b930602
at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/rt.rs:64
19: 0x55e7d2ae9a83 - std::rt::lang_start_internal::{{closure}}::h4e93c1949c7a1955
at src/libstd/rt.rs:49
20: 0x55e7d2ae9a83 - std::panicking::try::do_call::h9440ccd4dc467eaa
at src/libstd/panicking.rs:296
21: 0x55e7d2aee8da - __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:80
22: 0x55e7d2aea58d - std::panicking::try::hc046e7ee42ee744f
at src/libstd/panicking.rs:275
23: 0x55e7d2aea58d - std::panic::catch_unwind::h27dfc457c200aee0
at src/libstd/panic.rs:394
24: 0x55e7d2aea58d - std::rt::lang_start_internal::hea1b49a567afe309
at src/libstd/rt.rs:48
25: 0x55e7d1b6eb09 - std::rt::lang_start::h3d0a7211be25b391
at /rustc/625451e376bb2e5283fc4741caa0a3e8a2ca4d54/src/libstd/rt.rs:64
26: 0x55e7d1d4314a - main
27: 0x7fc3791bc09b - __libc_start_main
28: 0x55e7d171532a - _start
29: 0x0 - <unknown>
Hi, nice catch!
TL;DR: Comment out the code in gat.rs from line 98 to 115, or make it optional based on having write rights.
Long story: The game read map walkability data from the map file, but its resolution is single-cell based. So generating nphysics rectangles for all the cells separately is expensive and the game would be really slow. Therefore, there is an algorithm which merges single cells into the largest possible rectangles, it reduces the number of rectangles the game has to create from ~90k to 100-300 in some maps. However this merging takes time, so I cached its result and wrote into a file. By commenting out those lines, you skip this caching part and the game will always do the merging process on startup.
Awesome! Let me give this a try.
I fixed the issue and tested it with a read-only working directory, it worked.
Thanks for noticing the bug!
I'm finishing up a version in a container for linux, and the last bit that I need to know is where exactly the game expects to have write. I know that cargo/debug/.cargo-lock needs write, but the error message doesn't tell me where else it would be needed:
As soon as I know this, I think it should work!