Re: mutt/2560: Mutt chokes on invalid charset in UTF environment
The following reply was made to PR mutt/2560; it has been noted by GNATS.
From: Christian Ebert <blacktrash@xxxxxxx>
To: bug-any@xxxxxxxxxxxxx
Cc:
Subject: Re: mutt/2560: Mutt chokes on invalid charset in UTF environment
Date: Sat, 9 Dec 2006 05:07:51 +0100
* Alain Bench on Saturday, December 09, 2006 at 00:05:02 +0100:
> On Thursday, December 7, 2006 at 8:05:02 +0100, Christian Ebert wrote:
>> * Vincent Lefevre on Wednesday, November 22, 2006 at 14:25:02 +0100:
>>> But if the freeze occurs in libiconv, Mutt can't do anything.
>> Hm. I still think it would be better if would gave a warning than to
>> just freeze.
>
> Printing a warning each time Mutt encounters an unknown label? That
> might well quickly become annoying, no? And Mutt learns if a charset is
> known by calling iconv_open(). If this call happens to freeze...
Well, the heating should be working obviously ;)
>> I stumbled accross another evil [gb2312failure.gz] example ;-): my old
>> iconv has no trouble with attached message, whereas Mutt freezes
>
> This one has in its "From:" header 2 bytes invalid in GB2312. Mutt
> should mask them, printing 2 question marks. And does so under Linux, no
> freeze. Do you have any way to determine where exactly the freeze
> happens? Strace, gdb, whatever?
$ gdb mutt
GNU gdb 5.3-20030128 (Apple version gdb-330.1) (Fri Jul 16 21:42:28 GMT 2004)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "powerpc-apple-darwin".
Reading symbols for shared libraries ...... done
(gdb) set args -F /dev/null -f gb2312failure
(gdb) run
[...]
Sorting mailbox...
Program received signal SIGQUIT, Quit.
0x24962408 in waddch_nosync ()
(gdb) backtrace
#0 0x24962408 in waddch_nosync ()
#1 0x00031fb0 in print_enriched_string (attr=0, s=0xbfffe04a
"��������������� ( 17) [Ffmpeg-user] How to get
the exactness frame from MPEG file", ' ' <repeats 12 times>, do_color=0) at
menu.c:138
#2 0x0003250c in menu_redraw_index (menu=0x0) at menu.c:252
#3 0x00015530 in mutt_index_menu () at curs_main.c:552
#4 0x0002fb0c in main (argc=0, argv=0x750e0) at main.c:963
(gdb) quit
The program is running. Exit anyway? (y or n) y
This is CVS HEAD, w/o patches
> BTW the said 2 bytes are (I guess) perhaps really GB18030, a
> superset of GB2312. The probably best move is to alias them with:
>
>| charset-hook ^gb2312$ gb18030
>
> This should avoid you the freeze,
yes!
> and optimally display this mail
> and others of the same type (understatement in MIME label). See full
> story in Debian wishlist Bug#402027: "Display of GB2312 should be
> treated as GB18030 by default".
And of course much thanks for providing fool-proof explanations,
Alain! :-)
c
--
> Nobody likes a complainer. But we all like to complain. WTF is that
> about?
All the world's a stage, all the people are our supporting actors.
-- Bukvich and Bob in alt.angst