#985688 chatty: segfault when syncing history with certain accounts

Package:
chatty
Source:
chatty
Description:
XMPP and SMS messaging
Submitter:
Vagrant Cascadian
Date:
2021-03-23 07:57:02 UTC
Severity:
normal
#985688#5
Date:
2021-03-22 06:06:53 UTC
From:
To:
I used chatty for a bit with a newly created xmpp account, and it seemed
to work nicely with some basic testing.

When I added an xmpp account I had used with other clients (e.g. gajim
and conversations), chatty started crashing, unless I disable "Message
Archive Management". Then everything seems to mostly work fine, other
than the full history obviously being missing...

However, another similar account on the same server works fine. A
notable difference between the accounts is that the working account
doesn't have much (if any) history of using omemo, and the failing
account is using omemo almost exclusively. Another difference is the
failing account is subscribed to a MUC.

I don't know how to reproduce this with a newly created account; e.g. so
far it only fails on one specific account with all my history. History
that would be impractical to share...



$ chatty

(sm.puri.Chatty:3457658): chatty-folks-WARNING **: 22:40:08.405: Error:
Error calling StartServiceByName for
org.gnome.evolution.dataserver.Sources5: Unit
evolution-source-registry.service not found.

** (sm.puri.Chatty:3457658): CRITICAL **: 22:40:08.523:
   purple_presence_is_online: assertion 'presence != NULL' failed

** (sm.puri.Chatty:3457658): CRITICAL **: 22:40:08.526:
   purple_presence_is_online: assertion 'presence != NULL' failed

** (sm.puri.Chatty:3457658): CRITICAL **: 22:40:08.526:
   purple_presence_get_active_status: assertion 'presence != NULL'
   failed

** (sm.puri.Chatty:3457658): CRITICAL **: 22:40:08.526:
   purple_status_is_available: assertion 'status != NULL' failed

** (sm.puri.Chatty:3457658): CRITICAL **: 22:40:08.576:
   purple_presence_get_active_status: assertion 'presence != NULL'
   failed

** (sm.puri.Chatty:3457658): CRITICAL **: 22:40:09.450:
   xmlnode_set_attrib_full: assertion 'value != NULL' failed

** (sm.puri.Chatty:3457658): CRITICAL **: 22:40:09.451:
   purple_find_conversation_with_account: assertion 'name != NULL'
   failed

** (sm.puri.Chatty:3457658): CRITICAL **: 22:40:09.451:
   purple_conversation_new: assertion 'name != NULL' failed
Segmentation fault


Thanks for maintaining chatty!


live well,
  vagrant

#985688#10
Date:
2021-03-22 07:36:16 UTC
From:
To:
Hi,

Could you provide a gdb backtrace with debugging symbols?

Cheers,
 -- Guido

#985688#15
Date:
2021-03-22 20:46:24 UTC
From:
To:
Hopefully this is what you were looking for (swapped out my client with
USERNAME@EXAMPLE and the connection to a multi-user-chat with
MUC@EXAMPLE):

(gdb) r
Starting program: /usr/bin/chatty
[Thread debugging using libthread_db enabled]
Using host libthread_db library
"/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff1272700 (LWP 3560323)]
[New Thread 0x7ffff0a71700 (LWP 3560324)]
[New Thread 0x7fffebfff700 (LWP 3560325)]
[New Thread 0x7fffeb7fe700 (LWP 3560326)]
[New Thread 0x7fffeaffd700 (LWP 3560327)]
[New Thread 0x7fffea7fc700 (LWP 3560328)]
[New Thread 0x7fffe9ffb700 (LWP 3560329)]

(sm.puri.Chatty:3560301): chatty-folks-WARNING **: 13:38:26.372: Error:
Error calling StartServiceByName for
org.gnome.evolution.dataserver.Sources5: Unit
evolution-source-registry.service not found.
[Thread 0x7fffeaffd700 (LWP 3560327) exited]
[Thread 0x7fffea7fc700 (LWP 3560328) exited]
[New Thread 0x7fffea7fc700 (LWP 3560330)]
[New Thread 0x7fffeaffd700 (LWP 3560331)]
[New Thread 0x7fffbfe85700 (LWP 3560332)]

** (sm.puri.Chatty:3560301): CRITICAL **: 13:38:27.041:
   purple_presence_get_active_status: assertion 'presence != NULL'
   failed

** (sm.puri.Chatty:3560301): CRITICAL **: 13:38:27.041:
   purple_status_is_available: assertion 'status != NULL' failed
[Detaching after fork from child process 3560333]

** (sm.puri.Chatty:3560301): CRITICAL **: 13:38:27.043:
   purple_presence_get_active_status: assertion 'presence != NULL'
   failed

** (sm.puri.Chatty:3560301): CRITICAL **: 13:38:27.047:
   purple_presence_is_online: assertion 'presence != NULL' failed

** (sm.puri.Chatty:3560301): CRITICAL **: 13:38:27.054:
   purple_presence_is_online: assertion 'presence != NULL' failed
[Detaching after fork from child process 3560334]
[Detaching after fork from child process 3560353]

** (sm.puri.Chatty:3560301): CRITICAL **: 13:38:28.063:
   xmlnode_set_attrib_full: assertion 'value != NULL' failed

** (sm.puri.Chatty:3560301): CRITICAL **: 13:38:28.063:
   purple_find_conversation_with_account: assertion 'name != NULL'
   failed

** (sm.puri.Chatty:3560301): CRITICAL **: 13:38:28.063:
   purple_conversation_new: assertion 'name != NULL' failed

Thread 1 "chatty" received signal SIGSEGV, Segmentation fault.
cb_chatty_mam_msg_received (pc=<optimized out>, type=<optimized out>,
id=<optimized out>, from=<optimized out>,
    to=<optimized out>, msg=<optimized out>) at
    ../src/xeps/chatty-xep-0313.c:800
800     ../src/xeps/chatty-xep-0313.c: No such file or directory.
(gdb) bt
#0  cb_chatty_mam_msg_received (pc=<optimized out>, type=<optimized
out>, id=<optimized out>, from=<optimized out>,
    to=<optimized out>, msg=<optimized out>) at
    ../src/xeps/chatty-xep-0313.c:800
#1  0x00007ffff71351b4 in
purple_marshal_BOOLEAN__POINTER_POINTER_POINTER_POINTER_POINTER_POINTER
(
    cb=<optimized out>, args=<optimized out>, data=<optimized out>,
    return_val=0x7fffffffdb28)
    at ././libpurple/signals.c:1019
#2  0x00007ffff7133e05 in purple_signal_emit_vargs_return_1
(instance=<optimized out>, signal=0x7fffffffdb28 "",
    signal@entry=0x7ffff70818c2 "jabber-receiving-message",
    args=args@entry=0x7fffffffdb80)
    at ././libpurple/signals.c:563
#3  0x00007ffff7133f6e in purple_signal_emit_return_1
(instance=<optimized out>,
    signal=signal@entry=0x7ffff70818c2 "jabber-receiving-message") at
    ././libpurple/signals.c:506
#4  0x00007ffff706f1f4 in jabber_message_parse (js=0x555555c97ee0,
packet=0x5555556a34b0)
    at ././libpurple/protocols/jabber/message.c:530
#5  0x00007ffff7071794 in jabber_parser_element_end_libxml
(user_data=0x555555c97ee0, element_name=<optimized out>,
    prefix=<optimized out>, namespace=<optimized out>) at
    ././libpurple/protocols/jabber/parser.c:169
#6  0x00007ffff59174d7 in xmlParseEndTag2 (ctxt=0x555555d8e3d0,
prefix=0x0, URI=0x555555d8fe14 "jabber:client",
    nsNr=0, tlen=0, line=<optimized out>) at ../../parser.c:9690
#7  0x00007ffff5921ed9 in xmlParseTryOrFinish
(ctxt=ctxt@entry=0x555555d8e3d0, terminate=terminate@entry=0)
    at ../../parser.c:11568
#8  0x00007ffff5923138 in xmlParseChunk__internal_alias
(ctxt=0x555555d8e3d0,
    chunk=0x7ffff7098b00 <buf> "rplebfa0ca76'><forwarded
    xmlns='urn:xmpp:forward:0'><delay xmlns='urn:xmpp:delay'
    stamp='2021-03-20T17:49:36Z'/><message id='U02X4-93678'
    to='USERNAME@EXAMPLE.COM/SOMECLIENT from='MUC@EXAMPLE.ORG"...,
    size=<optimized out>, terminate=terminate@entry=0) at
    ../../parser.c:12281
#9  0x00007ffff7071c5e in jabber_parser_process (js=0x555555c97ee0,
buf=<optimized out>, len=<optimized out>)
    at ././libpurple/protocols/jabber/parser.c:279
#10 0x00007ffff7060a3a in jabber_recv_cb_ssl (data=0x555555c979f0,
gsc=0x555555d39190, cond=<optimized out>)
    at ././libpurple/protocols/jabber/jabber.c:694
#11 0x000055555556f502 in purple_glib_io_invoke (source=<optimized out>,
condition=<optimized out>,
    data=0x555555699940) at ../src/chatty-manager.c:299
#12 0x00007ffff7c9bd6f in g_main_dispatch (context=0x5555556375d0) at
../../../glib/gmain.c:3325
#13 g_main_context_dispatch (context=0x5555556375d0) at
../../../glib/gmain.c:4043
--Type <RET> for more, q to quit, c to continue without paging--
#14 0x00007ffff7c9c118 in g_main_context_iterate
(context=context@entry=0x5555556375d0, block=block@entry=1,
    dispatch=dispatch@entry=1, self=<optimized out>) at
    ../../../glib/gmain.c:4119
#15 0x00007ffff7c9c1cf in g_main_context_iteration
(context=context@entry=0x5555556375d0, may_block=may_block@entry=1)
    at ../../../glib/gmain.c:4184
#16 0x00007ffff7eb2545 in g_application_run (application=0x555555636100,
argc=-7756, argc@entry=1,
    argv=argv@entry=0x7fffffffe318) at ../../../gio/gapplication.c:2559
#17 0x000055555556c17f in main (argc=1, argv=0x7fffffffe318) at
../src/main.c:28

#985688#20
Date:
2021-03-22 21:21:18 UTC
From:
To:
The MUC is discuss@conference.soprani.ca, and someone else on that MUC
was unable to add it in chatty, so maybe there's some safeguard in
chatty to prevent incompatible JID/MUC? Since I had added the MUC with
another client chatty is blindly trying to sync when MAM is enabled?



live well,
  vagrant

#985688#25
Date:
2021-03-23 07:52:33 UTC
From:
To:
control: forwarded -1 https://source.puri.sm/Librem5/chatty/-/issues/490

Hi Vagrant,

That's it. Forwarded to

https://source.puri.sm/Librem5/chatty/-/issues/490

Thanks,
 -- Guido