Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
tricjury70 opened this issue Jun 1, 2023 · 6 comments

Comments

@tricjury70
Copy link

tricjury70 commented Jun 1, 2023

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

@tricjury70 tricjury70 added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Jun 1, 2023
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. and removed regression-untriaged Untriaged performance or correctness regression. labels Jun 1, 2023
@tricjury70 tricjury70 changed the title Cargo 1.71.0-beta.1 produces a buggy build of the Helix text editor. Cargo 1.71.0-beta.1 produces a buggy build of the Helix text editor (since dfe3188) Jun 1, 2023
@apiraino apiraino added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Jun 1, 2023
@deltragon
Copy link
Contributor

deltragon commented Jun 1, 2023

The bisected commit was the removal of NRVO - it is possible that this just masked some underlying issue.
Would it be possible to run helix under cargo careful to check if it relies on any UB that now happened to crash? (This will not catch all instances of UB, but I assume that it won't be possible to run helix under miri. If I'm wrong, and that is possible, that would be an even better test.)

Edit: Nevermind, I only now saw the panic backtrace. This comment can then be ignored, it makes more sense to investigate based on that backtrace.

@jyn514 jyn514 added the I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness label Jun 1, 2023
@saethlin
Copy link
Member

saethlin commented Jun 1, 2023

This is not a Rust bug, this is UB in Helix or one of its dependencies. AddressSanitizer says stack-use-after-return which sounds exactly right, a stack-use-after-return would be covered up by NRVO.

git clone https://github.com/helix-editor/helix.git
cd helix
ln -s $PWD/runtime ~/.config/helix/runtime
export ASAN_OPTIONS=detect_stack_use_after_return=true
export RUSTFLAGS=-Zsanitizer=address
cargo +nightly build --target=x86_64-unknown-linux-gnu
cargo +nightly run --target=x86_64-unknown-linux-gnu -- --tutor 2> errors

Then type ii, Helix crashes, and puts its output in the errors file.

AddressSanitizer report

=================================================================
==566200==ERROR: AddressSanitizer: stack-use-after-return on address 0x7fe257fa1e10 at pc 0x55f17e7d2c9a bp 0x7fe28bdf9320 sp 0x7fe28bdf9318
READ of size 8 at 0x7fe257fa1e10 thread T1
    #0 0x55f17e7d2c99 in core::ptr::non_null::NonNull$LT$T$GT$::as_ref::h505af725c37e43e4 /rustc/871b5952023139738f72eba235063575062bc2e9/library/core/src/ptr/non_null.rs:376:20
    #1 0x55f17e7d2c99 in alloc::sync::Arc$LT$T$GT$::inner::h3451dc6113afad55 /rustc/871b5952023139738f72eba235063575062bc2e9/library/alloc/src/sync.rs:1255:27
    #2 0x55f17e7d2c99 in _$LT$alloc..sync..Arc$LT$T$GT$$u20$as$u20$core..ops..deref..Deref$GT$::deref::h7e7deab1935e25aa /rustc/871b5952023139738f72eba235063575062bc2e9/library/alloc/src/sync.rs:1545:15
    #3 0x55f17e7b6d30 in ropey::iter::Chunks::new_with_range_at_byte::h4be10e6bb6a41aff /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ropey-1.6.0/src/iter.rs:1370:12
    #4 0x55f17e8189cc in ropey::iter::Chunks::new_with_range::h5ec1f5641385dc61 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ropey-1.6.0/src/iter.rs:1314:9
    #5 0x55f17e8189cc in ropey::slice::RopeSlice::chunks::h68a407a979c6365c /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ropey-1.6.0/src/slice.rs:864:19
    #6 0x55f17e81bd97 in _$LT$ropey..slice..RopeSlice$u20$as$u20$core..cmp..PartialEq$LT$ropey..slice..RopeSlice$GT$$GT$::eq::h52397f05f1ddb1d6 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ropey-1.6.0/src/slice.rs:1800:31
    #7 0x55f17e427334 in imara_diff::intern::Interner$LT$T$GT$::intern::_$u7b$$u7b$closure$u7d$$u7d$::h6cca7fe4a6957c6e /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/imara-diff-0.1.5/src/intern.rs:128:58
    #8 0x55f17e1ed9d6 in hashbrown::raw::inner::RawTable$LT$T$C$A$GT$::find::_$u7b$$u7b$closure$u7d$$u7d$::hfccc80ac77717a07 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.12.3/src/raw/mod.rs:817:13
    #9 0x55f17f05bee1 in hashbrown::raw::inner::RawTableInner$LT$A$GT$::find_inner::h8ca62318597da253 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.12.3/src/raw/mod.rs:1179:27
    #10 0x55f17e1ec547 in hashbrown::raw::inner::RawTable$LT$T$C$A$GT$::find::h7d6a6b6756c4a192 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.12.3/src/raw/mod.rs:816:22
    #11 0x55f17e1ebc43 in hashbrown::raw::inner::RawTable$LT$T$C$A$GT$::get::he960cee5f7dd31c5 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/hashbrown-0.12.3/src/raw/mod.rs:831:15
    #12 0x55f17e426d7e in imara_diff::intern::Interner$LT$T$GT$::intern::hdc5750847d3718a8 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/imara-diff-0.1.5/src/intern.rs:128:31
    #13 0x55f17ccbbbab in imara_diff::intern::InternedInput$LT$T$GT$::update_after::_$u7b$$u7b$closure$u7d$$u7d$::h5111e975cf039ec9 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/imara-diff-0.1.5/src/intern.rs:85:45
    #14 0x55f17ccbc2cd in core::ops::function::impls::_$LT$impl$u20$core..ops..function..FnOnce$LT$A$GT$$u20$for$u20$$RF$mut$u20$F$GT$::call_once::hbccec297cdf52be1 /rustc/871b5952023139738f72eba235063575062bc2e9/library/core/src/ops/function.rs:305:13
    #15 0x55f17cd088cd in core::option::Option$LT$T$GT$::map::hb1cb2b5c315a8383 /rustc/871b5952023139738f72eba235063575062bc2e9/library/core/src/option.rs:1075:29
    #16 0x55f17cd088cd in _$LT$core..iter..adapters..map..Map$LT$I$C$F$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$::next::h7641317b7cabaefd /rustc/871b5952023139738f72eba235063575062bc2e9/library/core/src/iter/adapters/map.rs:103:26
    #17 0x55f17cc3e495 in alloc::vec::Vec$LT$T$C$A$GT$::extend_desugared::h2947498c04ef2a07 /rustc/871b5952023139738f72eba235063575062bc2e9/library/alloc/src/vec/mod.rs:2811:35
    #18 0x55f17cc426ca in _$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$alloc..vec..spec_extend..SpecExtend$LT$T$C$I$GT$$GT$::spec_extend::h5048c8b33a7e9b38 /rustc/871b5952023139738f72eba235063575062bc2e9/library/alloc/src/vec/spec_extend.rs:17:9
    #19 0x55f17cc41eba in _$LT$alloc..vec..Vec$LT$T$C$A$GT$$u20$as$u20$core..iter..traits..collect..Extend$LT$T$GT$$GT$::extend::h2faf0580840b4a68 /rustc/871b5952023139738f72eba235063575062bc2e9/library/alloc/src/vec/mod.rs:2785:9
    #20 0x55f17ccbb9e8 in imara_diff::intern::InternedInput$LT$T$GT$::update_after::h72d347487c8f3106 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/imara-diff-0.1.5/src/intern.rs:85:9
    #21 0x55f17cc4a1f6 in helix_vcs::diff::line_cache::InternedRopeLines::update_doc_impl::ha8898298fdd2cf25 /tmp/helix/helix-vcs/src/diff/line_cache.rs:113:9
    #22 0x55f17cc49b4a in helix_vcs::diff::line_cache::InternedRopeLines::update_doc::h3ef6019a01009b5b /tmp/helix/helix-vcs/src/diff/line_cache.rs:81:13
    #23 0x55f17cc31747 in helix_vcs::diff::worker::DiffWorker::run::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::hbb93b33faeba9a2c /tmp/helix/helix-vcs/src/diff/worker.rs:57:21
    #24 0x55f17cd2e891 in tokio::runtime::context::exit_runtime::hcfc77b8737607f7a /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/context.rs:418:9
    #25 0x55f17cc77f43 in tokio::runtime::scheduler::multi_thread::worker::block_in_place::h1322b67137273812 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/scheduler/multi_thread/worker.rs:356:9
    #26 0x55f17cc70f86 in tokio::task::blocking::block_in_place::hd80d39245363d542 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/task/blocking.rs:78:9
    #27 0x55f17cc30262 in helix_vcs::diff::worker::DiffWorker::run::_$u7b$$u7b$closure$u7d$$u7d$::h564a4d994946f40f /tmp/helix/helix-vcs/src/diff/worker.rs:71:13
    #28 0x55f17cbffd10 in tokio::runtime::task::core::Core$LT$T$C$S$GT$::poll::_$u7b$$u7b$closure$u7d$$u7d$::h55d04a5dd325de4e /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/core.rs:223:17
    #29 0x55f17cc613d6 in tokio::loom::std::unsafe_cell::UnsafeCell$LT$T$GT$::with_mut::h9af99a072e5b6eaa /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/loom/std/unsafe_cell.rs:14:9
    #30 0x55f17cbfcec1 in tokio::runtime::task::core::Core$LT$T$C$S$GT$::poll::hb0f02f13c109ce3a /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/core.rs:212:13
    #31 0x55f17ccd2c68 in tokio::runtime::task::harness::poll_future::_$u7b$$u7b$closure$u7d$$u7d$::h7c4847a095ce98cb /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/harness.rs:476:19
    #32 0x55f17cd7beed in _$LT$core..panic..unwind_safe..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::h9e94e9b712a3615d /rustc/871b5952023139738f72eba235063575062bc2e9/library/core/src/panic/unwind_safe.rs:271:9
    #33 0x55f17cd5f30f in std::panicking::try::do_call::h6ff01f69a128401a /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panicking.rs:500:40
    #34 0x55f17cd76e0a in __rust_try lifsx55x7veyoqr
    #35 0x55f17cd506f2 in std::panicking::try::h7edd633c8cb0e0cd /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panicking.rs:464:19
    #36 0x55f17cd3e769 in std::panic::catch_unwind::h08e989e23b603381 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panic.rs:142:14
    #37 0x55f17ccc8cc7 in tokio::runtime::task::harness::poll_future::h60f23895d9379fbe /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/harness.rs:464:18
    #38 0x55f17ccd9920 in tokio::runtime::task::harness::Harness$LT$T$C$S$GT$::poll_inner::h81659e3379b6acd5 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/harness.rs:198:27
    #39 0x55f17cce716d in tokio::runtime::task::harness::Harness$LT$T$C$S$GT$::poll::h9b886e4ccf3c7cd1 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/harness.rs:152:15
    #40 0x55f17cc692bc in tokio::runtime::task::raw::poll::h4c3048a5ae8137d3 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/raw.rs:255:5
    #41 0x55f17d0d5778 in tokio::runtime::task::raw::RawTask::poll::hfdd66ddce2d84bfc /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/raw.rs:200:18
    #42 0x55f17ced6181 in tokio::runtime::task::LocalNotified$LT$S$GT$::run::h0bd8ff85afaf4831 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/mod.rs:394:9
    #43 0x55f17ced02c7 in tokio::runtime::scheduler::multi_thread::worker::Context::run_task::_$u7b$$u7b$closure$u7d$$u7d$::h49f8567faec375ee /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/scheduler/multi_thread/worker.rs:464:13
    #44 0x55f17cecfc2f in tokio::runtime::coop::with_budget::h15af4c70215884ce /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/coop.rs:107:5
    #45 0x55f17cecfc2f in tokio::runtime::coop::budget::hb4a8c68e4bf982c2 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/coop.rs:73:5
    #46 0x55f17cecfc2f in tokio::runtime::scheduler::multi_thread::worker::Context::run_task::h00e22fe72e8b18fb /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/scheduler/multi_thread/worker.rs:463:9
    #47 0x55f17cece1f0 in tokio::runtime::scheduler::multi_thread::worker::Context::run::hc1d8dc352f730fd0 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/scheduler/multi_thread/worker.rs:426:24
    #48 0x55f17cecd7e8 in tokio::runtime::scheduler::multi_thread::worker::run::_$u7b$$u7b$closure$u7d$$u7d$::h33262173093f17b8 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/scheduler/multi_thread/worker.rs:406:17
    #49 0x55f17cf60a22 in tokio::macros::scoped_tls::ScopedKey$LT$T$GT$::set::hb0b5d4e4fb520f6b /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/macros/scoped_tls.rs:61:9
    #50 0x55f17cecd17f in tokio::runtime::scheduler::multi_thread::worker::run::h63383093a3894e8f /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/scheduler/multi_thread/worker.rs:403:5
    #51 0x55f17cecc6fa in tokio::runtime::scheduler::multi_thread::worker::Launch::launch::_$u7b$$u7b$closure$u7d$$u7d$::h3729d3a6f3fe75f0 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/scheduler/multi_thread/worker.rs:365:45
    #52 0x55f17cf70a53 in _$LT$tokio..runtime..blocking..task..BlockingTask$LT$T$GT$$u20$as$u20$core..future..future..Future$GT$::poll::h8d974507fc25a88e /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/blocking/task.rs:42:21
    #53 0x55f17d0ee346 in tokio::runtime::task::core::Core$LT$T$C$S$GT$::poll::_$u7b$$u7b$closure$u7d$$u7d$::h374f65607f0b3e0d /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/core.rs:223:17
    #54 0x55f17d0368d2 in tokio::loom::std::unsafe_cell::UnsafeCell$LT$T$GT$::with_mut::hf23531ef865722b9 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/loom/std/unsafe_cell.rs:14:9
    #55 0x55f17d0e73e1 in tokio::runtime::task::core::Core$LT$T$C$S$GT$::poll::h5be35c7c3479cbdc /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/core.rs:212:13
    #56 0x55f17cde8eb8 in tokio::runtime::task::harness::poll_future::_$u7b$$u7b$closure$u7d$$u7d$::h845bd25a2cd0f0dd /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/harness.rs:476:19
    #57 0x55f17ce41dac in _$LT$core..panic..unwind_safe..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::h98280cccc8a75f96 /rustc/871b5952023139738f72eba235063575062bc2e9/library/core/src/panic/unwind_safe.rs:271:9
    #58 0x55f17ce8f04f in std::panicking::try::do_call::h3e706bdf8b32e741 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panicking.rs:500:40
    #59 0x55f17ceb22ba in __rust_try tokio.81bc4698b78211c7-cgu.11
    #60 0x55f17ce724b2 in std::panicking::try::h3e26ac844f012840 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panicking.rs:464:19
    #61 0x55f17cdf8d19 in std::panic::catch_unwind::hab5a07165ade8053 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panic.rs:142:14
    #62 0x55f17cddc9e7 in tokio::runtime::task::harness::poll_future::ha2c7267f4f80126e /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/harness.rs:464:18
    #63 0x55f17cdac230 in tokio::runtime::task::harness::Harness$LT$T$C$S$GT$::poll_inner::hf94022f0dead3269 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/harness.rs:198:27
    #64 0x55f17cda4abd in tokio::runtime::task::harness::Harness$LT$T$C$S$GT$::poll::h5c52ab6e54d2f521 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/harness.rs:152:15
    #65 0x55f17d0d61ac in tokio::runtime::task::raw::poll::h6e22842a4e051f04 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/raw.rs:255:5
    #66 0x55f17d0d5778 in tokio::runtime::task::raw::RawTask::poll::hfdd66ddce2d84bfc /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/raw.rs:200:18
    #67 0x55f17ced65ee in tokio::runtime::task::UnownedTask$LT$S$GT$::run::hf92fb91a6488b047 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/task/mod.rs:431:9
    #68 0x55f17ce27998 in tokio::runtime::blocking::pool::Task::run::h19fea5fb8d734c24 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/blocking/pool.rs:159:9
    #69 0x55f17ce314a7 in tokio::runtime::blocking::pool::Inner::run::h34b8ef83f0ce64d2 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/blocking/pool.rs:513:17
    #70 0x55f17ce30989 in tokio::runtime::blocking::pool::Spawner::spawn_thread::_$u7b$$u7b$closure$u7d$$u7d$::hc0bc7b0197df9970 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/blocking/pool.rs:471:13
    #71 0x55f17d050d98 in std::sys_common::backtrace::__rust_begin_short_backtrace::hfe989c57bd2b0551 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/sys_common/backtrace.rs:135:18
    #72 0x55f17d0117cd in std::thread::Builder::spawn_unchecked_::_$u7b$$u7b$closure$u7d$$u7d$::_$u7b$$u7b$closure$u7d$$u7d$::hdb2d21bca13e7ceb /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/thread/mod.rs:529:17
    #73 0x55f17ce3ef20 in _$LT$core..panic..unwind_safe..AssertUnwindSafe$LT$F$GT$$u20$as$u20$core..ops..function..FnOnce$LT$$LP$$RP$$GT$$GT$::call_once::h292fe8e9dd9ee3ae /rustc/871b5952023139738f72eba235063575062bc2e9/library/core/src/panic/unwind_safe.rs:271:9
    #74 0x55f17ce8ebe3 in std::panicking::try::do_call::h38731b3f2276043b /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panicking.rs:500:40
    #75 0x55f17ceb22ba in __rust_try tokio.81bc4698b78211c7-cgu.11
    #76 0x55f17ce6c8f7 in std::panicking::try::h199640d9d6a2d9c8 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panicking.rs:464:19
    #77 0x55f17d011236 in std::panic::catch_unwind::h3aa247ea2fe2d7da /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panic.rs:142:14
    #78 0x55f17d011236 in std::thread::Builder::spawn_unchecked_::_$u7b$$u7b$closure$u7d$$u7d$::h8702cc5e4e5e7811 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/thread/mod.rs:528:30
    #79 0x55f17cf80eee in core::ops::function::FnOnce::call_once$u7b$$u7b$vtable.shim$u7d$$u7d$::h8b22f36979782c03 /rustc/871b5952023139738f72eba235063575062bc2e9/library/core/src/ops/function.rs:250:5
    #80 0x55f180034064 in _$LT$alloc..boxed..Box$LT$F$C$A$GT$$u20$as$u20$core..ops..function..FnOnce$LT$Args$GT$$GT$::call_once::hf40f2bdc5d52ccd3 /rustc/871b5952023139738f72eba235063575062bc2e9/library/alloc/src/boxed.rs:1985:9
    #81 0x55f180034064 in _$LT$alloc..boxed..Box$LT$F$C$A$GT$$u20$as$u20$core..ops..function..FnOnce$LT$Args$GT$$GT$::call_once::h37245157c41fc181 /rustc/871b5952023139738f72eba235063575062bc2e9/library/alloc/src/boxed.rs:1985:9
    #82 0x55f180034064 in std::sys::unix::thread::Thread::new::thread_start::hccafd58c8c92140c /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/sys/unix/thread.rs:108:17
    #83 0x7fe28edfd44a  (/usr/lib/libc.so.6+0x8744a) (BuildId: 2f005a79cd1a8e385972f5a102f16adba414d75e)
    #84 0x7fe28ee80e3f  (/usr/lib/libc.so.6+0x10ae3f) (BuildId: 2f005a79cd1a8e385972f5a102f16adba414d75e)

Address 0x7fe257fa1e10 is located in stack of thread T64 at offset 528 in frame
    #0 0x55f17cc4845f in helix_vcs::diff::line_cache::InternedRopeLines::new::h3e732c17a1751d04 /tmp/helix/helix-vcs/src/diff/line_cache.rs:30

  This frame has 8 object(s):
    [32, 48) '' (line 30)
    [64, 152) '_11' (line 35)
    [192, 216) '_8' (line 34)
    [256, 280) '_5' (line 33)
    [320, 456) '_4' (line 32)
    [528, 688) 'res' (line 31) <== Memory access at offset 528 is inside this variable
    [752, 760) 'doc'
    [784, 792) 'diff_base'
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
      (longjmp and C++ exceptions *are* supported)
Thread T64 created by T0 here:
    #0 0x55f17901058a in pthread_create /rustc/llvm/src/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:208:3
    #1 0x55f180033ece in std::sys::unix::thread::Thread::new::h11298ac1a5216a48 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/sys/unix/thread.rs:87:19
    #2 0x55f17d00e815 in std::thread::Builder::spawn_unchecked::hdec0c5f28b4f1d45 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/thread/mod.rs:457:32
    #3 0x55f17d01184d in std::thread::Builder::spawn::h0e4619b5a9e00195 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/thread/mod.rs:389:18
    #4 0x55f17ce2f0c9 in tokio::runtime::blocking::pool::Spawner::spawn_task::hc4f3ffe66a3fe9c0 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/blocking/pool.rs:418:27
    #5 0x55f17ce2d93a in tokio::runtime::blocking::pool::Spawner::spawn_blocking_inner::hba26efbc864ce799 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/blocking/pool.rs:386:23
    #6 0x55f17ce2b29e in tokio::runtime::blocking::pool::Spawner::spawn_blocking::h534f0fd039419541 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/blocking/pool.rs:301:17
    #7 0x55f17ce68367 in tokio::runtime::handle::Handle::spawn_blocking::h1a87f543697338cf /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/handle.rs:180:9
    #8 0x55f17ce27e62 in tokio::runtime::blocking::pool::spawn_blocking::h79d4d330801b3b6c /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/blocking/pool.rs:183:5
    #9 0x55f17cecc4fa in tokio::runtime::scheduler::multi_thread::worker::Launch::launch::h7bb24e7f88c22170 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/scheduler/multi_thread/worker.rs:365:13
    #10 0x55f17d0dd1e8 in tokio::runtime::builder::Builder::build_threaded_runtime::h3735cd357610a79f /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/builder.rs:1060:13
    #11 0x55f17d0d9966 in tokio::runtime::builder::Builder::build::h98ed9c94ff47a94c /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/builder.rs:642:34
    #12 0x55f1790fc8a0 in hx::main::h98e25f5b41a4d13c /tmp/helix/helix-term/src/main.rs:38:21
    #13 0x55f17911bfaa in core::ops::function::FnOnce::call_once::h48464cb44371a576 /rustc/871b5952023139738f72eba235063575062bc2e9/library/core/src/ops/function.rs:250:5
    #14 0x55f18001f4d4 in core::ops::function::impls::_$LT$impl$u20$core..ops..function..FnOnce$LT$A$GT$$u20$for$u20$$RF$F$GT$::call_once::h0c782962261767da /rustc/871b5952023139738f72eba235063575062bc2e9/library/core/src/ops/function.rs:284:13
    #15 0x55f18001f4d4 in std::panicking::try::do_call::hb0139c359c8ca7f8 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panicking.rs:500:40
    #16 0x55f18001f4d4 in std::panicking::try::h2660f70640eebec6 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panicking.rs:464:19
    #17 0x55f18001f4d4 in std::panic::catch_unwind::hb49ffdf1cb513db2 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panic.rs:142:14
    #18 0x55f18001f4d4 in std::rt::lang_start_internal::_$u7b$$u7b$closure$u7d$$u7d$::hb02f7629b4bb037f /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/rt.rs:148:48
    #19 0x55f18001f4d4 in std::panicking::try::do_call::h509325ac206e80d8 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panicking.rs:500:40
    #20 0x55f18001f4d4 in std::panicking::try::h2878637911537fa1 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panicking.rs:464:19
    #21 0x55f18001f4d4 in std::panic::catch_unwind::hd6288c01e9dd3779 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panic.rs:142:14
    #22 0x55f18001f4d4 in std::rt::lang_start_internal::h9a2c6754c2f9f959 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/rt.rs:148:20

SUMMARY: AddressSanitizer: stack-use-after-return /rustc/871b5952023139738f72eba235063575062bc2e9/library/core/src/ptr/non_null.rs:376:20 in core::ptr::non_null::NonNull$LT$T$GT$::as_ref::h505af725c37e43e4
Shadow bytes around the buggy address:
  0x7fe257fa1b80: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x7fe257fa1c00: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x7fe257fa1c80: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x7fe257fa1d00: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x7fe257fa1d80: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
=>0x7fe257fa1e00: f5 f5[f5]f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x7fe257fa1e80: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x7fe257fa1f00: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x7fe257fa1f80: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x7fe257fa2000: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
  0x7fe257fa2080: f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5 f5
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
Thread T1 created by T0 here:
    #0 0x55f17901058a in pthread_create /rustc/llvm/src/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:208:3
    #1 0x55f180033ece in std::sys::unix::thread::Thread::new::h11298ac1a5216a48 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/sys/unix/thread.rs:87:19
    #2 0x55f17d00e815 in std::thread::Builder::spawn_unchecked::hdec0c5f28b4f1d45 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/thread/mod.rs:457:32
    #3 0x55f17d01184d in std::thread::Builder::spawn::h0e4619b5a9e00195 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/thread/mod.rs:389:18
    #4 0x55f17ce2f0c9 in tokio::runtime::blocking::pool::Spawner::spawn_task::hc4f3ffe66a3fe9c0 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/blocking/pool.rs:418:27
    #5 0x55f17ce2d93a in tokio::runtime::blocking::pool::Spawner::spawn_blocking_inner::hba26efbc864ce799 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/blocking/pool.rs:386:23
    #6 0x55f17ce2b29e in tokio::runtime::blocking::pool::Spawner::spawn_blocking::h534f0fd039419541 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/blocking/pool.rs:301:17
    #7 0x55f17ce68367 in tokio::runtime::handle::Handle::spawn_blocking::h1a87f543697338cf /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/handle.rs:180:9
    #8 0x55f17ce27e62 in tokio::runtime::blocking::pool::spawn_blocking::h79d4d330801b3b6c /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/blocking/pool.rs:183:5
    #9 0x55f17cecc4fa in tokio::runtime::scheduler::multi_thread::worker::Launch::launch::h7bb24e7f88c22170 /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/scheduler/multi_thread/worker.rs:365:13
    #10 0x55f17d0dd1e8 in tokio::runtime::builder::Builder::build_threaded_runtime::h3735cd357610a79f /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/builder.rs:1060:13
    #11 0x55f17d0d9966 in tokio::runtime::builder::Builder::build::h98ed9c94ff47a94c /home/ben/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.28.2/src/runtime/builder.rs:642:34
    #12 0x55f1790fc8a0 in hx::main::h98e25f5b41a4d13c /tmp/helix/helix-term/src/main.rs:38:21
    #13 0x55f17911bfaa in core::ops::function::FnOnce::call_once::h48464cb44371a576 /rustc/871b5952023139738f72eba235063575062bc2e9/library/core/src/ops/function.rs:250:5
    #14 0x55f18001f4d4 in core::ops::function::impls::_$LT$impl$u20$core..ops..function..FnOnce$LT$A$GT$$u20$for$u20$$RF$F$GT$::call_once::h0c782962261767da /rustc/871b5952023139738f72eba235063575062bc2e9/library/core/src/ops/function.rs:284:13
    #15 0x55f18001f4d4 in std::panicking::try::do_call::hb0139c359c8ca7f8 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panicking.rs:500:40
    #16 0x55f18001f4d4 in std::panicking::try::h2660f70640eebec6 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panicking.rs:464:19
    #17 0x55f18001f4d4 in std::panic::catch_unwind::hb49ffdf1cb513db2 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panic.rs:142:14
    #18 0x55f18001f4d4 in std::rt::lang_start_internal::_$u7b$$u7b$closure$u7d$$u7d$::hb02f7629b4bb037f /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/rt.rs:148:48
    #19 0x55f18001f4d4 in std::panicking::try::do_call::h509325ac206e80d8 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panicking.rs:500:40
    #20 0x55f18001f4d4 in std::panicking::try::h2878637911537fa1 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panicking.rs:464:19
    #21 0x55f18001f4d4 in std::panic::catch_unwind::hd6288c01e9dd3779 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/panic.rs:142:14
    #22 0x55f18001f4d4 in std::rt::lang_start_internal::h9a2c6754c2f9f959 /rustc/871b5952023139738f72eba235063575062bc2e9/library/std/src/rt.rs:148:20

