#714499 segfault on connexion lost

Package:
irssi-plugin-xmpp
Source:
irssi-plugin-xmpp
Description:
XMPP plugin for irssi
Submitter:
Antoine Beaupré
Date:
2021-01-22 14:06:02 UTC
Severity:
normal
#714499#5
Date:
2013-06-30 00:43:37 UTC
From:
To:
this plugin segfaulted on me. the conditions were an irssi process
with otr, xmpp and proxy modules loaded. my router was rebooted and
the TCP connexion was lost (my guess), and then irssi crashed not much later:

/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd)[0x7f6b57d94ead]
irssi[0x419269]
======= Memory map: ========
00400000-004d2000 r-xp 00000000 fe:02 555278                             /usr/bin/irssi
006d2000-006de000 rw-p 000d2000 fe:02 555278                             /usr/bin/irssi
006de000-006df000 rw-p 00000000 00:00 0
01fe1000-027b4000 rw-p 00000000 00:00 0                                  [heap]
7f6b4c000000-7f6b4c3e4000 rw-p 00000000 00:00 0
7f6b4c3e4000-7f6b50000000 ---p 00000000 00:00 0
7f6b52dbc000-7f6b52dd1000 r-xp 00000000 fe:01 23575                      /lib/x86_64-linux-gnu/libgcc_s.so.1
7f6b52dd1000-7f6b52fd1000 ---p 00015000 fe:01 23575                      /lib/x86_64-linux-gnu/libgcc_s.so.1
7f6b52fd1000-7f6b52fd2000 rw-p 00015000 fe:01 23575                      /lib/x86_64-linux-gnu/libgcc_s.so.1
7f6b52fd2000-7f6b52feb000 r-xp 00000000 fe:02 271841                     /usr/lib/libotr.so.5.0.0
7f6b52feb000-7f6b531ea000 ---p 00019000 fe:02 271841                     /usr/lib/libotr.so.5.0.0
7f6b531ea000-7f6b531eb000 r--p 00018000 fe:02 271841                     /usr/lib/libotr.so.5.0.0
7f6b531eb000-7f6b531ec000 rw-p 00019000 fe:02 271841                     /usr/lib/libotr.so.5.0.0
7f6b531ec000-7f6b531f8000 r-xp 00000000 fe:02 666002                     /usr/lib/irssi/modules/libotr.so
7f6b531f8000-7f6b533f7000 ---p 0000c000 fe:02 666002                     /usr/lib/irssi/modules/libotr.so
7f6b533f7000-7f6b533f8000 r--p 0000b000 fe:02 666002                     /usr/lib/irssi/modules/libotr.so
7f6b533f8000-7f6b533f9000 rw-p 0000c000 fe:02 666002                     /usr/lib/irssi/modules/libotr.so
7f6b533f9000-7f6b533fd000 r-xp 00000000 fe:02 281895                     /usr/lib/perl/5.14.2/auto/IO/IO.so
7f6b533fd000-7f6b535fc000 ---p 00004000 fe:02 281895                     /usr/lib/perl/5.14.2/auto/IO/IO.so
7f6b535fc000-7f6b535fd000 r--p 00003000 fe:02 281895                     /usr/lib/perl/5.14.2/auto/IO/IO.so
7f6b535fd000-7f6b535fe000 rw-p 00004000 fe:02 281895                     /usr/lib/perl/5.14.2/auto/IO/IO.so
7f6b535fe000-7f6b53608000 r-xp 00000000 fe:02 297784                     /usr/lib/perl5/auto/Irssi/TextUI/TextUI.so
7f6b53608000-7f6b53807000 ---p 0000a000 fe:02 297784                     /usr/lib/perl5/auto/Irssi/TextUI/TextUI.so
7f6b53807000-7f6b53808000 rw-p 00009000 fe:02 297784                     /usr/lib/perl5/auto/Irssi/TextUI/TextUI.so
7f6b53808000-7f6b53817000 r-xp 00000000 fe:02 297780                     /usr/lib/perl5/auto/Irssi/Irc/Irc.so
7f6b53817000-7f6b53a17000 ---p 0000f000 fe:02 297780                     /usr/lib/perl5/auto/Irssi/Irc/Irc.so
7f6b53a17000-7f6b53a18000 rw-p 0000f000 fe:02 297780                     /usr/lib/perl5/auto/Irssi/Irc/Irc.so
7f6b53a18000-7f6b53a28000 r-xp 00000000 fe:02 297788                     /usr/lib/perl5/auto/Irssi/UI/UI.so
7f6b53a28000-7f6b53c27000 ---p 00010000 fe:02 297788                     /usr/lib/perl5/auto/Irssi/UI/UI.so
7f6b53c27000-7f6b53c28000 rw-p 0000f000 fe:02 297788                     /usr/lib/perl5/auto/Irssi/UI/UI.so
7f6b53c28000-7f6b53c48000 r-xp 00000000 fe:02 297781                     /usr/lib/perl5/auto/Irssi/Irssi.so
7f6b53c48000-7f6b53e48000 ---p 00020000 fe:02 297781                     /usr/lib/perl5/auto/Irssi/Irssi.so
7f6b53e48000-7f6b53e49000 rw-p 00020000 fe:02 297781                     /usr/lib/perl5/auto/Irssi/Irssi.so
7f6b53e49000-7f6b53e4e000 r-xp 00000000 fe:01 23600                      /lib/x86_64-linux-gnu/libnss_dns-2.13.so
7f6b53e4e000-7f6b5404d000 ---p 00005000 fe:01 23600                      /lib/x86_64-linux-gnu/libnss_dns-2.13.so
7f6b5404d000-7f6b5404e000 r--p 00004000 fe:01 23600                      /lib/x86_64-linux-gnu/libnss_dns-2.13.so
7f6b5404e000-7f6b5404f000 rw-p 00005000 fe:01 23600                      /lib/x86_64-linux-gnu/libnss_dns-2.13.so
7f6b5404f000-7f6b54051000 r-xp 00000000 fe:01 23533                      /lib/libnss_mdns4_minimal.so.2
7f6b54051000-7f6b54250000 ---p 00002000 fe:01 23533                      /lib/libnss_mdns4_minimal.so.2
7f6b54250000-7f6b54251000 rw-p 00001000 fe:01 23533                      /lib/libnss_mdns4_minimal.so.2
7f6b54251000-7f6b54252000 ---p 00000000 00:00 0
7f6b54252000-7f6b54a52000 rw-p 00000000 00:00 0
7f6b54a52000-7f6b54a53000 ---p 00000000 00:00 0
7f6b54a53000-7f6b55253000 rw-p 00000000 00:00 0
7f6b55253000-7f6b55259000 r-xp 00000000 fe:02 687690                     /usr/lib/irssi/modules/libirc_proxy.so
7f6b55259000-7f6b55459000 ---p 00006000 fe:02 687690                     /usr/lib/irssi/modules/libirc_proxy.so
7f6b55459000-7f6b5545a000 rw-p 00006000 fe:02 687690                     /usr/lib/irssi/modules/libirc_proxy.so
7f6b5545a000-7f6b5545c000 r-xp 00000000 fe:02 687694                     /usr/lib/irssi/modules/libtext_xmpp.so
7f6b5545c000-7f6b5565c000 ---p 00002000 fe:02 687694                     /usr/lib/irssi/modules/libtext_xmpp.so
7f6b5565c000-7f6b5565d000 rw-p 00002000 fe:02 687694                     /usr/lib/irssi/modules/libtext_xmpp.so
7f6b5565d000-7f6b5566b000 r-xp 00000000 fe:02 687692                     /usr/lib/irssi/modules/libfe_xmpp.so
7f6b5566b000-7f6b5586a000 ---p 0000e000 fe:02 687692                     /usr/lib/irssi/modules/libfe_xmpp.so
7f6b5586a000-7f6b5586c000 rw-p 0000d000 fe:02 687692                     /usr/lib/irssi/modules/libfe_xmpp.so
7f6b5586c000-7f6b5586f000 r-xp 00000000 fe:01 23735                      /lib/x86_64-linux-gnu/libgpg-error.so.0.8.0
7f6b5586f000-7f6b55a6e000 ---p 00003000 fe:01 23735                      /lib/x86_64-linux-gnu/libgpg-error.so.0.8.0
7f6b55a6e000-7f6b55a6f000 rw-p 00002000 fe:01 23735                      /lib/x86_64-linux-gnu/libgpg-error.so.0.8.0
7f6b55a6f000-7f6b55a80000 r-xp 00000000 fe:02 565485                     /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.0.0
7f6b55a80000-7f6b55c7f000 ---p 00011000 fe:02 565485                     /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.0.0
7f6b55c7f000-7f6b55c80000 r--p 00010000 fe:02 565485                     /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.0.0
7f6b55c80000-7f6b55c81000 rw-p 00011000 fe:02 565485                     /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.0.0
7f6b55c81000-7f6b55cfb000 r-xp 00000000 fe:01 23726    Aborted (core dumped)

