Adium

Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#13351 closed crash (fixed)

Crash with nicknames containing invalid UTF8 [update glib]

Reported by: btf Owned by: zacw
Milestone: Adium 1.4.2 Component: Service/IRC
Version: 1.4b9 Severity: major
Keywords: irc cyrillic international Cc:
Patch Status:

Description (last modified by Robby)

Summary

When your nickname, or nickname from userlist of IRC Channel contains Cyrillic character, Adium crashes.

Steps to reproduce

  1. Setup new connection using any server which using CP1251 encoding (i.e. irc.novafilm.tv port 6667).
  2. Connect to the server.
  3. Try any Cyrillic nickname (e.g. "Тестовый_ник")
  4. Try to join any channel (e.g. /j #testchannel)
  5. Adium crashes

You may test it with english letters only, all will be fine.

Also if there are some people on channel with nicks containing Cyrillic letters, Adium crashes even if joining with nick in English.

Expected results

Expected channel joining

Actual results

New tab appeared, Adium freezes and crashes.

Regression

Mac OS X Leopard 10.5.8
Adium 1.4b13 / 1.4b14

Notes

Crash log attached.

Attachments (3)

Adium_2009-11-05-222622_btf.crash (33.0 KB) - added by btf 10 years ago.
Crash log
Adium debug.txt (3.7 KB) - added by xja 10 years ago.
Debug log while joining an IRC conversation with Cyrillic nickname
crash.txt (41.9 KB) - added by sphynx 9 years ago.

Download all attachments as: .zip

Change History (34)

Changed 10 years ago by btf

Crash log

comment:1 Changed 10 years ago by zacw

  • Milestone set to Adium 1.4
  • Severity changed from normal to major

Looks like this is crashing out of changes I made in libpurple for 1.4.

comment:2 Changed 10 years ago by zacw

  • Status changed from new to pending

Please follow the instructions to get a debug log and attach it to this ticket.
I'm not able to reproduce this. I joined irc://irc.novafilm.tv/novafilm with an English nickname, and it did not crash.

Can you include a debug log until the crash?

comment:3 Changed 10 years ago by Robby

  • Description modified (diff)

comment:4 Changed 10 years ago by xja

Hi,
I reproduced the bug, I'm going to attach the debug log

Changed 10 years ago by xja

Debug log while joining an IRC conversation with Cyrillic nickname

comment:5 Changed 10 years ago by zacw

  • Status changed from pending to new

The libpurple changes in im.p.a and im.p.a.1-4 probably need to be adjusted to deal with encodings, maybe. I wonder why I can't reproduce it though.

comment:6 Changed 10 years ago by evands

  • Version changed from 1.4b13 to 1.4b9

What changes did you make related to the crash, Zac?

comment:7 follow-up: Changed 10 years ago by zacw

  • Description modified (diff)

The /who interception and changes to the conv chat buddies for attributes and faster searching.

comment:8 Changed 10 years ago by xja

...just to specify that I reproduced the bug with Adium 1.4b15 under Mac OS X 10.6.2
Bye

comment:9 Changed 10 years ago by Robby

  • Description modified (diff)

comment:10 in reply to: ↑ 7 Changed 10 years ago by evands

Replying to zacw:

The /who interception and changes to the conv chat buddies for attributes and faster searching.

I see. im.pidgin.adium 9fe8480e88fe4bea198b87f796810e35f34e6756 and friends.

I don't see anything grossly wrong with the method as-is. Do you have any thoughts as to why it's crashing?

comment:11 Changed 10 years ago by ggothreau

I was able to reproduce this in 1.4hg on 10.6.2.

I'm posting because I got a different crash log.

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   libSystem.B.dylib             	0x90006a90 strlen + 16
1   ...s.openspecies.rtool.libglib	0x005ee131 g_utf8_collate_key + 416
2   libpurple                     	0x00735967 purple_conv_chat_cb_find + 137
3   libpurple                     	0x007ad6b8 irc_msg_who + 179
4   libpurple                     	0x007b1fc5 irc_parse_msg + 1350
5   libpurple                     	0x007ab427 read_input + 174
6   libpurple                     	0x007ab7c4 irc_input_cb + 342

I found it odd that I have something from glib popping up there and glib is also showing a failed assertion in my console.log at the same time...

10-04-01 11:33:06 PM	[0x0-0x435435].com.adiumX.adiumX[10306]	(process:10306): GLib-CRITICAL **: g_convert: assertion `str != NULL' failed

I find this particular bug interesting so I'm going to try to look into a bit more, though it looks like it is libpurple / glib related, neither of which I am intimately familiar with. Is this bug also happening in other clients that use libpurple? Anything else I can do to help in the meantime?

comment:12 Changed 10 years ago by evands

Whether it's happening in other clients or not isn't known to me - that could be a good place to start in your investigation. Pidgin 2.6.6 for OS X is available via Fink, I believe.

comment:13 Changed 10 years ago by zacw

irc_msg_who is an Adium-added libpurple function, and where the crash is occurring. Fink and Pidgin won't see the error.

comment:14 Changed 10 years ago by evands

Oh, right. Thanks, Zac.

comment:15 Changed 9 years ago by Robby

btf, xja, ggothreau,

I suppose this remains a problem in 1.4b18?

comment:16 Changed 9 years ago by xja

Bye, it seems to be fixed in beta 18.
I log into irc.novafilm.tv with the suggested name, I also set the CP1251 encoding in the account.
Joining a channel and sending a message causes Adium to say I'm not connected.
Bye.

comment:17 Changed 9 years ago by Robby

  • Milestone Adium 1.4 deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Yay, thanks! :)

comment:18 Changed 9 years ago by sphynx

This still happens. haroT3k reported this issue again in #adium today, with 1.4b18. I'll attach his crash log, which has the same crash as ggothreau's log. It happened for haroT3k in #news on irc.rizon.net, but I could join that channel without problems. Changing the account's encoding from ASCII to UTF8 didn't make a difference for him. I couldn't tell quickly if there were any cyrillic nicknames in the channel (over 1600+ users) though.

Changed 9 years ago by sphynx

comment:19 Changed 9 years ago by sphynx

Okay, I think I have this bug pinned down.

A huge disadvantage of IRC is that encodings cannot be specified, and aren't enforced. In the log from yesterday I noticed someone with the nick (in hex) 7E 54 68 65 A0 4F 6E 65 A0 54 72 75 65 A0 47 4F 44, which contains the character A0 in a way that is not allowed in UTF-8. libpurple relies on libglib to convert these strings to valid UTF-8, but this is broken for libglib versions < 2.17.1: https://bugzilla.gnome.org/show_bug.cgi?id=531403. 1.4b18 includes version 2.16 of glib, 1.5hg tip has 2.20, so that's why it worked for me with no problems. I have no idea what impact updating libglib in Adium could have so late in the beta, but I think that would really be the only option to fix this bug.

comment:20 Changed 9 years ago by sphynx

Sorry for the ticket-spam, but I just realized I forgot what zac posted: as irc_msg_who is one of Adium's added functions, it might also be possible to put a workaround there. I suspect its args[5] is the only problem, so that could be properly sanitized before passing it to purple_conv_chat_cb_find, but I am not sure the crash can't happen somewhere else too. So in the long run I think Adium 1.4 would need a newer glib.

comment:21 Changed 9 years ago by Robby

  • Resolution worksforme deleted
  • Status changed from closed to new

comment:22 Changed 9 years ago by Robby

Ticket #14137 has been marked as a duplicate of this ticket.

comment:23 Changed 9 years ago by evands

  • Milestone set to Adium 1.5
  • Resolution set to fixed
  • Status changed from new to closed

This shouldn't be closed as worksforme but rather as fixed in 1.5, since it's wontfix in 1.4.

comment:24 Changed 9 years ago by sphynx

Ticket #14591 has been marked as a duplicate of this ticket.

comment:25 Changed 9 years ago by zacw

  • Milestone changed from Adium 1.5 to Adium 1.4.2
  • Resolution fixed deleted
  • Status changed from closed to new

I see no reason to delay updating glib.

comment:26 Changed 9 years ago by Robby

Ticket #14913 has been marked as a duplicate of this ticket.

comment:27 Changed 9 years ago by Robby

  • Summary changed from (IRC) Crash with Cyrillic nicknames to Crash with Cyrillic nicknames [update glib)

comment:28 Changed 9 years ago by Robby

  • Summary changed from Crash with Cyrillic nicknames [update glib) to Crash with Cyrillic nicknames [update glib]

OCD :D

comment:29 Changed 9 years ago by Thijs Alkemade <thijsalkemade@…>

  • Resolution set to fixed
  • Status changed from new to closed

(In 2e9c32fda335) Bring glib up to version 2.20.5, same as trunk.

Fixes #13351

comment:30 Changed 9 years ago by Robby

  • Summary changed from Crash with Cyrillic nicknames [update glib] to Crash with nicknames containing invalid UTF8 [update glib]

comment:31 Changed 8 years ago by jankkhvej

My bug #14591 is not fixed by this. Still same crash as I reported. So, I believe #14591 is not a dup of this, so, please, reopen my bug. I wish to help to debug it.

Note: See TracTickets for help on using tickets.