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

Unicode crash, byte_slice(): Byte range does not align with char boundaries #9093

Closed
Kelatte opened this issue Dec 15, 2023 · 3 comments
Closed
Labels
C-bug Category: This is a bug

Comments

@Kelatte
Copy link

Kelatte commented Dec 15, 2023

Summary

I'm using ibus to type Chinese characters, and when a line reaches a const limit and there is "<***>" in the document, an error occurs.

The error message is

thread 'main' panicked at /usr/share/cargo/registry/ropey-1.6.1/src/slice.rs:703:23:
byte_slice(): Byte range does not align with char boundaries: range 2..4
stack backtrace:
   0:     0x55d571d3a5f1 - <unknown>
   1:     0x55d5713eba8c - <unknown>
   2:     0x55d571d3628d - <unknown>
   3:     0x55d571d3a3d4 - <unknown>
   4:     0x55d571d3c103 - <unknown>
   5:     0x55d571d3be4f - <unknown>
   6:     0x55d571b36f3f - <unknown>
   7:     0x55d571d3c75a - <unknown>
   8:     0x55d571d3c504 - <unknown>
   9:     0x55d571d3aac6 - <unknown>
  10:     0x55d571d3c292 - <unknown>
  11:     0x55d571308ce3 - <unknown>
  12:     0x55d571500581 - <unknown>
  13:     0x55d57156472d - <unknown>
  14:     0x55d5714e1a71 - <unknown>
  15:     0x55d5714e1221 - <unknown>
  16:     0x55d571564081 - <unknown>
  17:     0x55d5719fbfb0 - <unknown>
  18:     0x55d5719f9793 - <unknown>
  19:     0x55d571a06d1f - <unknown>
  20:     0x55d571b37204 - <unknown>
  21:     0x55d571b2fc01 - <unknown>
  22:     0x55d571b8f65f - <unknown>
  23:     0x55d571b8ceb0 - <unknown>
  24:     0x55d571b479e6 - <unknown>
  25:     0x55d571b48241 - <unknown>
  26:     0x55d571d2de2f - <unknown>
  27:     0x55d571b92ce4 - <unknown>
  28:     0x7f120637d14a - __libc_start_call_main
  29:     0x7f120637d20b - __libc_start_main_impl
  30:     0x55d5713658e5 - <unknown>
  31:                0x0 - <unknown>

Reproduction Steps

I tried this:

  1. hx a.tex
  2. I typed the la<space>.

I expected this to happen:

The word "来" should be inserted.

Instead, this happened:

Helix unexpectedly crushed.

Debugging:

I tried to reduce some characters in the line and found that this only happens when a line reaches a limit. And it only happens when there is highlighted characters, such as <***>.

In the video below, I remove the <***> and it doesn't happen again.

2023-12-15.11-45-35.webm

Helix log

~/.cache/helix/helix.log
2023-12-15T11:45:37.819 helix_view::editor [ERROR] Failed to initialize the language servers for `source.tex` - `texlab` { cannot find binary path }
2023-12-15T11:45:44.652 helix_view::editor [ERROR] Failed to initialize the language servers for `source.tex` - `texlab` { cannot find binary path }
2023-12-15T11:45:48.749 helix_view::editor [ERROR] Failed to initialize the language servers for `source.tex` - `texlab` { cannot find binary path }

Platform

Linux

Terminal Emulator

gnome-terminal v3.48.1 with GNOME 44

Installation Method

dnf

Helix Version

helix 23.10 (f6021dd)

@Kelatte Kelatte added the C-bug Category: This is a bug label Dec 15, 2023
@kirawi
Copy link
Member

kirawi commented Dec 15, 2023

Are you able to replicate this on a buffer with no set language? It could be an upstream issue with the latex tree-sitter grammar.

@Kelatte
Copy link
Author

Kelatte commented Dec 15, 2023

Are you able to replicate this on a buffer with no set language? It could be an upstream issue with the latex tree-sitter grammar.

no, I can't. with no set language I can't replicate this. I argee with you. Thank you.

Where is the right place to report this bug?

@pascalkuthe
Copy link
Member

Duplicate of #7273

@pascalkuthe pascalkuthe marked this as a duplicate of #7273 Dec 15, 2023
@pascalkuthe pascalkuthe closed this as not planned Won't fix, can't repro, duplicate, stale Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

3 participants