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

ctrl+space freezes irssi on GLib >2.62 #1180

Closed
ineeee opened this issue Apr 23, 2020 · 5 comments · Fixed by #1183
Closed

ctrl+space freezes irssi on GLib >2.62 #1180

ineeee opened this issue Apr 23, 2020 · 5 comments · Fixed by #1183

Comments

@ineeee
Copy link

ineeee commented Apr 23, 2020

A change in GLib 2.63 broke some assumptions in Irssi that the null-byte NUL / U+0000 is a valid Unicode character. This would occur when the user types Ctrl+Space. As a result, the input loop never manages to process the NUL-byte (and any other user input that follows, ever).

This affects all versions of Irssi as soon as your system is updated to this GLib version.

GLib issued a statement that this needs to be changed in Irssi: https://gitlab.gnome.org/GNOME/glib/-/issues/2093

A patch for Irssi 1.2.2 is available at https://github.com/irssi/irssi/releases/download/1.2.2/glib-2-63.patch

original bug report follows

pressing ctrl+space freezes irssi. i believe this is due to irssi being unable to handle NUL (\0).

hypothesis

computers let the user enter control characters by using ctrl and a letter, shown using a caret like ^a. when one uses ctrl+2, the code ^@ is generated, but on some systems, ctrl+space also produces ^@.

the ascii characters next to the alphabet are mapped to control charaters: ^@ is \0, ^[ is \1, ^| is \2, etc. this means that ctrl+space produces \0.

i don't know why irssi crashes on a NUL byte, but i'd blindly guess its because of null-terminated strings. yitz on #irssi is debugging.

affected builds

i've asked around a few networks and it affects arm, x86, x64, many shell/terms, debian, alpine, void, arch, ubuntu... (so musl and glibc).

affects irssi 1.0 to 1.2.2, more details below.

how to reproduce

  1. press ctrl+space
  2. irssi is now frozen

ctrl+2 might work on some keyboard layouts.

tested configurations

crash term shell irssi version
yes urxvt fish 1.2.2
yes guake zsh 1.0.7-1
no roxterm zsh? 1.0.7-1
yes termux (?) zsh 1.2.2
yes xfce4-term bash 1.2.2-1
yes urxvt zsh 1.2.2
no mac's iterm idk 1.1.1
@ailin-nemui
Copy link
Contributor

ailin-nemui commented Apr 23, 2020

@ailin-nemui
Copy link
Contributor

Affects all Irssis on GLib > 2.62

@ailin-nemui ailin-nemui changed the title ctrl+space freezes irssi ctrl+space freezes irssi on GLib >2.62 Apr 24, 2020
@ailin-nemui
Copy link
Contributor

You can test this patch: ailin-nemui@glib-2-63

@dequis
Copy link
Member

dequis commented Apr 28, 2020

That sounds good and it works, add some more detail to the commit message and throw a PR?

ailin-nemui added a commit to ailin-nemui/irssi that referenced this issue Apr 28, 2020
A change in GLib 2.63 broke some assumptions in Irssi that the null-byte
NUL / U+0000 is a valid Unicode character. This would occur when the
user types Ctrl+Space. As a result, the input loop never manages to
process the NUL-byte (and any other user input that follows, ever).

This patch adds a manual check that properly advances the input loop if
GLib returns -2 (incomplete character) despite the length being positive
and a NUL is in first position.

Fixes irssi#1180
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/967
https://gitlab.gnome.org/GNOME/glib/-/issues/2093
@dcollinsn
Copy link
Contributor

I ran into this bug after updating Ubuntu and accidentally pressing ctrl-2, and can confirm that remotes/ailin-nemui/glib-2-63 fixes the issue.

bob-beck pushed a commit to openbsd/ports that referenced this issue May 27, 2020
irssi/irssi#1180

Patch confirmed to fix irssi-1.2.2 with glib2-2.64.2 on snapshots;
irssi-1.2.2 with glib2-2.62.2 on 6.7 seems not effected.
@ailin-nemui ailin-nemui removed the WIP label Nov 12, 2020
algitbot pushed a commit to alpinelinux/aports that referenced this issue Jan 11, 2021
algitbot pushed a commit to alpinelinux/aports that referenced this issue Jan 11, 2021
martinetd added a commit to martinetd/nixpkgs that referenced this issue Mar 17, 2021
@ailin-nemui ailin-nemui added this to the 1.2.3 milestone Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants