Chatty coredumps (on empty message file?) after startup
Reproduction:
- Open Chatty
- Wait a moment
- Coredump
The strace shows it segfaults from a number where the last message was a smiley emoji.
[pid 1289] openat(AT_FDCWD, "/home/purism/.purple/logs/mm-sms/sms/%2b12062405820", O_RDONLY|O_NONBLOCK|O
_CLOEXEC|O_DIRECTORY) = 17
[pid 1289] fstat(17, {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
[pid 1289] getdents64(17, /* 6 entries */, 32768) = 272
[pid 1289] getdents64(17, /* 0 entries */, 32768) = 0
[pid 1289] close(17) = 0
[pid 1289] openat(AT_FDCWD, "/home/purism/.purple/logs/mm-sms/sms/%2b12062405820", O_RDONLY|O_NONBLOCK|O
_CLOEXEC|O_DIRECTORY) = 17
[pid 1289] fstat(17, {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0
[pid 1289] getdents64(17, /* 6 entries */, 32768) = 272
[pid 1289] getdents64(17, /* 0 entries */, 32768) = 0
[pid 1289] close(17) = 0
[pid 1289] openat(AT_FDCWD, "/home/purism/.purple/logs/+12062405820.log", O_RDONLY) = -1 ENOENT (No such
file or directory)
[pid 1289] openat(AT_FDCWD, "/home/purism/.purple/logs/mm-sms/sms/%2b12062405820/2019-06-29.173248-0700P
DT.html", O_RDONLY) = 17
[pid 1289] fstat(17, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
[pid 1289] fcntl(17, F_GETFL) = 0x20000 (flags O_RDONLY|O_LARGEFILE)
[pid 1289] fstat(17, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
[pid 1289] read(17, "", 4096) = 0
[pid 1289] close(17) = 0
[pid 1289] --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x30} ---
[pid 1290] <... ppoll resumed> ) = 0 (Timeout)
[pid 1293] <... ppoll resumed> <unfinished ...>) = ?
[pid 1291] <... ppoll resumed> <unfinished ...>) = ?
[pid 1293] +++ killed by SIGSEGV (core dumped) +++
[pid 1291] +++ killed by SIGSEGV (core dumped) +++
[pid 1290] +++ killed by SIGSEGV (core dumped) +++
[pid 1296] <... pselect6 resumed> ) = 1 (in [17], left {tv_sec=5, tv_nsec=509352961})
[pid 1289] +++ killed by SIGSEGV (core dumped) +++
read(17, "", 516) = 0
exit_group(0) = ?
+++ exited with 0 +++
Segmentation fault (core dumped)
purism@pureos:~/.purple$ dpkg -s chatty
Package: chatty
Status: install ok installed
Priority: optional
Section: net
Installed-Size: 389
Maintainer: Andrea Sch�𖽤fer <andrea.schaefer@puri.sm>
Architecture: arm64
Version: 0.0.8~378.gbp7f14cb
Depends: dconf-gsettings-backend | gsettings-backend, libc6 (>= 2.17), libcairo2 (>= 1.2.4), libgdk-pixbu
f2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.39.90), libgtk-3-0 (>= 3.21.5), libhandy-0.0-0 (>= 0.0.7), libpurp
le0 (>= 2.8.0), libsqlite3-0 (>= 3.5.9)
Suggests: calls
Description: XMPP and SMS messaging
Chatty is a chat application for XMPP and SMS using
libpurple and Modemmanager.
Homepage: https://source.puri.sm/Librem5/chatty
purism@pureos:~/.purple$
Backtrace from gdb:
Script started on 2019-07-02 17:09:53-07:00 [TERM="vt220" TTY="/dev/ttyGS0" COLUMNS="80" LINES="24"]
purism@pureos:~$ sudo coredumpctl gdb 1289
PID: [0;1;39m1289[0m (chatty)
UID: 1000 (purism)
GID: 1000 (purism)
Signal: 11 (SEGV)
Timestamp: Tue 2019-07-02 16:51:22 PDT (18min ago)
Command Line: chatty
Executable: [0;1;39m/usr/bin/chatty[0m
Control Group: /user.slice/user-1000.slice/session-3.scope
Unit: session-3.scope
Slice: user-1000.slice
Session: 3
Owner UID: 1000 (purism)
Boot ID: 565f2b518def4164aa64dec9a6769a92
Machine ID: 07e36b5d1d804ea9ba1cca2bd52e0dd1
Hostname: pureos
Storage: /var/lib/systemd/coredump/core.chatty.1000.565f2b518def4164aa64dec9a6769a92.1289.1562111482000000.lz4
Message: Process 1289 (chatty) of user 1000 dumped core.
Stack trace of thread 1289:
#0 0x0000ffff92d1c64c strstr (libc.so.6)
#1 0x0000ffff93aeb5fc g_strsplit (libglib-2.0.so.0)
#2 0x0000aaaac7004d9c chatty_conv_parse_message (chatty)
#3 0x0000aaaac7007248 chatty_blist_update_buddy (chatty)
#4 0x0000aaaac70087ac chatty_blist_refresh (chatty)
#5 0x0000aaaac7008fe8 cb_chatty_blist_refresh_timer (chatty)
#6 0x0000ffff93acb0e4 n/a (libglib-2.0.so.0)
#7 0x0000ffff93aca51c g_main_context_dispatch (libglib-2.0.so.0)
#8 0x0000ffff93aca8e8 n/a (libglib-2.0.so.0)
#9 0x0000ffff93aca984 g_main_context_iteration (libglib-2.0.so.0)
#10 0x0000ffff93ceeb84 g_application_run (libgio-2.0.so.0)
#11 0x0000aaaac6ffbd28 main (chatty)
#12 0x0000ffff92cc0d24 __libc_start_main (libc.so.6)
#13 0x0000aaaac6ffbd80 $x (chatty)
#14 0x0000aaaac6ffbd80 $x (chatty)
GNU gdb (Debian 8.2.1-2) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/chatty...Reading symbols from /usr/lib/debug/.build-id/b7/9621f502ce4ab9f205ea1fe1addb37368799a7.debug...done.
done.
[New LWP 1289]
[New LWP 1290]
[New LWP 1293]
[New LWP 1291]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
Core was generated by `chatty'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0000ffff92d1c64c in strstr () from /lib/aarch64-linux-gnu/libc.so.6
[Current thread is 1 (Thread 0xffff8ef40010 (LWP 1289))]
(gdb) bt
#0 0x0000ffff92d1c64c in strstr () at /lib/aarch64-linux-gnu/libc.so.6
#1 0x0000ffff93aeb5fc in g_strsplit ()
at /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0
#2 0x0000aaaac7004d9c in chatty_conv_parse_message
(msg=0x30 <error: Cannot access memory at address 0x30>)
at ../src/chatty-conversation.c:936
#3 0x0000aaaac7004d9c in chatty_conv_message_get_last_msg
(buddy=buddy@entry=0xaaaac8b7b5a0) at ../src/chatty-conversation.c:1003
#4 0x0000aaaac7007248 in chatty_blist_update_buddy
(node=0xaaaac8b7b5a0, list=0xaaaac8b7a1e0)
at ../src/chatty-buddy-list.c:2157
#5 0x0000aaaac7007248 in chatty_blist_update
(list=0xaaaac8b7a1e0, node=0xaaaac8b7b5a0)
at ../src/chatty-buddy-list.c:2204
#6 0x0000aaaac70087ac in chatty_blist_refresh (list=0xaaaac8b7a1e0)
at ../src/chatty-buddy-list.c:981
#7 0x0000aaaac70087ac in chatty_blist_refresh (list=0xaaaac8b7a1e0)
at ../src/chatty-buddy-list.c:966
#8 0x0000aaaac7008fe8 in cb_chatty_blist_refresh_timer (list=<optimized out>)
at ../src/chatty-buddy-list.c:252
#9 0x0000ffff93acb0e4 in () at /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0
#10 0x0000ffff93aca51c in g_main_context_dispatch ()
at /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0
--Type <RET> for more, q to quit, c to continue without paging--
#11 0x0000ffff93aca8e8 in () at /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0
#12 0x0000ffff93aca984 in g_main_context_iteration ()
at /usr/lib/aarch64-linux-gnu/libglib-2.0.so.0
#13 0x0000ffff93ceeb84 in g_application_run ()
at /usr/lib/aarch64-linux-gnu/libgio-2.0.so.0
#14 0x0000aaaac6ffbd28 in main (argc=1, argv=0xffffc28c4da8)
at ../src/main.c:28
(gdb) quit
purism@pureos:~$ exit
exit
Script done on 2019-07-02 17:10:08-07:00 [COMMAND_EXIT_CODE="0"]
Edited by Todd Weaver