==566200==ABORTING

@saethlin
Copy link
Member

saethlin commented Jun 1, 2023

The right place to report this is Helix or one of its dependencies. I'm closing this issue to indicate it is not a Rust problem and remove it from the prioritiziation queue, but I'm leaving it in my personal work queue to figure out exactly where this should be reported. I like debugging this sort of thing.

@saethlin saethlin closed this as not planned Won't fix, can't repro, duplicate, stale Jun 1, 2023
@tmiasko
Copy link
Contributor

tmiasko commented Jun 1, 2023

At glance it looks like one bug is in InternedRopeLines::new. It stores references to self.diff_base and self.doc in update_diff_base_impl(), but then moves the whole structure which invalidates those references. (Pin & Box is the usual way to avoid such issues).

@apiraino apiraino removed E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Jun 1, 2023
@saethlin saethlin removed regression-from-stable-to-beta Performance or correctness regression from stable to beta. I-unsound Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness C-bug Category: This is a bug. labels Jun 1, 2023
@pascalkuthe
Copy link
Contributor

pascalkuthe commented Jun 4, 2023

At glance it looks like one bug is in InternedRopeLines::new. It stores references to self.diff_base and self.doc in update_diff_base_impl(), but then moves the whole structure which invalidates those references. (Pin & Box is the usual way to avoid such issues).

I wrote that code. diff_base anddoc are both Arcs internally. It is my understanding that references into arcs don't get invalidated even if the Arc is moved.

Edit: Ah actually it's an &Arc inside the RopeSlice not and &T. Ropey was relying on this being optimized to &T for performance reasons and I was accidentally relying on it for soundness. Boxing in helix is the easy solution but this will also degrade performance in ropey so I will try to submit a patch to ropey to use the equivalent of https://docs.rs/triomphe/0.1.8/triomphe/struct.ArcBorrow.html

@pascalkuthe
Copy link
Contributor

helix-editor/helix#7227 fixes the crash, will look into improving ropey in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants