tags 707758 + confirmed
block 707758 376463
block 714499 376463
thanks

On Fri, May 10, 2013 at 07:32:12PM -0400, Antoine Beaupré wrote:
> You need to successfully authenticate against a server, then /load
> otr, then /quit.
> 
> Here's a gdb backtrace, notice how the debugging symbols don't seem to load 
> properly:
> 
> warning: 
> "/usr/lib/debug/.build-id/1f/7c15953b6cc4fd3351a760e909e55291de093a.debug": 
> separate debug info file has no debug info
> 
> warning: 
> "/usr/lib/debug/.build-id/34/f0ef4dae462d0c77467e0b7a70418967b2f6d2.debug": 
> separate debug info file has no debug info
> 
> warning: 
> "/usr/lib/debug/.build-id/83/71de0e29582dd873bc1942962ce76a64ac3f71.debug": 
> separate debug info file has no debug info
> Core was generated by `irssi --config=.irssi/config.proxy'.
> Program terminated with signal 6, Aborted.
> #0  0x00007f2b58758475 in *__GI_raise (sig=<optimized out>) at 
> ../nptl/sysdeps/unix/sysv/linux/raise.c:64
> 64      ../nptl/sysdeps/unix/sysv/linux/raise.c: Aucun fichier ou dossier de 
> ce type.
> (gdb) bt
> #0  0x00007f2b58758475 in *__GI_raise (sig=<optimized out>) at 
> ../nptl/sysdeps/unix/sysv/linux/raise.c:64
> #1  0x00007f2b5875b6f0 in *__GI_abort () at abort.c:92
> #2  0x00007f2b5879352b in __libc_message (do_abort=<optimized out>, 
> fmt=<optimized out>) at ../sysdeps/unix/sysv/linux/libc_fatal.c:189
> #3  0x00007f2b5879cd76 in malloc_printerr (action=3, str=0x7f2b58871b9c 
> "free(): invalid pointer", ptr=<optimized out>) at malloc.c:6283
> #4  0x00007f2b587a1aac in *__GI___libc_free (mem=<optimized out>) at 
> malloc.c:3738
> #5  0x00007f2b568d2a9e in ?? () from /lib/x86_64-linux-gnu/libgcrypt.so.11
> #6  0x00007f2b56d81064 in ?? () from /usr/lib/x86_64-linux-gnu/libgnutls.so.26
> #7  0x00007f2b56d8b615 in ?? () from /usr/lib/x86_64-linux-gnu/libgnutls.so.26
> #8  0x00007f2b56d93b74 in gnutls_deinit () from 
> /usr/lib/x86_64-linux-gnu/libgnutls.so.26
> #9  0x00007f2b57671139 in _lm_ssl_close (ssl=0x1220620) at lm-ssl-gnutls.c:300
> #10 0x00007f2b5766be78 in connection_do_close (connection=0x1225a40) at 
> lm-connection.c:514
> #11 connection_do_close (connection=0x1225a40) at lm-connection.c:494
> #12 0x00007f2b5766db32 in lm_connection_close (connection=0x1225a40, 
> error=0x0) at lm-connection.c:1375
> #13 0x00007f2b578863bd in server_cleanup () from 
> /usr/lib/irssi/modules/libxmpp_core.so
> #14 0x000000000048e0ba in ?? ()
> #15 0x000000000048e56d in signal_emit ()
> #16 0x0000000000488ed0 in server_disconnect ()
> #17 0x0000000000490645 in ?? ()
> #18 0x0000000000490c84 in ?? ()
> #19 0x000000000048e0ba in ?? ()
> #20 0x000000000048e56d in signal_emit ()
> #21 0x000000000047a36e in ?? ()
> #22 0x000000000048e0ba in ?? ()
> #23 0x000000000048e56d in signal_emit ()
> #24 0x000000000041c37b in ?? ()
> #25 0x000000000048e0ba in ?? ()
> #26 0x000000000048e56d in signal_emit ()
> #27 0x000000000044e9e7 in ?? ()
> #28 0x000000000048e0ba in ?? ()
> #29 0x000000000048e56d in signal_emit ()
> #30 0x000000000044f3b3 in key_pressed ()
> #31 0x000000000041bc2e in ?? ()
> #32 0x000000000048e0ba in ?? ()
> #33 0x000000000048e56d in signal_emit ()
> #34 0x000000000041d05e in ?? ()
> #35 0x0000000000480f99 in ?? ()
> #36 0x00007f2b59588355 in g_main_context_dispatch () from 
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #37 0x00007f2b59588688 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #38 0x00007f2b59588744 in g_main_context_iteration () from 
> /lib/x86_64-linux-gnu/libglib-2.0.so.0
> #39 0x000000000041905c in main ()

In my reading, this is just a regular shutdown of an xmpp connection
over ssl, which works in the normal case but leads to a segfault when
the otr module (irssi-plugin-otr) is loaded as well.

With a few more debugging symbols, the first few lines of the backtrace
look like this:

#0  0x00007f825cec11e5 in __GI_raise (sig=sig@entry=6) at 
../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007f825cec4398 in __GI_abort () at abort.c:90
#2  0x00007f825cefc7cb in __libc_message (do_abort=do_abort@entry=2, 
fmt=fmt@entry=0x7f825cff8be8 "*** Error in `%s': %s: 0x%s ***\n") at 
../sysdeps/unix/sysv/linux/libc_fatal.c:199
#3  0x00007f825cf06a26 in malloc_printerr (action=3, str=0x7f825cff4b8a 
"free(): invalid pointer", ptr=<optimized out>) at malloc.c:4902
#4  0x00007f825cf077a3 in _int_free (av=<optimized out>, p=0x25eb5c8, 
have_lock=0) at malloc.c:3758
#5  0x00007f825b666ea6 in _gcry_free (p=0x25eb5e0) at global.c:879
#6  0x00007f825b904bf4 in _gnutls_cipher_deinit (handle=handle@entry=0x25e1208) 
at gnutls_cipher_int.c:147
#7  0x00007f825b90f1b5 in free_record_state (read=1, state=0x25e11d8) at 
gnutls_constate.c:786
#8  _gnutls_epoch_free (session=<optimized out>, params=0x25e11c0) at 
gnutls_constate.c:797
#9  0x00007f825b917704 in gnutls_deinit (session=0x25e3a20) at 
gnutls_state.c:399
#10 0x00007f825c40d139 in _lm_ssl_close (ssl=0x22e7ec0) at lm-ssl-gnutls.c:300
#11 0x00007f825c407e78 in connection_do_close (connection=0x22e8b30) at 
lm-connection.c:514
#12 connection_do_close (connection=0x22e8b30) at lm-connection.c:494
#13 0x00007f825c409b32 in lm_connection_close (connection=0x22e8b30, 
error=error@entry=0x0) at lm-connection.c:1375
#14 0x00007f825c621ffb in server_cleanup (server=0x22ed670) at 
xmpp-servers.c:102
#15 0x00000000004879e2 in ?? ()
#16 0x0000000000487e4d in signal_emit ()
#17 0x0000000000482a9e in server_disconnect ()


When running under valgrind, the valgrind log shows libotr doing a few
invalid reads/writes just there, so I thought maybe it hooks into
gnutls/gcrypt and wrecks havock there:

==10086== Invalid read of size 8
==10086==    at 0xDD5BCE5: ??? (in /usr/lib/libotr.so.5.0.0)
==10086==    by 0x8C1FEA5: _gcry_free (in 
/lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==10086==    by 0x897FBF3: _gnutls_cipher_deinit (gnutls_cipher_int.c:147)
==10086==    by 0x898A1B4: _gnutls_epoch_free (gnutls_constate.c:786)
==10086==    by 0x8992703: gnutls_deinit (gnutls_state.c:399)
==10086==    by 0x7EE3138: _lm_ssl_close (lm-ssl-gnutls.c:300)
==10086==    by 0x7EDDE77: connection_do_close (lm-connection.c:514)
==10086==    by 0x7EDFB31: lm_connection_close (lm-connection.c:1375)
==10086==    by 0x7CC5FFA: server_cleanup (in 
/usr/lib/irssi/modules/libxmpp_core.so)
==10086==    by 0x4879E1: ??? (in /usr/bin/irssi)
==10086==    by 0x487E4C: signal_emit (in /usr/bin/irssi)
==10086==    by 0x482A9D: server_disconnect (in /usr/bin/irssi)
==10086==  Address 0xb70a9e8 is 8 bytes before a block of size 1,167 alloc'd
==10086==    at 0x4C2935B: malloc (vg_replace_malloc.c:270)
==10086==    by 0x8C1F0F0: do_malloc.constprop.4 (in 
/lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==10086==    by 0x8C1FF96: _gcry_calloc (in 
/lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==10086==    by 0x8C27EB6: _gcry_cipher_open (in 
/lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==10086==    by 0x89EE663: wrap_gcry_cipher_init (cipher.c:46)
==10086==    by 0x897FA0E: _gnutls_cipher_init (gnutls_cipher_int.c:64)
==10086==    by 0x89898BD: _gnutls_init_record_state.isra.2 
(gnutls_constate.c:299)
==10086==    by 0x8989D6D: _gnutls_epoch_set_keys (gnutls_constate.c:431)
==10086==    by 0x898A37D: _gnutls_write_connection_state_init 
(gnutls_constate.c:602)
==10086==    by 0x89754C3: _gnutls_send_handshake_final 
(gnutls_handshake.c:2888)
==10086==    by 0x897841B: _gnutls_handshake_common (gnutls_handshake.c:3121)
==10086==    by 0x8979BC9: gnutls_handshake (gnutls_handshake.c:2690)
==10086==
==10086== Invalid write of size 4
==10086==    at 0x4C2EBEF: memset (mc_replace_strmem.c:1007)
==10086==    by 0xDD5BCF2: ??? (in /usr/lib/libotr.so.5.0.0)
==10086==    by 0x8C1FEA5: _gcry_free (in 
/lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==10086==    by 0x897FBF3: _gnutls_cipher_deinit (gnutls_cipher_int.c:147)
==10086==    by 0x898A1B4: _gnutls_epoch_free (gnutls_constate.c:786)
==10086==    by 0x8992703: gnutls_deinit (gnutls_state.c:399)
==10086==    by 0x7EE3138: _lm_ssl_close (lm-ssl-gnutls.c:300)
==10086==    by 0x7EDDE77: connection_do_close (lm-connection.c:514)
==10086==    by 0x7EDFB31: lm_connection_close (lm-connection.c:1375)
==10086==    by 0x7CC5FFA: server_cleanup (in 
/usr/lib/irssi/modules/libxmpp_core.so)
==10086==    by 0x4879E1: ??? (in /usr/bin/irssi)
==10086==    by 0x487E4C: signal_emit (in /usr/bin/irssi)
==10086==  Address 0xb70a9e8 is 8 bytes before a block of size 1,167 alloc'd
==10086==    at 0x4C2935B: malloc (vg_replace_malloc.c:270)
==10086==    by 0x8C1F0F0: do_malloc.constprop.4 (in 
/lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==10086==    by 0x8C1FF96: _gcry_calloc (in 
/lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==10086==    by 0x8C27EB6: _gcry_cipher_open (in 
/lib/x86_64-linux-gnu/libgcrypt.so.11.8.2)
==10086==    by 0x89EE663: wrap_gcry_cipher_init (cipher.c:46)
==10086==    by 0x897FA0E: _gnutls_cipher_init (gnutls_cipher_int.c:64)
==10086==    by 0x89898BD: _gnutls_init_record_state.isra.2 
(gnutls_constate.c:299)
==10086==    by 0x8989D6D: _gnutls_epoch_set_keys (gnutls_constate.c:431)
==10086==    by 0x898A37D: _gnutls_write_connection_state_init 
(gnutls_constate.c:602)
==10086==    by 0x89754C3: _gnutls_send_handshake_final 
(gnutls_handshake.c:2888)
==10086==    by 0x897841B: _gnutls_handshake_common (gnutls_handshake.c:3121)
==10086==    by 0x8979BC9: gnutls_handshake (gnutls_handshake.c:2690)


But just now I found #376463, especially Message #10:

On 7/3/06, Ian Goldberg <i...@cypherpunks.ca> wrote:
> This is a known problem; it occurs when you've got another plugin active
> that also uses libgcrypt.  libgcrypt keeps global state, and has no way
> to gracefully handle being initialized and removed by two separate
> shared objects.  Over on the libgcrypt list, they were talking about how
> to fix this a little while back.

Since irssi-plugin-otr is using libgcrypt, and irssi-plugin-xmpp is
using loudmouth which is using gnutls for ssl connections which is using
libgcrypt, I think we can conclude that until #376463 is fixed, using
jabber-over-ssl together with otr in irssi is just not possible.

Florian


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to