5 BANSHEE_CONFIG_DIR
="${XDG_CONFIG_HOME:-$HOME/.config}/banshee-1"
6 BANSHEE_LOG_FILE
="${BANSHEE_CONFIG_DIR}/log"
8 OUTPUT_FILE
="banshee-debugging-$(date +%F-%H-%M-%S)"
9 [[ -d $HOME/Desktop
]] \
10 && OUTPUT_FILE
="$HOME/Desktop/$OUTPUT_FILE" \
11 || OUTPUT_FILE
="$HOME/$OUTPUT_FILE"
18 function begin_log
() {
20 echo "*************************************************************"
22 echo "*************************************************************"
26 function find_pid
() {
27 BANSHEE_PID
=`(pidof banshee 2>/dev/null ||
28 (ps -eo pid,cmd | awk '/mono.*banshee\/.*.exe/ { print $1 }')2>/dev/null) |
31 [[ -z "$BANSHEE_PID" ]] && \
32 bail
"Banshee does not appear to be running. Could not find PID"
35 function capture_mono_stack_trace
() {
36 echo -n " - Sending SIGQUIT to Banshee to get a thread stack dump: "
37 begin_log
"Sending SIGQUIT to ${BANSHEE_PID} get Mono thread stack dump"
38 kill -s QUIT
$BANSHEE_PID 1>&2 && echo "success" ||
echo "error"
41 function capture_gdb_stack_trace
() {
42 echo -n " - Running gdb to get a stack dump: "
43 begin_log
"Running gdb (where, detach, quit)"
44 gdb
--quiet --pid=$
(pidof banshee
) -ex where
-ex detach
-ex quit
1>&2 \
49 function gather_open_files
() {
50 echo -n " - Gathering a list of open files: "
51 begin_log
"Gathering data from lsof against ${BANSHEE_PID}"
52 lsof
-p $BANSHEE_PID 1>&2 && echo "success" ||
echo "error"
55 function pause_playback
() {
56 echo -n " - Pausing playback for nicer strace: "
57 begin_log
"Pausing playback"
58 dbus-send
--session --print-reply \
59 --dest=org.bansheeproject.Banshee \
60 /org
/bansheeproject
/Banshee
/PlayerEngine \
61 org.bansheeproject.Banshee.PlayerEngine.Pause
1>&2 \
63 ||
echo "error (maybe nothing was playing)"
66 function hide_window
() {
67 echo -n " - Hiding window to for nicer strace: "
68 begin_log
"Hiding window"
69 dbus-send
--session --print-reply \
70 --dest=org.bansheeproject.Banshee \
71 /org
/bansheeproject
/Banshee
/ClientWindow \
72 org.bansheeproject.Banshee.ClientWindow.Hide
1>&2 \
77 function restore_window
() {
78 echo -n " - Showing window: "
79 begin_log
"Restoring window"
80 dbus-send
--session --print-reply \
81 --dest=org.bansheeproject.Banshee \
82 /org
/bansheeproject
/Banshee
/ClientWindow \
83 org.bansheeproject.Banshee.ClientWindow.Present
1>&2 \
88 function capture_strace
() {
89 STRACE_MSG
=" - Gathering an strace dump for $STRACE_DURATION seconds: "
91 begin_log
"strace (${STRACE_DURATION}s)"
92 ( strace
-Tvi -p $BANSHEE_PID 1>&2 & \
94 sleep 1; ps
-p $STRACE_PID &>/dev
/null
&& {
95 STRACE_REMAINING
=$STRACE_DURATION
96 while [[ $STRACE_REMAINING -gt 0 ]]; do
97 STRACE_REMAINING
=$
(($STRACE_REMAINING - 1))
98 printf "\r$STRACE_MSG%d " $STRACE_REMAINING
101 printf "\r$STRACE_MSG"
102 kill $STRACE_PID &>/dev
/null \
104 ||
echo "strace terminated early"
109 function concat_log
() {
110 echo -n " - Storing the Banshee log file: "
111 begin_log
"Storing log file ${BANSHEE_LOG_FILE}"
112 cat "$BANSHEE_LOG_FILE" 1>&2 \
117 function inspect_gstreamer
() {
118 echo " - Gathering information about GStreamer"
120 begin_log
"gst-inspect-0.10 --version"
121 echo -n " > gst-inspect-0.10 --version: "
122 gst-inspect-0.10
--version 1>&2 \
126 begin_log
"gst-inspect-0.10"
127 echo -n " > gst-inspect-0.10: "
128 gst-inspect-0.10
1>&2 \
132 begin_log
"pkg-config version probes"
133 (for path
in /usr
/lib64
/usr
/lib
/usr
/local
/lib64
/usr
/local
/lib
; do
134 echo "Checking: $path/pkgconfig"
135 for file in $
(find $path/pkgconfig
-name gstreamer\
*.pc
2>/dev
/null
); do
136 pc_name
=$
(basename $file)
137 pc_command
="pkg-config --modversion --libs --cflags ${pc_name%%.pc}"
145 function inspect_mono
() {
146 echo " - Gathering information about Mono"
148 begin_log
"mono --version"
149 echo -n " > mono --version: "
150 mono
--version 1>&2 \
155 function inspect_distro
() {
156 echo " - Gathering information about your distro"
157 begin_log
"Distro Information"
160 echo "+ /etc/lsb-release"
163 for release_file
in $
(find /etc
-name \
*-release 2>/dev
/null
); do
164 echo "+ $release_file"
176 Inspecting Banshee Process ID: ${BANSHEE_PID}
178 NOTE: If you were listening to or watching anything that you would consider
179 embarrassing, please switch playback to something that would not be so first!
181 After data is collected about your running instance of Banshee, it is your
182 responsibility to review it before submitting to developers for review.
186 read -p "Press <enter> to continue... " ||
exit 1
191 capture_mono_stack_trace
&&
192 capture_gdb_stack_trace
&&
194 # these are to reduce noise from a working pipeline and input/redraw in the strace
198 # restore the window since we're done stracing
204 ) 2>"$OUTPUT_FILE" ||
exit $?
210 A number of useful resources have been gathered to help debug
211 your Banshee issue. Please review the data file before you send
212 it to us. No sensitive user data is gathered, but path names of
213 of open files are provided, for example.
215 Please upload this file to the bug: