xmpp: segmentation fault on sending an encrypted message OMEMO
Chatty has a segmentation fault while trying to send an encrypted message.
In this case the chat was initiated and originally encrypted in another client. The conversation was marked in chatty as encrypted.
Chatty version installed on desktop: chatty v0.2.0-104-g00297d8
Lurch version same as the Librem 5 Amber-phone:
purple-lurch/now 1:0.6.8+git20200527.388605-0pureos1 amd64 [installed,local]
XEP-0384 OMEMO Encryption plugin for libpurple
Images from the details window of the chat in question:
And from the text imput field when sending the message and getting segmentation fault, you can see from the icon it is supposed to be encrypted.
backtraces:
[Detaching after fork from child process 33283]
[Detaching after fork from child process 33284]
[Thread 0x7fffeda02700 (LWP 33268) exited]
Thread 1 "chatty" received signal SIGSEGV, Segmentation fault.
0x00007ffff6c0b804 in aes_encrypt () from /lib/x86_64-linux-gnu/libolm.so.3
(gdb) where
#0 0x00007ffff6c0b804 in aes_encrypt () at /lib/x86_64-linux-gnu/libolm.so.3
#1 0x00007fffcad796f4 in session_cipher_encrypt () at /lib/x86_64-linux-gnu/libsignal-protocol-c.so.2.3.2
#2 0x00007fffcadbae9e in axc_message_encrypt_and_serialize () at /lib/x86_64-linux-gnu/libaxc.so.0
#3 0x00007fffec0416e6 in () at /usr/lib/purple-2/lurch.so
#4 0x00007fffec041847 in () at /usr/lib/purple-2/lurch.so
#5 0x00007fffec0432d7 in () at /usr/lib/purple-2/lurch.so
#6 0x00007fffec0436ec in () at /usr/lib/purple-2/lurch.so
#7 0x00007ffff723547a in purple_signal_emit_vargs () at /lib/libpurple.so.0
#8 0x00007ffff72355ee in purple_signal_emit () at /lib/libpurple.so.0
#9 0x00007ffff7164772 in jabber_send () at /usr/lib/purple-2/libjabber.so.0
#10 0x00007ffff7175df9 in jabber_message_send () at /usr/lib/purple-2/libjabber.so.0
#11 0x00007ffff7176031 in jabber_message_send_im () at /usr/lib/purple-2/libjabber.so.0
#12 0x00007ffff7233258 in serv_send_im () at /lib/libpurple.so.0
#13 0x00007ffff71ff506 in () at /lib/libpurple.so.0
#14 0x0000555555575253 in chat_view_send_message_button_clicked_cb (self=0x55555597c7c0) at ../src/chatty-chat-view.c:720
#15 0x00005555555753f8 in chat_view_input_key_pressed_cb (self=0x55555597c7c0, event_key=0x7fffd801aef0) at ../src/chatty-chat-view.c:745
#16 0x00007ffff794d17b in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#17 0x00007ffff7da2c8d in g_closure_invoke () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#18 0x00007ffff7db6365 in () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#19 0x00007ffff7dbe9ab in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#20 0x00007ffff7dbf97f in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#21 0x00007ffff78fb324 in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#22 0x00007ffff791b91b in gtk_window_propagate_key_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#23 0x00007ffff791f42b in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#24 0x00007ffff794d274 in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
--Type <RET> for more, q to quit, c to continue without paging--
#25 0x00007ffff7da2ec6 in () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#26 0x00007ffff7dbed74 in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#27 0x00007ffff7dbf97f in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#28 0x00007ffff78fb324 in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#29 0x00007ffff77bba3f in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#30 0x00007ffff77bda83 in gtk_main_do_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#31 0x00007ffff74bf465 in () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#32 0x00007ffff751a5b2 in () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#33 0x00007ffff7cc0f2e in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#34 0x00007ffff7cc11c8 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#35 0x00007ffff7cc125c in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#36 0x00007ffff7eb3a2d in g_application_run () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#37 0x0000555555572f7b in main (argc=1, argv=0x7fffffffe138) at ../src/main.c:28
(gdb) thread apply all bt full
Thread 10 (Thread 0x7fffc86a2700 (LWP 33273)):
#0 0x00007ffff6719819 in __GI___poll (fds=0x555556b44130, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
resultvar = 18446744073709551100
sc_cancel_oldtype = 0
#1 0x00007ffff7cc1136 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x00007ffff7cc14c2 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x00007ffff6d81f33 in () at /lib/x86_64-linux-gnu/libebook-1.2.so.19
#4 0x00007ffff7ce9415 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5 0x00007ffff6145fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
ret = <optimized out>
pd = <optimized out>
now = <optimized out>
unwind_buf =
{cancel_jmp_buf = {{jmp_buf = {140736555788032, 1106362308546632344, 140737488345870, 140737488345871, 140736555788032, 93825015235072, -1106471002280453480, -1106343439661819240}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = <optimized out>
#6 0x00007ffff67244cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Thread 9 (Thread 0x7fffeea04700 (LWP 33271)):
#0 0x00007ffff671c037 in __GI___select (nfds=16, readfds=0x7fffeea037b0, writefds=0x7fffeea03830, exceptfds=0x7fffeea038b0, timeout=0x0)
at ../sysdeps/unix/sysv/linux/select.c:41
resultvar = 18446744073709551102
sc_cancel_oldtype = 0
#1 0x00007fffcb2d2c1a in () at /lib/x86_64-linux-gnu/libtcl8.6.so
--Type <RET> for more, q to quit, c to continue without paging--
#2 0x00007ffff6145fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
ret = <optimized out>
pd = <optimized out>
now = <optimized out>
unwind_buf =
{cancel_jmp_buf = {{jmp_buf = {140737196869376, 1106362308546632344, 140737488343374, 140737488343375, 140737196869376, 93824993606128, -1106394673195410792, -1106343439661819240}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = <optimized out>
#3 0x00007ffff67244cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Thread 8 (Thread 0x7fffecec6700 (LWP 33270)):
#0 0x00007ffff671ef59 in syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1 0x00007ffff7d0af9f in g_cond_wait () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x00007ffff7c930ab in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x00007ffff7c934d7 in g_async_queue_pop () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4 0x00005555555c041e in chatty_history_worker (user_data=0x55555576f1c0) at ../src/chatty-history.c:2424
self = 0x55555576f1c0
task = 0x555555ac6350
__func__ = "chatty_history_worker"
#5 0x00007ffff7ce9415 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6 0x00007ffff6145fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
ret = <optimized out>
pd = <optimized out>
now = <optimized out>
unwind_buf =
--Type <RET> for more, q to quit, c to continue without paging--
{cancel_jmp_buf = {{jmp_buf = {140737168303872, 1106362308546632344, 140737488345022, 140737488345023, 140737168303872, 93824994439616, -1106390787323749736, -1106343439661819240}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = <optimized out>
#7 0x00007ffff67244cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Thread 6 (Thread 0x7fffee203700 (LWP 33267)):
#0 0x00007ffff6719819 in __GI___poll (fds=0x7fffdc0992c0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
resultvar = 18446744073709551100
sc_cancel_oldtype = 0
#1 0x00007ffff7cc1136 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x00007ffff7cc14c2 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x00007ffff6eaf731 in () at /lib/x86_64-linux-gnu/libedataserver-1.2.so.23
#4 0x00007ffff7ce9415 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5 0x00007ffff6145fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
ret = <optimized out>
pd = <optimized out>
now = <optimized out>
unwind_buf =
{cancel_jmp_buf = {{jmp_buf = {140737188476672, 1106362308546632344, 140737196865358, 140737196865359, 140737188476672, 140737018619520, -1106395772170167656, -1106343439661819240}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = <optimized out>
#6 0x00007ffff67244cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Thread 4 (Thread 0x7fffef205700 (LWP 33265)):
#0 0x00007ffff6719819 in __GI___poll (fds=0x5555556a2380, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
--Type <RET> for more, q to quit, c to continue without paging--
resultvar = 18446744073709551100
sc_cancel_oldtype = 0
#1 0x00007ffff7cc1136 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x00007ffff7cc125c in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x00007ffff7fc4ffd in () at /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so
#4 0x00007ffff7ce9415 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5 0x00007ffff6145fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
ret = <optimized out>
pd = <optimized out>
now = <optimized out>
unwind_buf =
{cancel_jmp_buf = {{jmp_buf = {140737205262080, 1106362308546632344, 140737488341230, 140737488341231, 140737205262080, 93824993600672, -1106397967972197736, -1106343439661819240}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = <optimized out>
#6 0x00007ffff67244cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Thread 3 (Thread 0x7fffefa63700 (LWP 33264)):
#0 0x00007ffff6719819 in __GI___poll (fds=0x7fffe001fac0, nfds=3, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
resultvar = 18446744073709551100
sc_cancel_oldtype = 0
#1 0x00007ffff7cc1136 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x00007ffff7cc14c2 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x00007ffff7eed266 in () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#4 0x00007ffff7ce9415 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5 0x00007ffff6145fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
--Type <RET> for more, q to quit, c to continue without paging--
ret = <optimized out>
pd = <optimized out>
now = <optimized out>
unwind_buf =
{cancel_jmp_buf = {{jmp_buf = {140737214035712, 1106362308546632344, 140737488346046, 140737488346047, 140737214035712, 93824993522528, -1106396888861664616, -1106343439661819240}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = <optimized out>
#6 0x00007ffff67244cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Thread 2 (Thread 0x7ffff0264700 (LWP 33263)):
#0 0x00007ffff6719819 in __GI___poll (fds=0x5555556384f0, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
resultvar = 18446744073709551100
sc_cancel_oldtype = 0
#1 0x00007ffff7cc1136 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x00007ffff7cc125c in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3 0x00007ffff7cc12a1 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#4 0x00007ffff7ce9415 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#5 0x00007ffff6145fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
ret = <optimized out>
pd = <optimized out>
now = <optimized out>
unwind_buf =
{cancel_jmp_buf = {{jmp_buf = {140737222428416, 1106362308546632344, 140737488345646, 140737488345647, 140737222428416, 0, -1106347411375285608, -1106343439661819240}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
not_first_call = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--
#6 0x00007ffff67244cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Thread 1 (Thread 0x7ffff054fcc0 (LWP 33259)):
#0 0x00007ffff6c0b804 in aes_encrypt () at /lib/x86_64-linux-gnu/libolm.so.3
#1 0x00007fffcad796f4 in session_cipher_encrypt () at /lib/x86_64-linux-gnu/libsignal-protocol-c.so.2.3.2
#2 0x00007fffcadbae9e in axc_message_encrypt_and_serialize () at /lib/x86_64-linux-gnu/libaxc.so.0
#3 0x00007fffec0416e6 in () at /usr/lib/purple-2/lurch.so
#4 0x00007fffec041847 in () at /usr/lib/purple-2/lurch.so
#5 0x00007fffec0432d7 in () at /usr/lib/purple-2/lurch.so
#6 0x00007fffec0436ec in () at /usr/lib/purple-2/lurch.so
#7 0x00007ffff723547a in purple_signal_emit_vargs () at /lib/libpurple.so.0
#8 0x00007ffff72355ee in purple_signal_emit () at /lib/libpurple.so.0
#9 0x00007ffff7164772 in jabber_send () at /usr/lib/purple-2/libjabber.so.0
#10 0x00007ffff7175df9 in jabber_message_send () at /usr/lib/purple-2/libjabber.so.0
#11 0x00007ffff7176031 in jabber_message_send_im () at /usr/lib/purple-2/libjabber.so.0
#12 0x00007ffff7233258 in serv_send_im () at /lib/libpurple.so.0
#13 0x00007ffff71ff506 in () at /lib/libpurple.so.0
#14 0x0000555555575253 in chat_view_send_message_button_clicked_cb (self=0x55555597c7c0) at ../src/chatty-chat-view.c:720
escaped = 0x555555b22db0 "another stupid test with OMEMO"
protocol = CHATTY_PROTOCOL_XMPP
conv = 0x555555aeee30
account = 0x555555a2ab50
start =
{dummy1 = 0x7fffd80286c0, dummy2 = 0x555555acbef0, dummy3 = -1, dummy4 = 0, dummy5 = 0, dummy6 = -1, dummy7 = 1159064387, dummy8 = -685272488, dummy9 = 0x555556b895c0, dummy10 = 0x555556c7e2c0, dummy11 = -1, dummy12 = 0, dummy13 = 0, dummy14 = 0x0}
--Type <RET> for more, q to quit, c to continue without paging--
end =
{dummy1 = 0x7fffd80286c0, dummy2 = 0x555555acbef0, dummy3 = -1, dummy4 = 30, dummy5 = 30, dummy6 = -1, dummy7 = 1159064387, dummy8 = -685272488, dummy9 = 0x555555865480, dummy10 = 0x555556b68740, dummy11 = -1, dummy12 = 0, dummy13 = 0, dummy14 = 0x0}
message = 0x555556aeaa50 "another stupid test with OMEMO"
sms_id_str = 0x7ffff7ecb7ce <g_settings_get_value+126> "H\213L$hdH3\f%("
sms_id = 21845
__func__ = "chat_view_send_message_button_clicked_cb"
#15 0x00005555555753f8 in chat_view_input_key_pressed_cb (self=0x55555597c7c0, event_key=0x7fffd801aef0) at ../src/chatty-chat-view.c:745
__func__ = "chat_view_input_key_pressed_cb"
#16 0x00007ffff794d17b in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#17 0x00007ffff7da2c8d in g_closure_invoke () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#18 0x00007ffff7db6365 in () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#19 0x00007ffff7dbe9ab in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#20 0x00007ffff7dbf97f in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#21 0x00007ffff78fb324 in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#22 0x00007ffff791b91b in gtk_window_propagate_key_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#23 0x00007ffff791f42b in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#24 0x00007ffff794d274 in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#25 0x00007ffff7da2ec6 in () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#26 0x00007ffff7dbed74 in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#27 0x00007ffff7dbf97f in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#28 0x00007ffff78fb324 in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#29 0x00007ffff77bba3f in () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#30 0x00007ffff77bda83 in gtk_main_do_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#31 0x00007ffff74bf465 in () at /lib/x86_64-linux-gnu/libgdk-3.so.0
--Type <RET> for more, q to quit, c to continue without paging--
#32 0x00007ffff751a5b2 in () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#33 0x00007ffff7cc0f2e in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#34 0x00007ffff7cc11c8 in () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#35 0x00007ffff7cc125c in g_main_context_iteration () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#36 0x00007ffff7eb3a2d in g_application_run () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#37 0x0000555555572f7b in main (argc=1, argv=0x7fffffffe138) at ../src/main.c:28
application = 0x5555556760e0
(gdb)
(gdb)