Skip to content

Cargo 1.71.0-beta.1 produces a buggy build of the Helix text editor (since dfe3188) #112171

Closed as not planned
@tricjury70

Description

@tricjury70

I am just a newbie playing with the awesome language and text editor, so I sorry that I can't point out the exact code that causes this.
Helix text editors built with beta and nightly rust toolchains crash easily. In stable this does not happen.
Given the very strong assurances of stability of Rust, I felt it appropriate to report this bug to rustc rather than helix.

How to Reproduce

  1. Run the following in your shell
git clone https://github.com/helix-editor/helix.git
cd helix
ln -s $PWD/runtime ~/.config/helix/runtime
cargo +beta run -- --tutor
  1. Type ii. (Like Vim, it means switch to insert mode and insert i.)
  2. Crash
Helix's Backtrace

    Finished dev [unoptimized + debuginfo] target(s) in 0.22s
     Running `target/debug/hx --tutor`
thread 'tokio-runtime-worker' panicked at 'entered unreachable code', /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smallvec-1.10.0/src/lib.rs:510:18
stack backtrace:
   0: rust_begin_unwind
             at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/std/src/panicking.rs:593:5
   1: core::panicking::panic_fmt
             at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/core/src/panicking.rs:67:14
   2: core::panicking::panic
             at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/core/src/panicking.rs:117:5
   3: smallvec::SmallVecData<A>::heap
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smallvec-1.10.0/src/lib.rs:510:18
   4: smallvec::SmallVec<A>::triple
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smallvec-1.10.0/src/lib.rs:756:34
   5: <smallvec::SmallVec<A> as core::ops::deref::Deref>::deref
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smallvec-1.10.0/src/lib.rs:1547:33
   6: <smallvec::SmallVec<A> as core::convert::AsRef<[<A as smallvec::Array>::Item]>>::as_ref
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/smallvec-1.10.0/src/lib.rs:1566:9
   7: ropey::tree::node_text::inner::NodeSmallString::as_str
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ropey-1.6.0/src/tree/node_text.rs:292:47
   8: <ropey::tree::node_text::NodeText as core::ops::deref::Deref>::deref
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ropey-1.6.0/src/tree/node_text.rs:175:9
   9: ropey::tree::node::Node::leaf_text
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ropey-1.6.0/src/tree/node.rs:630:13
  10: ropey::iter::Chunks::new_with_range_at_byte
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ropey-1.6.0/src/iter.rs:1371:25
  11: ropey::iter::Chunks::new_with_range
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ropey-1.6.0/src/iter.rs:1314:9
  12: ropey::slice::RopeSlice::chunks
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ropey-1.6.0/src/slice.rs:864:19
  13: <ropey::slice::RopeSlice as core::cmp::PartialEq<ropey::slice::RopeSlice>>::eq
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ropey-1.6.0/src/slice.rs:1800:31
  14: imara_diff::intern::Interner<T>::intern::{{closure}}
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/imara-diff-0.1.5/src/intern.rs:128:58
  15: hashbrown::raw::inner::RawTable<T,A>::find::{{closure}}
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.12.3/src/raw/mod.rs:817:13
  16: hashbrown::raw::inner::RawTableInner<A>::find_inner
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.12.3/src/raw/mod.rs:1179:27
  17: hashbrown::raw::inner::RawTable<T,A>::find
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.12.3/src/raw/mod.rs:816:22
  18: hashbrown::raw::inner::RawTable<T,A>::get
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.12.3/src/raw/mod.rs:831:15
  19: imara_diff::intern::Interner<T>::intern
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/imara-diff-0.1.5/src/intern.rs:128:31
  20: imara_diff::intern::InternedInput<T>::update_after::{{closure}}
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/imara-diff-0.1.5/src/intern.rs:85:45
  21: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
             at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/core/src/ops/function.rs:305:13
  22: core::option::Option<T>::map
             at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/core/src/option.rs:1075:29
  23: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::next
             at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/core/src/iter/adapters/map.rs:103:26
  24: alloc::vec::Vec<T,A>::extend_desugared
             at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/alloc/src/vec/mod.rs:2811:35
  25: <alloc::vec::Vec<T,A> as alloc::vec::spec_extend::SpecExtend<T,I>>::spec_extend
             at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/alloc/src/vec/spec_extend.rs:17:9
  26: <alloc::vec::Vec<T,A> as core::iter::traits::collect::Extend<T>>::extend
             at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/alloc/src/vec/mod.rs:2785:9
  27: imara_diff::intern::InternedInput<T>::update_after
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/imara-diff-0.1.5/src/intern.rs:85:9
  28: helix_vcs::diff::line_cache::InternedRopeLines::update_doc_impl
             at ./helix-vcs/src/diff/line_cache.rs:113:9
  29: helix_vcs::diff::line_cache::InternedRopeLines::update_doc
             at ./helix-vcs/src/diff/line_cache.rs:81:13
  30: helix_vcs::diff::worker::DiffWorker::run::{{closure}}::{{closure}}
             at ./helix-vcs/src/diff/worker.rs:57:21
  31: tokio::runtime::context::exit_runtime
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/context.rs:418:9
  32: tokio::runtime::scheduler::multi_thread::worker::block_in_place
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/scheduler/multi_thread/worker.rs:356:9
  33: tokio::task::blocking::block_in_place
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/task/blocking.rs:78:9
  34: helix_vcs::diff::worker::DiffWorker::run::{{closure}}
             at ./helix-vcs/src/diff/worker.rs:71:13
  35: tokio::runtime::task::core::Core<T,S>::poll::{{closure}}
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/core.rs:223:17
  36: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/loom/std/unsafe_cell.rs:14:9
  37: tokio::runtime::task::core::Core<T,S>::poll
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/core.rs:212:13
  38: tokio::runtime::task::harness::poll_future::{{closure}}
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/harness.rs:476:19
  39: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/core/src/panic/unwind_safe.rs:271:9
  40: std::panicking::try::do_call
             at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/std/src/panicking.rs:500:40
  41: __rust_try
  42: std::panicking::try
             at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/std/src/panicking.rs:464:19
  43: std::panic::catch_unwind
             at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/std/src/panic.rs:142:14
  44: tokio::runtime::task::harness::poll_future
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/harness.rs:464:18
  45: tokio::runtime::task::harness::Harness<T,S>::poll_inner
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/harness.rs:198:27
  46: tokio::runtime::task::harness::Harness<T,S>::poll
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/harness.rs:152:15
  47: tokio::runtime::task::raw::poll
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/raw.rs:255:5
  48: tokio::runtime::task::raw::RawTask::poll
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/raw.rs:200:18
  49: tokio::runtime::task::LocalNotified<S>::run
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/mod.rs:394:9
  50: tokio::runtime::scheduler::multi_thread::worker::Context::run_task::{{closure}}
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/scheduler/multi_thread/worker.rs:464:13
  51: tokio::runtime::coop::with_budget
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/coop.rs:107:5
  52: tokio::runtime::coop::budget
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/coop.rs:73:5
  53: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/scheduler/multi_thread/worker.rs:463:9
  54: tokio::runtime::scheduler::multi_thread::worker::Context::run
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/scheduler/multi_thread/worker.rs:426:24
  55: tokio::runtime::scheduler::multi_thread::worker::run::{{closure}}
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/scheduler/multi_thread/worker.rs:406:17
  56: tokio::macros::scoped_tls::ScopedKey<T>::set
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/macros/scoped_tls.rs:61:9
  57: tokio::runtime::scheduler::multi_thread::worker::run
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/scheduler/multi_thread/worker.rs:403:5
  58: tokio::runtime::scheduler::multi_thread::worker::Launch::launch::{{closure}}
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/scheduler/multi_thread/worker.rs:365:45
  59: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/blocking/task.rs:42:21
  60: tokio::runtime::task::core::Core<T,S>::poll::{{closure}}
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/core.rs:223:17
  61: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/loom/std/unsafe_cell.rs:14:9
  62: tokio::runtime::task::core::Core<T,S>::poll
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/core.rs:212:13
  63: tokio::runtime::task::harness::poll_future::{{closure}}
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/harness.rs:476:19
  64: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/core/src/panic/unwind_safe.rs:271:9
  65: std::panicking::try::do_call
             at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/std/src/panicking.rs:500:40
  66: __rust_try
  67: std::panicking::try
             at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/std/src/panicking.rs:464:19
  68: std::panic::catch_unwind
             at /rustc/eff24c06d8f4397802b546aa2e52450e1022fc02/library/std/src/panic.rs:142:14
  69: tokio::runtime::task::harness::poll_future
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/harness.rs:464:18
  70: tokio::runtime::task::harness::Harness<T,S>::poll_inner
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/harness.rs:198:27
  71: tokio::runtime::task::harness::Harness<T,S>::poll
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/harness.rs:152:15
  72: tokio::runtime::task::raw::poll
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/raw.rs:255:5
  73: tokio::runtime::task::raw::RawTask::poll
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/raw.rs:200:18
  74: tokio::runtime::task::UnownedTask<S>::run
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/mod.rs:431:9
  75: tokio::runtime::blocking::pool::Task::run
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/blocking/pool.rs:159:9
  76: tokio::runtime::blocking::pool::Inner::run
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/blocking/pool.rs:513:17
  77: tokio::runtime::blocking::pool::Spawner::spawn_thread::{{closure}}
             at /home/ubuntu-latest/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/blocking/pool.rs:471:13
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Version with regression

searched nightlies: from nightly-2023-04-14 to nightly-2023-05-26
regressed nightly: nightly-2023-05-09
searched commit range: c4190f2...2f2c438
regressed commit: dfe3188

bisected with cargo-bisect-rustc v0.6.6

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --prompt --start=2023-04-14 --end=2023-05-26

@rustbot modify labels: +regression-from-stable-to-beta -regression-untriaged

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions