Re: claws-mail deadlocking in iconv

2013-10-15 Thread Fabian Keil
Fabian Keil  wrote:

> After the iconv import claws-mail started to deadlock in iconv every now
> and then on my system, which prevented claws-mail from rendering windows
> or reacting to input.
[...] 
> Did anyone else run into this or can comment on the patch or
> the backtraces?

Thanks for the feedback, everyone. This is now bin/182994:
http://www.freebsd.org/cgi/query-pr.cgi?pr=182994

Fabian


signature.asc
Description: PGP signature


Re: claws-mail deadlocking in iconv

2013-10-10 Thread Tijl Coosemans
On Wed, 9 Oct 2013 18:34:46 +0200 Fabian Keil wrote:
> After the iconv import claws-mail started to deadlock in iconv every now
> and then on my system, which prevented claws-mail from rendering windows
> or reacting to input.
> 
> So far I haven't been able to reproduce this intentionally and various
> rebuilds of ports, kernel and userland (mainly for other reasons) had
> no effect.
> 
> When the problem occurs, trying to attach to the process causes
> gdb and gdb76 to crash which also crashes claws-mail, but sending
> SIGABRT causes a proper core dump that can be analysed with gdb.
> 
> The backtraces always show that there is only one thread running and
> it's trying to lock cm_lock in _citrus_mapper_close(), which apparently
> is already locked due to a _citrus_mapper_close() recursion. Examples:
> 
> #0  _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37
> 37RSYSCALL_ERR(_umtx_op)
> [New Thread 80a806400 (LWP 100487/claws-mail)]
> (gdb) where
> #0  _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37
> #1  0x0008084861a6 in __thr_rwlock_wrlock (rwlock=0x80a8a47c0, tsp= optimized out>) at /usr/src/lib/libthr/thread/thr_umtx.c:296
> #2  0x000808489b1d in rwlock_wrlock_common (rwlock=, 
> abstime=0x0) at /usr/src/lib/libthr/thread/thr_rwlock.c:267
> #3  0x000808489a8b in _pthread_rwlock_wrlock (rwlock=0x80a8a47c0) at 
> /usr/src/lib/libthr/thread/thr_rwlock.c:289
> #4  0x00080911e848 in _citrus_mapper_close (cm=0x80b5a2d80) at 
> /usr/src/lib/libc/iconv/citrus_mapper.c:375
> #5  0x00080d205d18 in _citrus_mapper_serial_mapper_uninit 
> (cm=0x80b5a2d40) at 
> /usr/src/lib/libiconv_modules/mapper_parallel/../mapper_serial/citrus_mapper_serial.c:110
> #6  0x00080911e8d7 in mapper_close (cm=0x80b5a2d40) at 
> /usr/src/lib/libc/iconv/citrus_mapper.c:188
> #7  0x00080911e88c in _citrus_mapper_close (cm=) at 
> /usr/src/lib/libc/iconv/citrus_mapper.c:384
> #8  0x00080c4e83f3 in close_srcs (sl=0x80b591140) at 
> /usr/src/lib/libiconv_modules/iconv_std/citrus_iconv_std.c:206
> #9  0x00080c4e7dc9 in _citrus_iconv_std_iconv_uninit_shared (ci= optimized out>) at 
> /usr/src/lib/libiconv_modules/iconv_std/citrus_iconv_std.c:415
> #10 0x0008090f3f95 in release_shared (ci=0x80a8ee630) at 
> /usr/src/lib/libc/iconv/citrus_iconv.c:99
> #11 0x0008090f4002 in _citrus_iconv_close (cv=0x80d88d5d0) at 
> /usr/src/lib/libc/iconv/citrus_iconv.c:335
> #12 0x0008090f1ca6 in iconv_close (handle=0x80a8a47c0) at 
> /usr/src/lib/libc/iconv/iconv.c:131
> #13 0x0046376d in conv_iconv_strdup (inbuf=0x7fff58b0 "\n", 
> src_code=0x80b5b4db0 "Windows-1252", dest_code=0x6f03d0 "UTF-8") at 
> codeconv.c:895
> #14 0x00463d13 in conv_convert (conv=0x80b5a4e80, 
> outbuf=0x7fff3720 "", outlen=8192, inbuf=0x7fff58b0 "\n") at 
> codeconv.c:734
> #15 0x005e22ac in textview_write_line (textview=0x80a959cc0, 
> str=0x7fff58b0 "\n", conv=0x80b5a4e80, do_quote_folding=1) at 
> textview.c:1573
> #16 0x005df8e4 in textview_write_body (textview=0x80a959cc0, 
> mimeinfo=0x80aad2d00) at textview.c:1177
> #17 0x005e5363 in textview_add_part (textview=0x80a959cc0, 
> mimeinfo=0x80aad2d00) at textview.c:826
> #18 0x005e4053 in recursive_add_parts (textview=0x80a959cc0, 
> node=0x80a826190) at textview.c:839
> #19 0x005e4302 in recursive_add_parts (textview=0x80a959cc0, 
> node=0x80aa81d20) at textview.c:888
> #20 0x005e4302 in recursive_add_parts (textview=0x80a959cc0, 
> node=0x80a828890) at textview.c:888
> #21 0x005defa1 in textview_add_parts (textview=0x80a959cc0, 
> mimeinfo=0x80b610700) at textview.c:898
> #22 0x005deb85 in textview_show_part (textview=0x80a959cc0, 
> mimeinfo=0x80b610700, fp=0x8094319a0) at textview.c:645
> [...]
> 
> #0  0x000808491b9c in __error () from /lib/libthr.so.3
> #1  0x00080848bb1d in rwlock_wrlock_common (rwlock=, 
> abstime=0x0) at /usr/src/lib/libthr/thread/thr_rwlock.c:267
> #2  0x00080848ba8b in _pthread_rwlock_wrlock (rwlock=0x80a8ede20) at 
> /usr/src/lib/libthr/thread/thr_rwlock.c:289
> #3  0x00080911f848 in _citrus_mapper_close (cm=0x80a8bfc40) at 
> /usr/src/lib/libc/iconv/citrus_mapper.c:375
> #4  0x00080ce02d18 in _citrus_mapper_serial_mapper_uninit 
> (cm=0x80a8bfc00) at 
> /usr/src/lib/libiconv_modules/mapper_parallel/../mapper_serial/citrus_mapper_serial.c:110
> #5  0x00080911f8d7 in mapper_close (cm=0x80a8bfc00) at 
> /usr/src/lib/libc/iconv/citrus_mapper.c:188
> #6  0x00080911f88c in _citrus_mapper_close (cm=) at 
> /usr/src/lib/libc/iconv/citrus_mapper.c:384
> #7  0x00080c5893f3 in close_srcs (sl=0x80a8edda0) at 
> /usr/src/lib/libiconv_modules/iconv_std/citrus_iconv_std.c:206
> #8  0x00080c588dc9 in _citrus_iconv_std_iconv_uninit_shared (ci= optimized out>) at 
> /usr/src/lib/libiconv_modules/iconv_std/citrus_iconv_std.c:415
> #9  0x0008090f4f95 in release_shared (ci=0x80b408890

Re: claws-mail deadlocking in iconv

2013-10-10 Thread Maciej Suszko
Fabian Keil  wrote:
> After the iconv import claws-mail started to deadlock in iconv every
> now and then on my system, which prevented claws-mail from rendering
> windows or reacting to input.
> 
> So far I haven't been able to reproduce this intentionally and various
> rebuilds of ports, kernel and userland (mainly for other reasons) had
> no effect.
> 
> When the problem occurs, trying to attach to the process causes
> gdb and gdb76 to crash which also crashes claws-mail, but sending
> SIGABRT causes a proper core dump that can be analysed with gdb.
> 
> The backtraces always show that there is only one thread running and
> it's trying to lock cm_lock in _citrus_mapper_close(), which
> apparently is already locked due to a _citrus_mapper_close()
> recursion. Examples:

[...]

> This patch:
> http://www.fabiankeil.de/sourcecode/freebsd/iconv-Let-_citrus_mapper_close-unlock-cm_lock-before-calli.diff
> seems to prevent the deadlock, but I'm not 100% sure that it's
> correct and I'm also a bit surprised by the lack of reports from
> other claws-mail users.
> 
> Did anyone else run into this or can comment on the patch or
> the backtraces?


In my case Claws Mail was hanging everytime I tried to access one of
my bigger IMAP folders (50k+ messages). It was 100% reproducible.

The patch seems to solve the problem for me - Claws is running now
smooth, without any locks.
-- 
regards, Maciej Suszko.


signature.asc
Description: PGP signature


Re: claws-mail deadlocking in iconv

2013-10-10 Thread O. Hartmann
On Wed, 9 Oct 2013 18:34:46 +0200
Fabian Keil  wrote:

> After the iconv import claws-mail started to deadlock in iconv every
> now and then on my system, which prevented claws-mail from rendering
> windows or reacting to input.
> 
> So far I haven't been able to reproduce this intentionally and various
> rebuilds of ports, kernel and userland (mainly for other reasons) had
> no effect.
> 
> When the problem occurs, trying to attach to the process causes
> gdb and gdb76 to crash which also crashes claws-mail, but sending
> SIGABRT causes a proper core dump that can be analysed with gdb.
> 
> The backtraces always show that there is only one thread running and
> it's trying to lock cm_lock in _citrus_mapper_close(), which
> apparently is already locked due to a _citrus_mapper_close()
> recursion. Examples:
> 
> #0  _umtx_op_err ()
> at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37 37
> RSYSCALL_ERR(_umtx_op) [New Thread 80a806400 (LWP 100487/claws-mail)]
> (gdb) where
> #0  _umtx_op_err ()
> at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37 #1
> 0x0008084861a6 in __thr_rwlock_wrlock (rwlock=0x80a8a47c0,
> tsp=)
> at /usr/src/lib/libthr/thread/thr_umtx.c:296 #2  0x000808489b1d
> in rwlock_wrlock_common (rwlock=, abstime=0x0)
> at /usr/src/lib/libthr/thread/thr_rwlock.c:267 #3  0x000808489a8b
> in _pthread_rwlock_wrlock (rwlock=0x80a8a47c0)
> at /usr/src/lib/libthr/thread/thr_rwlock.c:289 #4  0x00080911e848
> in _citrus_mapper_close (cm=0x80b5a2d80)
> at /usr/src/lib/libc/iconv/citrus_mapper.c:375 #5  0x00080d205d18
> in _citrus_mapper_serial_mapper_uninit (cm=0x80b5a2d40)
> at 
> /usr/src/lib/libiconv_modules/mapper_parallel/../mapper_serial/citrus_mapper_serial.c:110
> #6  0x00080911e8d7 in mapper_close (cm=0x80b5a2d40)
> at /usr/src/lib/libc/iconv/citrus_mapper.c:188 #7  0x00080911e88c
> in _citrus_mapper_close (cm=)
> at /usr/src/lib/libc/iconv/citrus_mapper.c:384 #8  0x00080c4e83f3
> in close_srcs (sl=0x80b591140)
> at /usr/src/lib/libiconv_modules/iconv_std/citrus_iconv_std.c:206 #9
> 0x00080c4e7dc9 in _citrus_iconv_std_iconv_uninit_shared
> (ci=)
> at /usr/src/lib/libiconv_modules/iconv_std/citrus_iconv_std.c:415 #10
> 0x0008090f3f95 in release_shared (ci=0x80a8ee630)
> at /usr/src/lib/libc/iconv/citrus_iconv.c:99 #11 0x0008090f4002
> in _citrus_iconv_close (cv=0x80d88d5d0)
> at /usr/src/lib/libc/iconv/citrus_iconv.c:335 #12 0x0008090f1ca6
> in iconv_close (handle=0x80a8a47c0)
> at /usr/src/lib/libc/iconv/iconv.c:131 #13 0x0046376d in
> conv_iconv_strdup (inbuf=0x7fff58b0 "\n", src_code=0x80b5b4db0
> "Windows-1252", dest_code=0x6f03d0 "UTF-8") at codeconv.c:895 #14
> 0x00463d13 in conv_convert (conv=0x80b5a4e80,
> outbuf=0x7fff3720 "", outlen=8192, inbuf=0x7fff58b0 "\n") at
> codeconv.c:734 #15 0x005e22ac in textview_write_line
> (textview=0x80a959cc0, str=0x7fff58b0 "\n", conv=0x80b5a4e80,
> do_quote_folding=1) at textview.c:1573 #16 0x005df8e4 in
> textview_write_body (textview=0x80a959cc0, mimeinfo=0x80aad2d00) at
> textview.c:1177 #17 0x005e5363 in textview_add_part
> (textview=0x80a959cc0, mimeinfo=0x80aad2d00) at textview.c:826 #18
> 0x005e4053 in recursive_add_parts (textview=0x80a959cc0,
> node=0x80a826190) at textview.c:839 #19 0x005e4302 in
> recursive_add_parts (textview=0x80a959cc0, node=0x80aa81d20) at
> textview.c:888 #20 0x005e4302 in recursive_add_parts
> (textview=0x80a959cc0, node=0x80a828890) at textview.c:888 #21
> 0x005defa1 in textview_add_parts (textview=0x80a959cc0,
> mimeinfo=0x80b610700) at textview.c:898 #22 0x005deb85 in
> textview_show_part (textview=0x80a959cc0, mimeinfo=0x80b610700,
> fp=0x8094319a0) at textview.c:645 [...]
> 
> #0  0x000808491b9c in __error () from /lib/libthr.so.3
> #1  0x00080848bb1d in rwlock_wrlock_common (rwlock= optimized out>, abstime=0x0)
> at /usr/src/lib/libthr/thread/thr_rwlock.c:267 #2  0x00080848ba8b
> in _pthread_rwlock_wrlock (rwlock=0x80a8ede20)
> at /usr/src/lib/libthr/thread/thr_rwlock.c:289 #3  0x00080911f848
> in _citrus_mapper_close (cm=0x80a8bfc40)
> at /usr/src/lib/libc/iconv/citrus_mapper.c:375 #4  0x00080ce02d18
> in _citrus_mapper_serial_mapper_uninit (cm=0x80a8bfc00)
> at 
> /usr/src/lib/libiconv_modules/mapper_parallel/../mapper_serial/citrus_mapper_serial.c:110
> #5  0x00080911f8d7 in mapper_close (cm=0x80a8bfc00)
> at /usr/src/lib/libc/iconv/citrus_mapper.c:188 #6  0x00080911f88c
> in _citrus_mapper_close (cm=)
> at /usr/src/lib/libc/iconv/citrus_mapper.c:384 #7  0x00080c5893f3
> in close_srcs (sl=0x80a8edda0)
> at /usr/src/lib/libiconv_modules/iconv_std/citrus_iconv_std.c:206 #8
> 0x00080c588dc9 in _citrus_iconv_std_iconv_uninit_shared
> (ci=)
> at /usr/src/lib/libiconv_modules/iconv_std/citrus_iconv_std.c:415 #9
> 0x0008090f4f95 in release_shared (ci=0x80b408890)
> at /usr/src/lib/libc/iconv/citrus_iconv.c:99 #10 0x000809

Re: claws-mail deadlocking in iconv

2013-10-09 Thread RW
On Wed, 9 Oct 2013 18:34:46 +0200
Fabian Keil wrote:

> After the iconv import claws-mail started to deadlock in iconv every
> now and then on my system, which prevented claws-mail from rendering
> windows or reacting to input.
> ...
> and I'm also a bit surprised by the lack of reports from
> other claws-mail users.
> 
> Did anyone else run into this or can comment on the patch or
> the backtraces?

I can't comment on the rest, but I have recently been seening lock-ups
in claws-mail on current.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


claws-mail deadlocking in iconv

2013-10-09 Thread Fabian Keil
After the iconv import claws-mail started to deadlock in iconv every now
and then on my system, which prevented claws-mail from rendering windows
or reacting to input.

So far I haven't been able to reproduce this intentionally and various
rebuilds of ports, kernel and userland (mainly for other reasons) had
no effect.

When the problem occurs, trying to attach to the process causes
gdb and gdb76 to crash which also crashes claws-mail, but sending
SIGABRT causes a proper core dump that can be analysed with gdb.

The backtraces always show that there is only one thread running and
it's trying to lock cm_lock in _citrus_mapper_close(), which apparently
is already locked due to a _citrus_mapper_close() recursion. Examples:

#0  _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37
37  RSYSCALL_ERR(_umtx_op)
[New Thread 80a806400 (LWP 100487/claws-mail)]
(gdb) where
#0  _umtx_op_err () at /usr/src/lib/libthr/arch/amd64/amd64/_umtx_op_err.S:37
#1  0x0008084861a6 in __thr_rwlock_wrlock (rwlock=0x80a8a47c0, tsp=) at /usr/src/lib/libthr/thread/thr_umtx.c:296
#2  0x000808489b1d in rwlock_wrlock_common (rwlock=, 
abstime=0x0) at /usr/src/lib/libthr/thread/thr_rwlock.c:267
#3  0x000808489a8b in _pthread_rwlock_wrlock (rwlock=0x80a8a47c0) at 
/usr/src/lib/libthr/thread/thr_rwlock.c:289
#4  0x00080911e848 in _citrus_mapper_close (cm=0x80b5a2d80) at 
/usr/src/lib/libc/iconv/citrus_mapper.c:375
#5  0x00080d205d18 in _citrus_mapper_serial_mapper_uninit (cm=0x80b5a2d40) 
at 
/usr/src/lib/libiconv_modules/mapper_parallel/../mapper_serial/citrus_mapper_serial.c:110
#6  0x00080911e8d7 in mapper_close (cm=0x80b5a2d40) at 
/usr/src/lib/libc/iconv/citrus_mapper.c:188
#7  0x00080911e88c in _citrus_mapper_close (cm=) at 
/usr/src/lib/libc/iconv/citrus_mapper.c:384
#8  0x00080c4e83f3 in close_srcs (sl=0x80b591140) at 
/usr/src/lib/libiconv_modules/iconv_std/citrus_iconv_std.c:206
#9  0x00080c4e7dc9 in _citrus_iconv_std_iconv_uninit_shared (ci=) at 
/usr/src/lib/libiconv_modules/iconv_std/citrus_iconv_std.c:415
#10 0x0008090f3f95 in release_shared (ci=0x80a8ee630) at 
/usr/src/lib/libc/iconv/citrus_iconv.c:99
#11 0x0008090f4002 in _citrus_iconv_close (cv=0x80d88d5d0) at 
/usr/src/lib/libc/iconv/citrus_iconv.c:335
#12 0x0008090f1ca6 in iconv_close (handle=0x80a8a47c0) at 
/usr/src/lib/libc/iconv/iconv.c:131
#13 0x0046376d in conv_iconv_strdup (inbuf=0x7fff58b0 "\n", 
src_code=0x80b5b4db0 "Windows-1252", dest_code=0x6f03d0 "UTF-8") at 
codeconv.c:895
#14 0x00463d13 in conv_convert (conv=0x80b5a4e80, outbuf=0x7fff3720 
"", outlen=8192, inbuf=0x7fff58b0 "\n") at codeconv.c:734
#15 0x005e22ac in textview_write_line (textview=0x80a959cc0, 
str=0x7fff58b0 "\n", conv=0x80b5a4e80, do_quote_folding=1) at 
textview.c:1573
#16 0x005df8e4 in textview_write_body (textview=0x80a959cc0, 
mimeinfo=0x80aad2d00) at textview.c:1177
#17 0x005e5363 in textview_add_part (textview=0x80a959cc0, 
mimeinfo=0x80aad2d00) at textview.c:826
#18 0x005e4053 in recursive_add_parts (textview=0x80a959cc0, 
node=0x80a826190) at textview.c:839
#19 0x005e4302 in recursive_add_parts (textview=0x80a959cc0, 
node=0x80aa81d20) at textview.c:888
#20 0x005e4302 in recursive_add_parts (textview=0x80a959cc0, 
node=0x80a828890) at textview.c:888
#21 0x005defa1 in textview_add_parts (textview=0x80a959cc0, 
mimeinfo=0x80b610700) at textview.c:898
#22 0x005deb85 in textview_show_part (textview=0x80a959cc0, 
mimeinfo=0x80b610700, fp=0x8094319a0) at textview.c:645
[...]

#0  0x000808491b9c in __error () from /lib/libthr.so.3
#1  0x00080848bb1d in rwlock_wrlock_common (rwlock=, 
abstime=0x0) at /usr/src/lib/libthr/thread/thr_rwlock.c:267
#2  0x00080848ba8b in _pthread_rwlock_wrlock (rwlock=0x80a8ede20) at 
/usr/src/lib/libthr/thread/thr_rwlock.c:289
#3  0x00080911f848 in _citrus_mapper_close (cm=0x80a8bfc40) at 
/usr/src/lib/libc/iconv/citrus_mapper.c:375
#4  0x00080ce02d18 in _citrus_mapper_serial_mapper_uninit (cm=0x80a8bfc00) 
at 
/usr/src/lib/libiconv_modules/mapper_parallel/../mapper_serial/citrus_mapper_serial.c:110
#5  0x00080911f8d7 in mapper_close (cm=0x80a8bfc00) at 
/usr/src/lib/libc/iconv/citrus_mapper.c:188
#6  0x00080911f88c in _citrus_mapper_close (cm=) at 
/usr/src/lib/libc/iconv/citrus_mapper.c:384
#7  0x00080c5893f3 in close_srcs (sl=0x80a8edda0) at 
/usr/src/lib/libiconv_modules/iconv_std/citrus_iconv_std.c:206
#8  0x00080c588dc9 in _citrus_iconv_std_iconv_uninit_shared (ci=) at 
/usr/src/lib/libiconv_modules/iconv_std/citrus_iconv_std.c:415
#9  0x0008090f4f95 in release_shared (ci=0x80b408890) at 
/usr/src/lib/libc/iconv/citrus_iconv.c:99
#10 0x0008090f5002 in _citrus_iconv_close (cv=0x80b782630) at 
/usr/src/lib/libc/iconv/citrus_iconv.c:335
#11 0x0008090f2ca6 in iconv_close (handle=0x80a8ede20) at 
/usr/src/lib/libc/iconv/iconv.c:131
#12 0x0046