-
Notifications
You must be signed in to change notification settings - Fork 24
Debug HOWTO
In order to make it possible to fix issues, debug logs are of great importance.
There are three different scenarios that require two different ways to extract logs (pidgin log or gdb log):
-
The first one is when Pidgin crashes completely (What is called a segfault).
-
The second one is when Pidgin does not crash, but a certain feature that should work simply does not. That could be screen sharing, voice, conferencing, ...
-
The third is when you try to screen share and Remmina crashes (segfaults).
-
You might also need to do a packet capture. You can record packets with tshark
sudo tshark -i eth0 -w /tmp/capture.pcap -F pcapng
Replace eth0 with your network interface.
This howto expects you are using pidgin-sipe
installed from sipe-collab PPA.
First you need to install special packages that include our software plus the extra "debug-symbols".
sudo apt-get install pidgin-dbg pidgin-sipe-dbg remmina-dbg libnice-dbg -y
On Ubuntu 18.04, use this command instead:
sudo apt-get install pidgin-sipe-dbgsym gstreamer1.0-nice-dbgsym libnice10-dbgsym pidgin-dbg libfreerdp-client2-2-dbgsym libfreerdp-server2-2-dbgsym libfreerdp-shadow-subsystem2-2-dbgsym libfreerdp-shadow2-2-dbgsym libfreerdp2-2-dbgsym libuwac0-0-dbgsym libwinpr-tools2-2-dbgsym libwinpr2-2-dbgsym -y
You also need the gdb debugger
sudo apt-get install gdb -y
Now you are able to run Pidgin from gdb. Start gdb with:
$ gdb
GNU gdb (Ubuntu 7.10-1ubuntu2) 7.10
Copyright (C) 2015 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 "x86_64-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".
(gdb)
You start Pidgin with:
(gdb) file pidgin.orig
Reading symbols from pidgin.orig...warning: the debug information found in "/usr/bin/pidgin" does not match
"/usr/bin/pidgin.orig" (CRC mismatch).
Reading symbols from /usr/lib/debug//usr/bin/pidgin...done.
done.
(gdb) run
Now Pidgin will start as normal, and you try to reproduce the crash. After the crash you return to the gdb prompt and write bt full
(bt as in "Back Trace").
(gdb) bt full
GDB will print out the sequence of function calls which led to the crash. A sample backtrace would look like this:
#0 0x00007fffd717f234 in sipe_media_call_new (sipe_private=0x555556730d10, with=0x55555677bae0 "sip:[email protected];gruu;opaque=srvr:Microsoft.Rtc.Applications.TestBot:D7WqcwEvxVOWIrwKL4p7eAAA", msg=0x0, ice_version=SIPE_ICE_RFC_5245, flags=(unknown: 0)) at /home/haakon/ws/sipe/sipe/src/core/sipe-media.c:981
call_private = 0x0
session = 0x555555d02810
dialog = 0x0
cname = 0x7fffffffaed0 " \257\377\377\377\177"
#1 0x00007fffd717f92d in sipe_media_initiate_call (sipe_private=0x555556730d10, with=0x55555677bae0 "sip:[email protected];gruu;opaque=srvr:Microsoft.Rtc.Applications.TestBot:D7WqcwEvxVOWIrwKL4p7eAAA", ice_version=SIPE_ICE_RFC_5245, with_video=0) at /home/haakon/ws/sipe/sipe/src/core/sipe-media.c:1194
call_private = 0x1
#2 0x00007fffd717fa57 in sipe_core_media_initiate_call (sipe_public=0x555556730d10, with=0x55555677bae0 "sip:[email protected];gruu;opaque=srvr:Microsoft.Rtc.Applications.TestBot:D7WqcwEvxVOWIrwKL4p7eAAA", with_video=0) at /home/haakon/ws/sipe/sipe/src/core/sipe-media.c:1229
#3 0x00007fffd717fe97 in sipe_core_media_test_call (sipe_public=0x555556730d10) at /home/haakon/ws/sipe/sipe/src/core/sipe-media.c:1368
sipe_private = 0x555556730d10
#4 0x00007fffd713c211 in sipe_purple_test_call (action=0x555556770b20) at /home/haakon/ws/sipe/sipe/src/purple/purple-plugin-common.c:751
gc = 0x5555567391f0 [PurpleConnection]
#5 0x00007ffff7b0cf1c in protocol_act (obj=0x5555566e5770 [GtkMenuItem], pam=0x555556770b20) at gtkblist.c:8007
#9 0x00007fffeff1408f in <emit signal ??? on instance 0x5555566e5770 [GtkMenuItem]> (instance=instance@entry=0x5555566e5770, signal_id=<optimized out>, detail=detail@entry=0) at /build/glib2.0-2CrUwg/glib2.0-2.48.0/./gobject/gsignal.c:3441
#10 0x00007ffff1e1944e in gtk_widget_activate (widget=widget@entry=0x5555566e5770 [GtkMenuItem]) at /build/gtk+3.0-fILMXm/gtk+3.0-3.18.9/./gtk/gtkwidget.c:7725
#11 0x00007ffff1cf70e6 in gtk_menu_shell_activate_item (menu_shell=0x55555676a230 [GtkMenu], menu_item=0x5555566e5770 [GtkMenuItem], force_deactivate=<optimized out>) at /build/gtk+3.0-fILMXm/gtk+3.0-3.18.9/./gtk/gtkmenushell.c:1376
slist = <optimized out>
shells = 0x555555dd2d60
deactivate = <optimized out>
__func__ = "gtk_menu_shell_activate_item"
#12 0x00007ffff1cf7414 in gtk_menu_shell_button_release (widget=0x55555676a230 [GtkMenu], event=<optimized out>) at /build/gtk+3.0-fILMXm/gtk+3.0-3.18.9/./gtk/gtkmenushell.c:788
submenu = 0x0
menu_item = 0x5555566e5770 [GtkMenuItem]
deactivate = 1
menu_shell = 0x55555676a230 [GtkMenu]
priv = 0x55555676a0f0
--- output cut for brevity ---
If you have a suspicion for a race condition, please always include full stack traces from all threads:
(gdb) thread apply all bt full
Make a copy of this output, create an issue in our tracker and attach the log. It is also helpful if you describe what steps you did to reproduce the crash.
When something does not work as expected, but Pidgin does not crash. You can use Pidgin's debug-feature to create a log. You start Pidgin from the command-prompt with:
GST_DEBUG=3 PURPLE_UNSAFE_DEBUG=1 pidgin --debug |& tee ~/pidgin.log
Or if you want even greater log verbosity:
GST_DEBUG=3 PURPLE_UNSAFE_DEBUG=1 G_MESSAGES_DEBUG=all NICE_DEBUG=all,libnice-nice-verbose pidgin --debug |& tee ~/pidgin.log
Now Pidgin will start, and you will see the debug-output on the screen. The debug is also simultaneously saved to the file pidgin.log that you find in your home directory. Now reproduce the error, create an issue in the tracker here on github and attach the log with a description of the problem you have found. If your log should contain sensible information that you don't want to make public, ask us for an email you can send it to.
It is also useful for us to know which version of pidgin-sipe and related libraries you have installed so please add the output of the following command to your problem description:
dpkg --list | grep -e sipe -e pidgin -e farstream -e remmina -e nice -e freerdp -e winpr
ii gstreamer1.0-nice:amd64 0.1.13+sipe+collab-201603090603+2222~ubuntu16.04.1 amd64 ICE library (GStreamer plugin)
ii gstreamer1.0-plugins-bad:amd64 1.8.0-1ubuntu1+sipe1 amd64 GStreamer plugins from the "bad" set
ii gstreamer1.0-plugins-bad-faad:amd64 1.8.0-1ubuntu1+sipe1 amd64 GStreamer faad plugin from the "bad" set
ii gstreamer1.0-plugins-bad-videoparsers:amd64 1.8.0-1ubuntu1+sipe1 amd64 GStreamer videoparsers plugin from the "bad" set
ii libfarstream-0.2-5:amd64 0.2.8+sipe+collab-0.3009+201604112102~ubuntu16.04.1 amd64 Audio/Video communications framework: core library
ii libfreerdp-client2:amd64 2.0.0~git20160317.1.75ae3f5+dfsg1-0~201603221017~23~ubuntu16.04.1 amd64 Free Remote Desktop Protocol library (client library)
ii libfreerdp-server2:amd64 2.0.0~git20160317.1.75ae3f5+dfsg1-0~201603221017~23~ubuntu16.04.1 amd64 Free Remote Desktop Protocol library (server library)
ii libfreerdp-shadow2:amd64 2.0.0~git20160317.1.75ae3f5+dfsg1-0~201603221017~23~ubuntu16.04.1 amd64 FreeRDP Remote Desktop Protocol shadow libraries
ii libfreerdp2:amd64 2.0.0~git20160317.1.75ae3f5+dfsg1-0~201603221017~23~ubuntu16.04.1 amd64 Free Remote Desktop Protocol library (core library)
ii libgstreamer-plugins-bad1.0-0:amd64 1.8.0-1ubuntu1+sipe1 amd64 GStreamer development files for libraries from the "bad" set
ii libnice10:amd64 0.1.13+sipe+collab-201603090603+2222~ubuntu16.04.1 amd64 ICE library (shared library)
ii libwinpr-tools2-2:amd64 2.0.0~git20180411.1.7a7b1802+dfsg1-2 amd64 Windows Portable Runtime Tools library
ii libwinpr2-2:amd64 2.0.0~git20180411.1.7a7b1802+dfsg1-2 amd64 Windows Portable Runtime library
ii pidgin 1:3.0.0~collab-0.20620+201604121002~ubuntu16.04.1 amd64 graphical multi-protocol instant messaging client for X
ii pidgin-data 1:3.0.0~collab-0.20620+201604121002~ubuntu16.04.1 all multi-protocol instant messaging client - data files
ii pidgin-sipe 1.20.1+collab-201604110746+3194~ubuntu16.04.1 amd64 Pidgin plugin for MS Office Communicator and MS Lync
ii remmina 1.1.2-sipe+201604051419+next+852~ubuntu16.04.1 amd64 remote desktop client for GNOME desktop environment
ii remmina-common 1.1.2-sipe+201604051419+next+852~ubuntu16.04.1 all common files for remmina remote desktop client
ii remmina-plugin-rdp 1.1.2-sipe+201604051419+next+852~ubuntu16.04.1 amd64 RDP plugin for remmina remote desktop client
ii remmina-plugin-vnc 1.1.2-sipe+201604051419+next+852~ubuntu16.04.1 amd64 VNC plugin for remmina remote desktop client
Because Remmina is started in a process separate from Pidgin, you will not be able to see the stack trace if you run the Pidgin-binary through the gdb-debugger. The solution is to run Remmina through gdb, and have it running in the background before you start pidgin.
Before you begin, make sure there isn't any remmina process already running on background. If it is so, your desktop environment's "system tray" will contain a remmina icon. Shut down that process.
killall remmina
You open a new terminal and run from gdb:
(gdb) file remmina
Reading symbols from remmina...Reading symbols from /usr/lib/debug/.build- id/52/55f707a2b9d5dc65776effa6678b8a3b9650ad.debug...done.
done.
(gdb) run
Starting program: /usr/bin/remmina
...
Remmina will start in the background (As proof that Remmina is active you will see an icon in the top bar in the gui).
Now you can start Pidgin as usual, do the steps you did to make Remmina crash and capture the stack trace in the terminal when that happens with:
bt full