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

xi-gtk freezes when opening files whose names are invalid utf8, and have invalid utf8 #44

Open
mateon1 opened this issue Jan 5, 2018 · 3 comments

Comments

@mateon1
Copy link

mateon1 commented Jan 5, 2018

How to reproduce:

  1. Open xi-gtk
  2. Open a file whose filename is invalid utf8, which contains invalid utf8, so xi-core exits.
    in my case, the filename is: (hex) 20 ed 96 4f 56 (or escaped): " \xed\x96OV"
    the file is a corrupt stack trace that contains some non-utf8 gibberish, but any binary file should work.
  3. After xi-core exits, xi-gtk enters an infinite loop printing error messages to the console

Stdout/stderr:

starting plugins for view-id-1
starting plugins for view-id-3
xi-core exited with error:
Io(Error { repr: Custom(Custom { kind: InvalidData, error: StringError("stream did not contain valid UTF-8") }) })

(xi-gtk:8440): Json-CRITICAL **: json_parser_load_from_data: assertion 'data != NULL' failed

(xi-gtk:8440): Json-CRITICAL **: json_node_get_object: assertion 'JSON_NODE_IS_VALID (node)' failed

(xi-gtk:8440): Json-CRITICAL **: json_object_has_member: assertion 'object != NULL' failed

(xi-gtk:8440): Json-CRITICAL **: json_object_get_string_member: assertion 'object != NULL' failed

(xi-gtk:8440): Json-CRITICAL **: json_object_get_object_member: assertion 'object != NULL' failed

(xi-gtk:8440): Json-CRITICAL **: json_parser_load_from_data: assertion 'data != NULL' failed

(xi-gtk:8440): Json-CRITICAL **: json_node_get_object: assertion 'JSON_NODE_IS_VALID (node)' failed

(xi-gtk:8440): Json-CRITICAL **: json_object_has_member: assertion 'object != NULL' failed

(xi-gtk:8440): Json-CRITICAL **: json_object_get_string_member: assertion 'object != NULL' failed

(xi-gtk:8440): Json-CRITICAL **: json_object_get_object_member: assertion 'object != NULL' failed

(xi-gtk:8440): Json-CRITICAL **: json_parser_load_from_data: assertion 'data != NULL' failed

(xi-gtk:8440): Json-CRITICAL **: json_node_get_object: assertion 'JSON_NODE_IS_VALID (node)' failed

(xi-gtk:8440): Json-CRITICAL **: json_object_has_member: assertion 'object != NULL' failed

(xi-gtk:8440): Json-CRITICAL **: json_object_get_string_member: assertion 'object != NULL' failed

(xi-gtk:8440): Json-CRITICAL **: json_object_get_object_member: assertion 'object != NULL' failed

The spam of Json-CRITICAL errors continues forever. The only solution is to kill xi-gtk.

@eyelash
Copy link
Owner

eyelash commented May 18, 2018

The infinite loop should be fixed in 39d5559. Filenames that are invalid UTF-8 are hard to support with the current architecture as the front-end communicates with the core through JSON and the JSON has to be valid UTF-8. Support for files whose content uses a non-UTF-8 encoding is something that should be handled in the core.

@cmyr
Copy link

cmyr commented May 19, 2018

Support for non-utf8 filenames would be possible if annoying, but is probably something xi-core should support eventually. It means paths are going to need to be sent in base64 or something. I'd welcome an issue in xi-core but I don't expect to get around to it in a hurry.

Better support for non-utf8 encodings is definitely important, and there's been some very preliminary groundwork in this direction in core. I also don't think there's a real issue up for that, so again file in xi-core if you like @mateon1 :)

@eyelash
Copy link
Owner

eyelash commented Sep 14, 2018

See also xi-editor/xi-editor#796

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

3 participants