helix-editor / nucleo

A fast and convenient fuzzy matcher library for rust
Mozilla Public License 2.0
896 stars 28 forks source link

Crash in worker.rs #47

Closed Philipp-M closed 5 months ago

Philipp-M commented 5 months ago

I have unfortunately no idea, how this happened, and thus also don't know how to reproduce, nor whether this issue still exists (happened in my slightly dated helix fork), but I better add this trace here anyway, maybe it helps.

I think the version used was 0.4.0 (as visible in the trace):

thread 'nucleo worker 0' panicked at /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-vendor-cargo-deps/c19b7c6f923b580ac259164a89f2577984ad5ab09ee9d583b888f934adbbe8d0/nucleo-0.4.0/src/worker.rs:132:30:
removal index (is 65504) should be < len (is 0)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Rayon: detected unexpected panic; aborting
efish: Job 1, 'hx' terminated by signal SIGABRT (Abort)

I suspect an underflow in the subtraction at that line.

pascalkuthe commented 5 months ago

I am pretty certain this was fixed by https://github.com/helix-editor/nucleo/commit/e31950f5b5753289f9912734315d95b88477d064

This is exactly the panic I fixed with that commit.

I guess that you were running a version of helix that includes an older vesion of the pickerv2 PR? That PR makes this crash way more likely (it could also happen without it in some dyn pickers nut the global search makes it way more likely). That's how I found this crash myself.

If you still encounter this issue with the latest release feel free to reopen.