Skip to content

set_len violation when fetching leaderboards #286

@andreiverse

Description

@andreiverse

Seems to be caused by this line inside user_stats.rs:

details.set_len(entry.m_cDetails as usize);
thread '<unnamed>' (18460) panicked at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb\library\alloc\src\vec\mod.rs:2013:9:
unsafe precondition(s) violated: Vec::set_len requires that new_len <= capacity()

This indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety.
stack backtrace:
   0:     0x7ff78c77d662 - std::backtrace_rs::backtrace::win64::trace
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library\std\src\..\..\backtrace\src\backtrace\win64.rs:85
   1:     0x7ff78c77d662 - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ff78c77d662 - std::sys::backtrace::_print_fmt
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library\std\src\sys\backtrace.rs:66
   3:     0x7ff78c77d662 - std::sys::backtrace::impl$0::print::impl$0::fmt
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library\std\src\sys\backtrace.rs:39
   4:     0x7ff78c78a66a - core::fmt::rt::Argument::fmt
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library\core\src\fmt\rt.rs:173
   5:     0x7ff78c78a66a - core::fmt::write
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library\core\src\fmt\mod.rs:1468
   6:     0x7ff78c757fae - std::io::default_write_fmt
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library\std\src\io\mod.rs:639
   7:     0x7ff78c757fae - std::io::Write::write_fmt<std::sys::stdio::windows::Stderr>
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library\std\src\io\mod.rs:1954
   8:     0x7ff78c76a425 - std::sys::backtrace::BacktraceLock::print
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library\std\src\sys\backtrace.rs:42
   9:     0x7ff78c76fbc9 - std::panicking::default_hook::closure$0
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library\std\src\panicking.rs:301
  10:     0x7ff78c76f9b8 - std::panicking::default_hook
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library\std\src\panicking.rs:328
  11:     0x7ff78c77050b - std::panicking::panic_with_hook
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library\std\src\panicking.rs:834
  12:     0x7ff78c7702a2 - std::panicking::panic_handler::closure$0
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library\std\src\panicking.rs:700
  13:     0x7ff78c76a62f - std::sys::backtrace::__rust_end_short_backtrace<std::panicking::panic_handler::closure_env$0,never$>
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library\std\src\sys\backtrace.rs:174
  14:     0x7ff78c754afe - std::panicking::panic_handler
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library\std\src\panicking.rs:698
  15:     0x7ff78c8febd5 - core::panicking::panic_nounwind_fmt
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library\core\src\intrinsics\mod.rs:2435
  16:     0x7ff78b9a1dc7 - alloc::vec::impl$1::set_len::precondition_check
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb\library\core\src\ub_checks.rs:72
  17:     0x7ff78bc1fce8 - alloc::vec::Vec<i32,alloc::alloc::Global>::set_len<i32,alloc::alloc::Global>
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb\library\alloc\src\vec\mod.rs:2013
  18:     0x7ff78b9d71dd - steamworks::user_stats::impl$0::download_leaderboard_entries::closure$0<steamworks::ClientManager,app::fetch_leaderboard::closure_env$3>
                               at C:\Users\andrei\.cargo\git\checkouts\steamworks-rs-ff4e63136d772f64\a0b0f97\src\user_stats.rs:209
  19:     0x7ff78baa620e - steamworks::callback::register_call_result::closure$0<steamworks_sys::LeaderboardScoresDownloaded_t,steamworks::user_stats::impl$0::download_leaderboard_entries::closure_env$0<steamworks::ClientManager,app::fetch_leaderboard::closure_env$3>,steamworks::Cli
                               at C:\Users\andrei\.cargo\git\checkouts\steamworks-rs-ff4e63136d772f64\a0b0f97\src\callback.rs:72
  20:     0x7ff78baaa25a - core::ops::function::FnOnce::call_once<steamworks::callback::register_call_result::closure_env$0<steamworks_sys::LeaderboardScoresDownloaded_t,steamworks::user_stats::impl$0::download_leaderboard_entries::closure_env$0<steamworks::ClientManager,app::fetch_
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb\library\core\src\ops\function.rs:250
  21:     0x7ff78bc02974 - alloc::boxed::impl$29::call_once<tuple$<ptr_mut$<core::ffi::c_void>,bool>,dyn$<core::ops::function::FnOnce<tuple$<ptr_mut$<core::ffi::c_void>,bool>,assoc$<Output,tuple$<> > >,core::marker::Send>,alloc::alloc::Global>
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb\library\alloc\src\boxed.rs:1985
  22:     0x7ff78ba2088b - steamworks::Client<steamworks::ClientManager>::run_callbacks<steamworks::ClientManager>
                               at C:\Users\andrei\.cargo\git\checkouts\steamworks-rs-ff4e63136d772f64\a0b0f97\src\lib.rs:246
  23:     0x7ff78baf010c - app::main::closure$0::closure$2
                               at C:\Users\andrei\Desktop\mathbits-next\src-tauri\src\main.rs:363
  24:     0x7ff78bc50a1e - core::hint::black_box
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb\library\core\src\hint.rs:472
  25:     0x7ff78bc50a1e - std::sys::backtrace::__rust_begin_short_backtrace<app::main::closure$0::closure_env$2,tuple$<> >
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb\library\std\src\sys\backtrace.rs:158
  26:     0x7ff78bc193f0 - std::thread::impl$0::spawn_unchecked_::closure$1::closure$0<app::main::closure$0::closure_env$2,tuple$<> >
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb\library\std\src\thread\mod.rs:559
  27:     0x7ff78bc5d651 - core::panic::unwind_safe::impl$25::call_once<tuple$<>,std::thread::impl$0::spawn_unchecked_::closure$1::closure_env$0<app::main::closure$0::closure_env$2,tuple$<> > >
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb\library\core\src\panic\unwind_safe.rs:274
  28:     0x7ff78bc7ecc0 - std::panicking::catch_unwind::do_call<core::panic::unwind_safe::AssertUnwindSafe<std::thread::impl$0::spawn_unchecked_::closure$1::closure_env$0<app::main::closure$0::closure_env$2,tuple$<> > >,tuple$<> >
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb\library\std\src\panicking.rs:590
  29:     0x7ff78bc19893 - std::thread::impl$0::spawn_unchecked_::closure$1::closure$0::closure$0<app::main::closure$0::closure_env$2,tuple$<> >
  30:     0x7ff78bc18923 - std::panicking::catch_unwind
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb\library\std\src\panicking.rs:553
  31:     0x7ff78bc18923 - std::panic::catch_unwind
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb\library\std\src\panic.rs:359
  32:     0x7ff78bc18923 - std::thread::impl$0::spawn_unchecked_::closure$1<app::main::closure$0::closure_env$2,tuple$<> >
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb\library\std\src\thread\mod.rs:557
  33:     0x7ff78baa9b0e - core::ops::function::FnOnce::call_once<std::thread::impl$0::spawn_unchecked_::closure_env$1<app::main::closure$0::closure_env$2,tuple$<> >,tuple$<> >
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb\library\core\src\ops\function.rs:250
  34:     0x7ff78c762fdd - alloc::boxed::impl$29::call_once
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library\alloc\src\boxed.rs:1985
  35:     0x7ff78c762fdd - alloc::boxed::impl$29::call_once
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library\alloc\src\boxed.rs:1985
  36:     0x7ff78c762fdd - std::sys::thread::windows::impl$0::new::thread_start
                               at /rustc/ed61e7d7e242494fb7057f2657300d9e77bb4fcb/library\std\src\sys\thread\windows.rs:60
  37:     0x7ffd38fbe8d7 - BaseThreadInitThunk
  38:     0x7ffd3988c53c - RtlUserThreadStart
thread caused non-unwinding panic. aborting.
\ ELIFECYCLE  Command failed with exit code 3221226505.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions