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

Some glib assertion failure warnings when tab completing #125

Closed
dequis opened this Issue Aug 10, 2014 · 3 comments

Comments

Projects
None yet
3 participants
@dequis
Member

dequis commented Aug 10, 2014

This is probably harmless, but may hint at some wrong behavior. It's been a "known bug" for over 10 years. A few months ago I just walked into #irssi and wasted a few hours debugging this thing and coming up with a simple patch to fix the warnings, so now that the chances to get patches merged are non-zero, I'm posting this.

Relevant IRC logs from 2014-03-19 (may contain inaccurate information as we were figuring it out)

How to reproduce (just one way, there might be others):

  • Be connected to at least one server
  • Have one query window open
  • In the query window, type write any number of spaces followed any number of non-spaces, but no spaces at the end of the message
    • For example _a works (replace _ with space)
  • Move the cursor to the leftmost non-space character (that would be "_|a", underscore being space, pipe being cursor)
  • Press tab
  • Acquire warnings in status window:
01:12 -!- Irssi: critical g_string_erase: assertion 'pos <= string->len' failed
01:12 -!- Irssi: critical g_string_insert: assertion 'pos <= string->len' failed
01:12 -!- Irssi: critical g_string_insert_c: assertion 'pos <= string->len' failed

Sending my patch for this issue separately as a pull request, since as you can see in the logs i linked above, I wasn't completely sure if that was the right way to fix it.

dequis added a commit to dequis/irssi that referenced this issue Aug 10, 2014

Fix glib warnings when tab completing in weird places
See github issue irssi#125 for more details
(or flyspray issue 124, submitted 10 years ago)
@dequis

This comment has been minimized.

Member

dequis commented Aug 10, 2014

Heh, flyspray bug 124, github bug 125 (and pull request 126 obviously)

@dequis

This comment has been minimized.

Member

dequis commented Aug 10, 2014

For reference:

08:52 < dx> the patch i made only fixes part of the nonsense, the main issue is in completion.c:190 but i'd rather not touch that because i have no idea when it's used like that

That's https://github.com/irssi/irssi/blob/d40c0704/src/fe-common/core/completion.c#L190

And my patch applies to https://github.com/irssi/irssi/blob/d40c0704/src/fe-common/core/completion.c#L165

Again, I barely remember what happened here, so if someone who is more enlightened knows what i meant by that, that would be cool.

@dgl

This comment has been minimized.

Member

dgl commented Aug 10, 2014

There's several issues in this code. The fact the offset is stored in a function static variable is quite likely contributing to this (see also #57).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment