Sailfish OS - TelepathyIM/wiki GitHub Wiki

Content

  1. Messaging stack
  2. Account settings extensions
  3. Troubleshooting

Messaging stack

Base telepathy stack

Open source part

Closed source part

  • sailfish-components-accounts-qt5 (declarative wrapper around libaccounts-qt and libsignon-qt)
  • sailfish-components-contacts-qt5 (mostly QML files + small helpers for qtpim and system-wide presence)
  • jolla-settings-accounts
  • jolla-settings-system (Presence page)
  • jolla-messages (mostly QML files ontop of nemo-qml-plugin-contacts)
  • jolla-contacts
  • jolla-signon-ui

See also

Account settings extensions

Troubleshooting

Low-level info about communication history

commhistory-tool

Sailfish OS provides commhistory-tool to get low-level information about contacts, groups, calls, and messages.

Remove all messages and contacts:

commhistory-tool deleteall -groups

Remove all messages and contacts for a specific account (replace $ACCOUNT_NAME by the account):

commhistory-tool listgroups /org/freedesktop/Telepathy/Account/$ACCOUNT_NAME |grep "^Group "|cut -d ' ' -f 2|xargs -n 1 commhistory-tool deletegroup

Run commhistory in debug mode:

  • in user console: $ killall commhistoryd; commhistoryd -d
  • in root (devel-su) console: # journalctl -t COMMHISTORYD -fa

See also: Sailfish_OS_Cheat_Sheet#Messages

Direct dump from the SQL database

sqlite3 /home/nemo/.local/share/commhistory/commhistory.db

Increase the debug level

Qt-based applications

Use logging rules to enable extra debug categories. The Sailfish OS Cheat Sheet/Diagnostics suggests to enable all possible categories: QT_LOGGING_RULES="*.debug=true"

Please take a note that in this case, some projects (e.g. TelegramQt) can dump a lot of low-level messages that can contain sensitive data. Follow the recommendations of the affected project developers to get the best noise to signal rate.

In case of TelegramQt it makes sense to enable only some categories, e.g. operations: telegram.operations.debug=true category. The output is safe yet useful.

Mission Control

Via journalctl

  1. Adjust the unit configuration to enable messages:
 [Service]
 ExecStart=/usr/bin/invoker --type=generic /usr/libexec/mission-control-5
 Type=dbus
 BusName=org.freedesktop.Telepathy.MissionControl5
+Environment="MC_DEBUG=all"
+Environment="G_MESSAGES_DEBUG=all"

 [Install]
  1. Reload the configuration and restart the service
systemctl-user daemon-reload
systemctl-user restart mission-control-5
  1. Monitor and get the logs
journalctl /usr/libexec/mission-control-5 -f -n 100

Manually

Use the follow snippet to manually start mission-control and redirect logs to mc.log:

killall -i mission-control
G_MESSAGES_DEBUG=all MC_DEBUG=all /usr/lib/telepathy/mission-control-5 2>&1 | tee mc.log

How to debug a crash

Install packages with debug information

Install the appropriate debugging symbols (e.g. for telegram-qt):

pkcon install telegram-qt-qt5-debuginfo
pkcon install telegram-qt-qt5-declarative-debuginfo

Generate a dump file

Enable coredump and run the affected application (e.g. jolla-settings):

ulimit -c unlimited
jolla-settings

Reproduce the crash so the process will generate core.$PID in your home directory (/home/nemo/core.*).

The resulted file contains the process execution and memory state and can be loaded via the debugger (see below).

Interactive debugging

  1. Install the appropriate debugging symbols (e.g. for telegram-qt) and the debugger:
pkcon install telegram-qt-qt5-debuginfo
pkcon install telegram-qt-qt5-declarative-debuginfo
pkcon install gdb
  1. Run the application in the debugger and trigger a crash:
gdb jolla-settings
  1. (or) Load a core dump file
gdb jolla-settings /home/nemo/core.12345
  1. Dump the backtrace:
(gdb) bt
#0  QString (other=..., this=0xbeaa11e4
    at /usr/include/qt5/QtCore/qstring.h:889
#1  DcOption (this=0xbeaa11e4)
    at /usr/src/debug/telegram-qt-0.2.0/TelegramQt/TelegramNamespace.hpp:216
#2  dcOption (this=0x0)
    at /usr/src/debug/telegram-qt-0.2.0/TelegramQt/ClientConnection.hpp:21
#3  Telegram::Client::AuthOperationPrivate::requestAuthCode (this=0xb8bb25a8) 
    at /usr/src/debug/telegram-qt-0.2.0/TelegramQt/ClientAuthOperation.cpp:166
#4  0xad73e244 in Telegram::PendingOperation::start (this=0xb8c879d0)
    at /usr/src/debug/telegram-qt-0.2.0/TelegramQt/PendingOperation.cpp:37
#5  0xad76f4d0 in Telegram::Client::AuthOperation::submitPhoneNumber (...)
    at /usr/src/debug/telegram-qt-0.2.0/TelegramQt/ClientAuthOperation.cpp:245
#6  0xad820cbc in Telegram::Client::DeclarativeOperation::submitPhoneNumber (...)
    at /usr/src/debug/telegram-qt-0.2.0/imports/DeclarativeOperation.cpp:130
#7  0xad823e4e in Telegram::Client::DeclarativeOperation::qt_static_metacall (...)
    at /usr/src/debug/telegram-qt-0.2.0/build/imports/moc_DeclarativeOperation.cpp
#8  0xad825008 in Telegram::Client::DeclarativeOperation::qt_metacall (...)
    at /usr/src/debug/telegram-qt-0.2.0/build/imports/moc_DeclarativeOperation.cpp
#9  0xb689a24c in ?? () from /usr/lib/libQt5Qml.so.5

This information is incredibly useful because it contains the exact line number of the crash stack.