Created attachment 14821 [details] [review] patch, for fix the problem. uim-xim sometimes cause crash, because of misuse of iconv. Relevant version is uim-1.4.2 and older versions. 1) A string returned by iconv() is not ASCIIZ. The end of string is not a charactor '\x0'. 2) It is required that calling iconv() with inbuf = NULL, inbytesleft = NULL to finish a session of conversion.
Thanks for the report. I've forgot to backport the termination issue of uim-xim to 1.4.2, sorry. But I'm just curious to know that is resetting iconv state really needed? I'm too ignorant about iconv(3). Any pointer about this?
Sorry, I make a mistake. If uim use only UTF-8, EUC-JP and ShiftJIS(cp932), resetting the state is specially unnecessary, probably. I forgot to check whether it was able to be applied to uim or not. Ummm... Excuse me but I have no idea that there are any OS or emacs-el that uses ISO-2022-JP for locale in OS or encoding in emacs-el. Anyway, in generally, resetting a state is required when using iconv. I do not found a document clearly described. But some documents said implicitly. In libiconv-1.11, testing code and command-line tool. libiconv-1.11/tests/table-from.c: line from 56 to 58 libiconv-1.11/tests/table-to.c: line from 70 to 72 libiconv-1.11/src/iconv.c: ... so many, snip. Sun docs, man pages section 3 iconv(3c). In example, resetting a state using INIT_SHIFT_STATE() macro. http://docs.sun.com/app/docs/doc/819-2243/iconv-3c?l=ja&a=view Thank you.
Thanks, libiconv's example is interesting. And now the patch is applied to svn trunk.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.