Here's the backtrace:

(gdb) bt
#0  0x00007f6b57da8475 in *__GI_raise (sig=<optimized out>)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00007f6b57dab6f0 in *__GI_abort () at abort.c:92
#2  0x00007f6b57de352b in __libc_message (do_abort=<optimized out>,
    fmt=<optimized out>) at ../sysdeps/unix/sysv/linux/libc_fatal.c:189
#3  0x00007f6b57decd76 in malloc_printerr (action=3,
    str=0x7f6b57ec5170 "munmap_chunk(): invalid pointer", ptr=<optimized out>)
    at malloc.c:6283
#4  0x00007f6b55c8ca9e in ?? () from /lib/x86_64-linux-gnu/libgcrypt.so.11
#5  0x00007f6b5613b094 in ?? () from /usr/lib/x86_64-linux-gnu/libgnutls.so.26
#6  0x00007f6b56145645 in ?? () from /usr/lib/x86_64-linux-gnu/libgnutls.so.26
#7  0x00007f6b5614dba4 in gnutls_deinit ()
   from /usr/lib/x86_64-linux-gnu/libgnutls.so.26
#8  0x00007f6b56a2b139 in _lm_ssl_close (ssl=0x26ba6c0) at lm-ssl-gnutls.c:300
#9  0x00007f6b56a25e78 in connection_do_close (connection=0x26bb8a0)
    at lm-connection.c:514
#10 connection_do_close (connection=0x26bb8a0) at lm-connection.c:494
#11 0x00007f6b56a27b32 in lm_connection_close (connection=0x26bb8a0, error=0x0)
    at lm-connection.c:1375
#12 0x00007f6b56c403bd in server_cleanup ()
   from /usr/lib/irssi/modules/libxmpp_core.so
#13 0x000000000048e0ba in ?? ()
#14 0x000000000048e56d in signal_emit ()
---Type <return> to continue, or q <return> to quit---
#15 0x0000000000488ed0 in server_disconnect ()
#16 0x00007f6b56c4c80e in check_ping_func ()
   from /usr/lib/irssi/modules/libxmpp_core.so
#17 0x00007f6b58bd8eeb in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#18 0x00007f6b58bd8355 in g_main_context_dispatch ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#19 0x00007f6b58bd8688 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#20 0x00007f6b58bd8744 in g_main_context_iteration ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#21 0x000000000041905c in main ()
and the plugin is not handling it so crashes.

This is the code where this happens, I believe:

static void
server_cleanup(XMPP_SERVER_REC *server)
{
	if (!IS_XMPP_SERVER(server))
		return;
	if (server->timeout_tag)
		g_source_remove(server->timeout_tag);
	if (lm_connection_get_state(server->lmconn) !=
	    LM_CONNECTION_STATE_CLOSED)
		lm_connection_close(server->lmconn, NULL);
	lm_connection_unref(server->lmconn);
	g_free(server->jid);
	g_free(server->user);
	g_free(server->domain);
	g_free(server->resource);
	g_free(server->ping_id);
}

Some try/catch around this may resolve the issue, but keep in mind
that this function is called from a signal emitted elsewhere
(server_disconnect()) so maybe that's where it should be handled
instead.

#714499#10
Date:
2013-09-24 22:14:51 UTC
From:
To:
Hi Antoine,

maybe you're seeing something that I fail to recognize, but where do you
see the exception from loudmouth? irssi-plugin-xmpp times out in
check_ping_func(), calls server_disconnect() which is in
irssi-0.8.15:src/core/servers.c:489, which calls

    signal_emit("server disconnected", 1, server);

which is irssi's regular way to tell all modules interested in this
event that it has happened. It is handled in many places, both in
irssi-plugin-xmpp and possibly elsewhere, before server_cleanup() gets
it, which was added with signal_add_last(). From there onwards, the
backtrace shows a regular teardown of an xmpp ssl connection, up to the
double-free segfault. So I think this is essentially the same as #499229
or #707758, no?

Sadly, I still have no idea what's corrupting gnutls's / gcrypt's ssl
object, if not otr...

Florian

#714499#17
Date:
2014-03-26 11:55:40 UTC
From:
To:
Hi,

Im not using otr nor a proxy but irssi-plugin-xmpp segfaulted on me on
after a few days. Im trying to get some more information.

Regards,
Martijn van Brummelen

#714499#22
Date:
2018-02-15 09:22:15 UTC
From:
To:
Laba diena,


Noriu Jus informuoti apie šių metų pasikeitimą dėl atnaujintos visos Lietuvos įmonių bazės 2018 metų sausio vidurio.
Visi juridiniai asmenys pateikti bazėje yra veikiantys, realiai vykdantys veiklą, turintys įdarbintų darbuotojų. Duomenys pagal Sodrą, Registrų centrą.

Bazėje nurodoma ir apyvarta, darbuotojų atlyginimai, darbuotojų skaičius, transporto skaičius ir daug kitų duomenų, kuriuos matysite pavyzdyje.

Duomenis galima filtruoti pagal veiklas, miestus ir kitus duomenis.


Šią bazę verta turėti visoms įmonėms. Pateiksiu priežastis:

1) Kontaktai pateikti bazėje direktorių ir kitų atsakingų asmenų, didelė tikimybė Jums surasti naujų klientų, partnerių, tiekėjų, kai tiesiogiai bendrausite su direktoriais, komercijos vadovais.

2) Konkurentų analizavimas, tiekėjų atsirinkimas pagal Jums reikalingus kriterijus, galite atsifiltruoti pagal įmonės dydį, bazėje nurodoma kiek įmonės skolingos Sodrai.

3) Lengva, greita ir patogu dirbti su šia baze, elektroninius pašto adresus galite importuoti į elektroninių laiškų siuntimo programas ar sistemas iš kurių siunčiate elektroninius laiškus.
Taip pat galite importuoti mobiliųjų telefonų numerius į SMS siuntimo programas.


Išsirinkite iš "Veiklų sąrašo" veiklas kurių Jums reikia.
( Sąrašas prisegtas laiške excel faile )

Parašykite, kurias veiklas išsirinkote
ir atsiųsime pavyzdį ir pasiūlymą su sąlygomis įmonių bazei įsigyti



Pagarbiai,
Tadas Giedraitis
Tel. nr. +37067881041

#714499#27
Date:
2021-01-22 14:02:48 UTC
From:
To:
Something like this landed upstream as part of
https://github.com/cdidier/irssi-xmpp/commit/5cc5fea5970fe19e1a3a2a1b6cb4b7436cc813fd
If that's where the problem was, it should be fixed as of
irssi-plugin-xmpp 0.54+git20191101+c13fa5-1

Florian