Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Panic in Vector of length > 4099 #67

@dwightguth

Description

@dwightguth

See issue #55, but I am opening a new issue because I do not have the permissions to reopen the previous issue.

extern crate im_rc;

fn main() {
    let mut l = im_rc::Vector::singleton(0);
    for _ in 0..4099 {
      let mut tmp = im_rc::Vector::singleton(0);
      tmp.append(l);
      l = tmp;
    }
    let len = l.len();
    l.slice(1..len);
  }

Note this is the exact same program, but with a slightly higher number of iterations in the loop. The actual program I'm debugging iterates up to 7621 iterations, so you should probably continue to test up to substantially higher N this time.

The new backtrace:

thread 'hook_list::tests::test_long_list' panicked at 'called `Option::unwrap()` on a `None` value', libcore/option.rs:345:21
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:221
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:511
   5: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:426
   6: rust_begin_unwind
             at libstd/panicking.rs:337
   7: core::panicking::panic_fmt
             at libcore/panicking.rs:92
   8: core::panicking::panic
             at libcore/panicking.rs:53
   9: <core::option::Option<T>>::unwrap
             at /checkout/src/libcore/macros.rs:20
  10: <im_rc::nodes::rrb::Node<A>>::len
             at /home/dwightguth/.cargo/registry/src/github.com-1ecc6299db9ec823/im-rc-12.3.0/./src/nodes/rrb.rs:343
  11: <im_rc::nodes::rrb::Node<A>>::split
             at /home/dwightguth/.cargo/registry/src/github.com-1ecc6299db9ec823/im-rc-12.3.0/./src/nodes/rrb.rs:722
  12: <im_rc::vector::Vector<A>>::split_off
             at /home/dwightguth/.cargo/registry/src/github.com-1ecc6299db9ec823/im-rc-12.3.0/./src/vector/mod.rs:1043
  13: <im_rc::vector::Vector<A>>::slice
             at /home/dwightguth/.cargo/registry/src/github.com-1ecc6299db9ec823/im-rc-12.3.0/./src/vector/mod.rs:1157
  14: datastructures::hook_list::tests::test_long_list
             at src/hook_list.rs:521
  15: datastructures::__test::TESTS::{{closure}}
             at src/hook_list.rs:513
  16: core::ops::function::FnOnce::call_once
             at /checkout/src/libcore/ops/function.rs:223
  17: <F as alloc::boxed::FnBox<A>>::call_box
             at libtest/lib.rs:1451
             at /checkout/src/libcore/ops/function.rs:223
             at /checkout/src/liballoc/boxed.rs:640
  18: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:105

I also got another backtrace with the same error message that is probably related, but I haven't had a chance to construct a minimal example yet; I include it here in the hopes that it might give you some insight or that it might lead your attention to another possible location where a bug of this type might be occurring:

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff599d801 in __GI_abort () at abort.c:79
#2  0x00000000009acaf6 in panic_abort::__rust_start_panic::abort () at libpanic_abort/lib.rs:61
#3  0x00000000009acae6 in __rust_start_panic () at libpanic_abort/lib.rs:56
#4  0x0000000000966a98 in rust_panic () at libstd/panicking.rs:559
#5  0x00000000009669b4 in std::panicking::rust_panic_with_hook () at libstd/panicking.rs:531
#6  0x00000000009666ba in std::panicking::continue_panic_fmt () at libstd/panicking.rs:426
#7  0x00000000009663d6 in rust_begin_unwind () at libstd/panicking.rs:337
#8  0x000000000095360c in core::panicking::panic_fmt () at libcore/panicking.rs:92
#9  0x000000000095353b in core::panicking::panic () at libcore/panicking.rs:53
#10 0x000000000090a4c9 in <core::option::Option<T>>::unwrap (self=...) at /checkout/src/libcore/macros.rs:20
#11 0x00000000008fb8af in <im_rc::nodes::rrb::Node<A>>::lookup_chunk (self=0x7fff0e604658, level=1, base=0, index=3200)
    at /home/dwightguth/.cargo/registry/src/github.com-1ecc6299db9ec823/im-rc-12.3.0/./src/nodes/rrb.rs:476
#12 0x00000000008fb9e8 in <im_rc::nodes::rrb::Node<A>>::lookup_chunk (self=0x7fff0e603b28, level=2, base=0, index=3200)
    at /home/dwightguth/.cargo/registry/src/github.com-1ecc6299db9ec823/im-rc-12.3.0/./src/nodes/rrb.rs:481
#13 0x0000000000928ab3 in <im_rc::vector::focus::TreeFocus<A>>::set_focus (self=0x7fffffff70b8, index=3218)
    at /home/dwightguth/.cargo/registry/src/github.com-1ecc6299db9ec823/im-rc-12.3.0/./src/vector/focus.rs:365
#14 0x0000000000928446 in <im_rc::vector::focus::TreeFocus<A>>::get (self=0x7fffffff70b8, index=3218)
    at /home/dwightguth/.cargo/registry/src/github.com-1ecc6299db9ec823/im-rc-12.3.0/./src/vector/focus.rs:386
#15 0x0000000000928c0d in <im_rc::vector::focus::Focus<'a, A>>::get (self=0x7fffffff70b0, index=3218)
    at /home/dwightguth/.cargo/registry/src/github.com-1ecc6299db9ec823/im-rc-12.3.0/./src/vector/focus.rs:129
#16 0x00000000008f1f78 in <im_rc::vector::Iter<'a, A> as core::iter::iterator::Iterator>::next (self=0x7fffffff70b0)
    at /home/dwightguth/.cargo/registry/src/github.com-1ecc6299db9ec823/im-rc-12.3.0/./src/vector/mod.rs:1858

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