! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Chinese Characters in RAR Comments make xarchiver die.
Status:
RESOLVED: FIXED
Product:
Xarchiver
Component:
general

Comments

Description xfce 2009-02-04 12:38:47 CET
Gentoo 2008.0 with xarchiver-9999 in xfce4-dev overlay.
(http://svn.xfce.org/svn/xfce/xarchiver/trunk At revision 29447.)

Repeat:
(filename.rar with some Chinese in the RAR comments, 
I dont know its locale is GBK / UTF-8 )

xarchiver filename.rar

*** glibc detected *** xarchiver: free(): invalid next size (fast): 0x00000000025ba740 ***
======= Backtrace: =========
/lib/libc.so.6[0x30ff074548]
/lib/libc.so.6(cfree+0x76)[0x30ff076656]
xarchiver[0x412634]
/usr/lib/libglib-2.0.so.0[0x310283dd84]
/usr/lib/libglib-2.0.so.0[0x310283fb2d]
/usr/lib/libglib-2.0.so.0(g_main_loop_run+0x1f5)[0x31028400b5]
/usr/lib/libgtk-x11-2.0.so.0(gtk_main+0xa7)[0x310a544a97]
xarchiver[0x40f9a8]
/lib/libc.so.6(__libc_start_main+0xe6)[0x30ff01e1d6]
xarchiver[0x40c389]
======= Memory map: ========
00400000-0043f000 r-xp 00000000 08:02 370059                             /usr/bin/xarchiver
0063f000-00640000 r--p 0003f000 08:02 370059                             /usr/bin/xarchiver
00640000-00642000 rw-p 00040000 08:02 370059                             /usr/bin/xarchiver
022d6000-02704000 rw-p 022d6000 00:00 0                                  [heap]
30fec00000-30fec1c000 r-xp 00000000 08:02 4409                           /lib64/ld-2.7.so
30fee1c000-30fee1d000 r--p 0001c000 08:02 4409                           /lib64/ld-2.7.so
30fee1d000-30fee1e000 rw-p 0001d000 08:02 4409                           /lib64/ld-2.7.so
30ff000000-30ff14b000 r-xp 00000000 08:02 12391                          /lib64/libc-2.7.so
30ff14b000-30ff34a000 ---p 0014b000 08:02 12391                          /lib64/libc-2.7.so
30ff34a000-30ff34e000 r--p 0014a000 08:02 12391                          /lib64/libc-2.7.so
30ff34e000-30ff34f000 rw-p 0014e000 08:02 12391                          /lib64/libc-2.7.so
30ff34f000-30ff354000 rw-p 30ff34f000 00:00 0 
30ff400000-30ff482000 r-xp 00000000 08:02 384923                         /lib64/libm-2.7.so
30ff482000-30ff681000 ---p 00082000 08:02 384923                         /lib64/libm-2.7.so
30ff681000-30ff682000 r--p 00081000 08:02 384923                         /lib64/libm-2.7.so
30ff682000-30ff683000 rw-p 00082000 08:02 384923                         /lib64/libm-2.7.so
30ff800000-30ff802000 r-xp 00000000 08:02 365715                         /lib64/libdl-2.7.so
30ff802000-30ffa02000 ---p 00002000 08:02 365715                         /lib64/libdl-2.7.so
30ffa02000-30ffa03000 r--p 00002000 08:02 365715                         /lib64/libdl-2.7.so
30ffa03000-30ffa04000 rw-p 00003000 08:02 365715                         /lib64/libdl-2.7.so
30ffc00000-30ffc02000 r-xp 00000000 08:02 384919                         /usr/lib64/libXau.so.6.0.0
30ffc02000-30ffe01000 ---p 00002000 08:02 384919                         /usr/lib64/libXau.so.6.0.0
30ffe01000-30ffe02000 r--p 00001000 08:02 384919                         /usr/lib64/libXau.so.6.0.0
30ffe02000-30ffe03000 rw-p 00002000 08:02 384919                         /usr/lib64/libXau.so.6.0.0
3100000000-3100005000 r-xp 00000000 08:02 384920                         /usr/lib64/libXdmcp.so.6.0.0
3100005000-3100204000 ---p 00005000 08:02 384920                         /usr/lib64/libXdmcp.so.6.0.0
3100204000-3100205000 r--p 00004000 08:02 384920                         /usr/lib64/libXdmcp.so.6.0.0
3100205000-3100206000 rw-p 00005000 08:02 384920                         /usr/lib64/libXdmcp.so.6.0.0
3100400000-3100512000 r-xp 00000000 08:02 384921                         /usr/lib64/libX11.so.6.2.0
3100512000-3100711000 ---p 00112000 08:02 384921                         /usr/lib64/libX11.so.6.2.0
3100711000-3100713000 r--p 00111000 08:02 384921                         /usr/lib64/libX11.so.6.2.0
3100713000-3100718000 rw-p 00113000 08:02 384921                         /usr/lib64/libX11.so.6.2.0
3100800000-3100816000 r-xp 00000000 08:02 384913                         /lib64/libpthread-2.7.so
3100816000-3100a16000 ---p 00016000 08:02 384913                         /lib64/libpthread-2.7.so
3100a16000-3100a17000 r--p 00016000 08:02 384913                         /lib64/libpthread-2.7.so
3100a17000-3100a18000 rw-p 00017000 08:02 384913                         /lib64/libpthread-2.7.so
3100a18000-3100a1c000 rw-p 3100a18000 00:00 0 
3101000000-3101016000 r-xp 00000000 08:02 384927                         /usr/lib64/Aborted

--------------

I have also written a wrapper, and renamed /usr/bin/unrar to unrar-back

new /usr/bin/unrar (wrapper):

#!/bin/sh
exec unrar-back $1 -c- $2 $3 $4 $5 $6 $7 $8 $9

(unrar switches:)
  c-            Disable comments show

use this trick xarchiver works well (without rar comment support).
so i think RAR comment is the problem.
Comment 1 Giuseppe Torelli 2009-02-04 12:46:13 CET
(In reply to comment #0)
> Gentoo 2008.0 with xarchiver-9999 in xfce4-dev overlay.
> (http://svn.xfce.org/svn/xfce/xarchiver/trunk At revision 29447.)
> 
> Repeat:
> (filename.rar with some Chinese in the RAR comments, 
> I dont know its locale is GBK / UTF-8 )

Hi,

would you mind to run xarchiver from its sources directory and then send me the gdb backtrace please?
Comment 2 Giuseppe Torelli 2009-02-04 13:14:29 CET
Hi,

can you please send me or attach here a small rar archive comment with chinese characters?
Comment 3 xfce 2009-02-05 10:33:00 CET
Created attachment 2156 
rar file with some special chinese comments

not all the comments in chinese cause the problem.

unrar & rar works well.

I'll try to use gdb :)
Comment 4 xfce 2009-02-05 10:49:33 CET
backtrace:

#0  0x00000030ff07d180 in memset () from /lib/libc.so.6
#1  0x00000030ff078512 in calloc () from /lib/libc.so.6
#2  0x00000031028449fa in g_malloc0 () from /usr/lib/libglib-2.0.so.0
#3  0x0000000000412c58 in xa_alloc_memory_for_each_row (nc=10, column_types=0x1e90a90) at archive.c:486
#4  0x0000000000412d1a in xa_set_archive_entries_for_each_row (archive=0x1e9ba00, filename=<value optimized out>, items=0x7fff5d72e500)
    at archive.c:549
#5  0x00000000004237bd in xa_get_rar_line_content (line=0x1eb0080 "(�\217\202�\212��\226���\217��\232http://faq.verycd.com/project/mp3!/)\n", 
    data=0x1e9ba00) at rar.c:216
#6  0x00000000004139ea in xa_process_output (ioc=0x1e83d00, cond=<value optimized out>, data=<value optimized out>) at archive.c:200
#7  0x000000310283dd84 in ?? () from /usr/lib/libglib-2.0.so.0
#8  0x000000310283fb2d in ?? () from /usr/lib/libglib-2.0.so.0
#9  0x00000031028400b5 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#10 0x000000310a544a97 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#11 0x00000000004107b8 in main (argc=2, argv=0x7fff5d72e8a8) at main.c:298
Comment 5 Giuseppe Torelli 2009-02-05 10:59:16 CET
(In reply to comment #4)
> backtrace:
> 
> #0  0x00000030ff07d180 in memset () from /lib/libc.so.6
> #1  0x00000030ff078512 in calloc () from /lib/libc.so.6
> #2  0x00000031028449fa in g_malloc0 () from /usr/lib/libglib-2.0.so.0
> #3  0x0000000000412c58 in xa_alloc_memory_for_each_row (nc=10,
> column_types=0x1e90a90) at archive.c:486
> #4  0x0000000000412d1a in xa_set_archive_entries_for_each_row
> (archive=0x1e9ba00, filename=<value optimized out>, items=0x7fff5d72e500)
>     at archive.c:549
> #5  0x00000000004237bd in xa_get_rar_line_content (line=0x1eb0080
> "(�\217\202�\212��\226���\217��\232http://faq.verycd.com/project/mp3!/)\n", 
>     data=0x1e9ba00) at rar.c:216
> #6  0x00000000004139ea in xa_process_output (ioc=0x1e83d00, cond=<value
> optimized out>, data=<value optimized out>) at archive.c:200
> #7  0x000000310283dd84 in ?? () from /usr/lib/libglib-2.0.so.0
> #8  0x000000310283fb2d in ?? () from /usr/lib/libglib-2.0.so.0
> #9  0x00000031028400b5 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
> #10 0x000000310a544a97 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
> #11 0x00000000004107b8 in main (argc=2, argv=0x7fff5d72e8a8) at main.c:298

I think it should be a matter of encoding, but I don't know at the moment how to solve this bug. Can you try with another archive format with the same comment? Your cooperation is highly appreciated.
Comment 6 xfce 2009-02-05 12:19:14 CET
zip is no problem.
(zipinfo doesnt output comments)

file rar.c:

void xa_get_rar_line_content (gchar *line, gpointer data)
		if (line[0] == '-') //line 97
		{
			jump_header = TRUE;
			return;
		}

because that rar comments include "-".

use a separate method to fetch rar comments?

like:
command = g_strconcat ( rar," v -c- " , archive->escaped_path, NULL );

rar usage:
  cw            Write archive comment to file

----

now we know not the chinese character problem, "-" is the problem.
Comment 7 xfce 2009-02-05 12:22:35 CET
I removed the "-"s in the rar comments, problem disappeared.
Comment 8 Giuseppe Torelli 2009-02-05 12:32:42 CET
(In reply to comment #7)
> I removed the "-"s in the rar comments, problem disappeared.

If I use -c- in the command line passed to the rar executable the comment won't be output anymore and Xarchiver can't display it. I have to find another way that notify the comment is ended. Thank you for your kind help!
Comment 9 Giuseppe Torelli 2009-02-05 13:22:54 CET
Fixed in revision 29455.

Bug #4901

Reported by:
xfce
Reported on: 2009-02-04
Last modified on: 2009-02-05

People

Assignee:
Giuseppe Torelli
CC List:
0 users

Version

Version:
unspecified

Attachments

rar file with some special chinese comments (876 bytes, application/octet-stream)
2009-02-05 10:33 CET , xfce
no flags

Additional information