Project

General

Profile

Tvheadendcrash » History » Version 2

Andreas Smas, 2010-08-19 14:53

1 1 Andreas Smas
2
= Running in gdb to file a bug report =
3
4 2 Andreas Smas
This method is by far the best one as it yields most info. Especially if you have compiled the source yourself.
5
It does assume that you are able to reproduce the bug since you probably won't be running Tvheadend inside a gdb session normally.
6 1 Andreas Smas
7 2 Andreas Smas
To start Tvheadend from a gdb session just execute this command when standing in the dir where tvheadend is checked out.
8 1 Andreas Smas
{{{
9
$ gdb --args build.Linux/tvheadend -d
10
}}}
11
12 2 Andreas Smas
Or, If you get repeatable crashes in the installed binary you can also run gdb on that binary. In order to that you must disable the running daemon and run the binary as the hts user (or it won't pick up the correct config, etc)
13 1 Andreas Smas
{{{
14 2 Andreas Smas
$ sudo /etc/init.d/hts-tvheadend stop
15
$ sudo -u hts -i
16
$ gdb --args /usr/bin/tvheadend -d
17
}}}
18
19
{{{
20 1 Andreas Smas
GNU gdb (GDB) 7.1-ubuntu
21
Copyright (C) 2010 Free Software Foundation, Inc.
22
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
23
This is free software: you are free to change and redistribute it.
24
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
25
and "show warranty" for details.
26
This GDB was configured as "i486-linux-gnu".
27
For bug reporting instructions, please see:
28
<http://www.gnu.org/software/gdb/bugs/>...
29
Reading symbols from /home/andoma/tvheadend/build.Linux/tvheadend...done.
30
}}}
31
32
{{{
33
(gdb) r
34
}}}
35
36 2 Andreas Smas
Eventually the program will crash. Then execute these three commands and paste in the bug report.
37 1 Andreas Smas
38
39
=== Register dump ===
40
{{{
41
(gdb) info reg
42
eax            0x0	0
43
ecx            0x10	16
44
edx            0x80cd818	135059480
45
ebx            0x8178d90	135761296
46
esp            0xb45ff140	0xb45ff140
47
ebp            0xb45ff168	0xb45ff168
48
esi            0x80f9f18	135241496
49
edi            0xb45ff220	-1268780512
50
eip            0x8057ec8	0x8057ec8 <subscription_unsubscribe+200>
51
eflags         0x10282	[ SF IF RF ]
52
cs             0x73	115
53
ss             0x7b	123
54
ds             0x7b	123
55
es             0x7b	123
56
fs             0x0	0
57
gs             0x33	51
58
}}}
59
60
61
=== Disassembly of code around the crash ===
62
{{{
63
(gdb) disassemble $pc-32,$pc+32
64
Dump of assembler code from 0x8057ea8 to 0x8057ee8:
65
   0x08057ea8 <subscription_unsubscribe+168>:	add    $0x24,%al
66
   0x08057eaa <subscription_unsubscribe+170>:	call   0x804a814 <free@plt>
67
   0x08057eaf <subscription_unsubscribe+175>:	mov    %ebx,(%esp)
68
   0x08057eb2 <subscription_unsubscribe+178>:	call   0x804a814 <free@plt>
69
   0x08057eb7 <subscription_unsubscribe+183>:	call   0x80579c0 <subscription_reschedule>
70
   0x08057ebc <subscription_unsubscribe+188>:	mov    0x80c8bc8,%eax
71
   0x08057ec1 <subscription_unsubscribe+193>:	lea    0x0(%esi,%eiz,1),%esi
72
=> 0x08057ec8 <subscription_unsubscribe+200>:	mov    (%eax),%edx
73
   0x08057eca <subscription_unsubscribe+202>:	test   %edx,%edx
74
   0x08057ecc <subscription_unsubscribe+204>:	je     0x8057ed4 <subscription_unsubscribe+212>
75
   0x08057ece <subscription_unsubscribe+206>:	mov    0x4(%eax),%ecx
76
   0x08057ed1 <subscription_unsubscribe+209>:	mov    %ecx,0x4(%edx)
77
   0x08057ed4 <subscription_unsubscribe+212>:	mov    0x4(%eax),%ecx
78
   0x08057ed7 <subscription_unsubscribe+215>:	mov    %edx,(%ecx)
79
   0x08057ed9 <subscription_unsubscribe+217>:	mov    (%eax),%eax
80
   0x08057edb <subscription_unsubscribe+219>:	jmp    0x8057ec8 <subscription_unsubscribe+200>
81
   0x08057edd <subscription_unsubscribe+221>:	mov    0x2c(%ebx),%eax
82
   0x08057ee0 <subscription_unsubscribe+224>:	movl   $0x8094ad9,0x8(%esp)
83
}}}
84
85
=== Full backtrace ===
86
{{{
87
(gdb) bt full
88
#0  subscription_unsubscribe (s=0x0) at /home/andoma/tvheadend/src/subscriptions.c:221
89
        t = 0x80f9f18
90
#1  0x08061609 in htsp_subscription_destroy (htsp=0xb45ff220, hs=0x81762b8) at /home/andoma/tvheadend/src/htsp.c:240
91
No locals.
92
#2  0x080616e9 in htsp_method_unsubscribe (htsp=0xb45ff220, in=0x817a468) at /home/andoma/tvheadend/src/htsp.c:806
93
        s = 0x81762b8
94
        sid = 1
95
#3  0x080632ac in htsp_read_loop (fd=38, opaque=0x0, source=0x80d5774, self=0x80d5784) at /home/andoma/tvheadend/src/htsp.c:1065
96
        m = 0x817a468
97
        i = 8
98
        reply = <value optimized out>
99
        r = <value optimized out>
100
        method = <value optimized out>
101
#4  htsp_serve (fd=38, opaque=0x0, source=0x80d5774, self=0x80d5784) at /home/andoma/tvheadend/src/htsp.c:1188
102
        htsp = {htsp_fd = 38, htsp_peer = 0x80d5774, htsp_version = 0, htsp_logname = 0x80d3420 "127.0.0.1 [ HTS Showtime ]", 
103
          htsp_peername = 0x80ccf50 "127.0.0.1", htsp_username = 0x0, htsp_clientname = 0x80d7dd0 "HTS Showtime", htsp_async_mode = 1, 
104
          htsp_async_link = {le_next = 0x0, le_prev = 0x80c7e30}, htsp_writer_thread = 3017796464, htsp_writer_run = 1, htsp_active_output_queues = {
105
            tqh_first = 0x0, tqh_last = 0xb45ff250}, htsp_out_mutex = {__data = {__lock = 0, __count = 0, __owner = 0, __kind = 0, __nusers = 1, {
106
                __spins = 0, __list = {__next = 0x0}}}, __size = '\000' <repeats 16 times>, "\001\000\000\000\000\000\000", __align = 0}, 
107
          htsp_out_cond = {__data = {__lock = 0, __futex = 119, __total_seq = 60, __wakeup_seq = 59, __woken_seq = 59, __mutex = 0xb45ff258, 
108
              __nwaiters = 2, __broadcast_seq = 0}, 
109
            __size = "\000\000\000\000w\000\000\000<\000\000\000\000\000\000\000;\000\000\000\000\000\000\000;\000\000\000\000\000\000\000X\362_\264\002\000\000\000\000\000\000\000\000\000\000", __align = 511101108224}, htsp_hmq_ctrl = {hmq_q = {tqh_first = 0x0, tqh_last = 0xb45ff2a0}, hmq_link = {
110
              tqe_next = 0x0, tqe_prev = 0xb45ff250}, hmq_strict_prio = 0, hmq_length = 0, hmq_payload = 0}, htsp_hmq_epg = {hmq_q = {
111
              tqh_first = 0x0, tqh_last = 0xb45ff2bc}, hmq_link = {tqe_next = 0x0, tqe_prev = 0x0}, hmq_strict_prio = 0, hmq_length = 0, 
112
            hmq_payload = 0}, htsp_hmq_qstatus = {hmq_q = {tqh_first = 0x0, tqh_last = 0xb45ff2d8}, hmq_link = {tqe_next = 0x81762e4, 
113
              tqe_prev = 0xb45ff250}, hmq_strict_prio = 1, hmq_length = 0, hmq_payload = 0}, htsp_subscriptions = {lh_first = 0x0}, 
114
          htsp_granted_access = 15, htsp_challenge = "\033\231\367B\270ʙ\375q~\272r\305&vә\\aۑ9\332+IM\036\365K\241\067K"}
115
        buf = "127.0.0.1", '\000' <repeats 20 times>
116
        s = <value optimized out>
117
#5  0x0804d7a3 in tcp_server_start (aux=0x80d5768) at /home/andoma/tvheadend/src/tcp.c:397
118
        val = 1
119
#6  0x0018b96e in start_thread (arg=0xb45ffb70) at pthread_create.c:300
120
---Type <return> to continue, or q <return> to quit---
121
        __res = <value optimized out>
122
        __ignore1 = <value optimized out>
123
        __ignore2 = <value optimized out>
124
        pd = 0xb45ffb70
125
        now = <value optimized out>
126
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {1687540, 0, 4001536, -1268779880, 1031645625, -1276594991}, mask_was_saved = 0}}, priv = {pad = {
127
              0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
128
        not_first_call = <value optimized out>
129
        robust = <value optimized out>
130
        freesize = <value optimized out>
131
        __PRETTY_FUNCTION__ = "start_thread"
132
#7  0x00292a4e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130
133
No locals.
134
}}}
135
136
137
= Using the crash info from syslog =
138
139
{{{
140
[ALERT]:CRASH: SIGNAL: 6 in PRG: build.Linux/tvheadend (SVN-r5179) [039b869f7afe07cd8d72b6e73514d9eae4b2b763] CWD: /home/andoma/tvheadend  
141
[ALERT]:CRASH: LOADED IMAGES: /lib/tls/i686/cmov/librt.so.1 /lib/tls/i686/cmov/libcrypt.so.1 /usr/lib/libavahi-common.so.3 /usr/lib/libavahi-client.so.3 /lib/tls/i686/cmov/libpthread.so.0 /lib/tls/i686/cmov/libm.so.6 /lib/tls/i686/cmov/libc.so.6 /lib/tls/i686/cmov/libdl.so.2 /lib/ld-linux.so.2 /lib/libdbus-1.so.3 /lib/tls/i686/cmov/libnss_compat.so.2 /lib/tls/i686/cmov/libnsl.so.1 /lib/tls/i686/cmov/libnss_nis.so.2 /lib/tls/i686/cmov/libnss_files.so.2  
142
[ALERT]:CRASH: REGDUMP[19]: 00000033 00000000 0000007b 0000007b 00487ff4 00000400 b55fb978 b55fb96c 00002972 00000006 0000297a 00000000 00000000 00000000 00ce2422 00000073 00200206 b55fb96c 0000007b 
143
[ALERT]:CRASH: STACKTRACE
144
[ALERT]:CRASH: build.Linux/tvheadend 0x8067832
145
[ALERT]:CRASH: __kernel_rt_sigreturn+0x0  ()
146
[ALERT]:CRASH: abort+0x182  (/lib/tls/i686/cmov/libc.so.6)
147
[ALERT]:CRASH: /lib/tls/i686/cmov/libc.so.6 0x39349d
148
[ALERT]:CRASH: /lib/tls/i686/cmov/libc.so.6 0x39d591
149
[ALERT]:CRASH: /lib/tls/i686/cmov/libc.so.6 0x3a0395
150
[ALERT]:CRASH: __libc_calloc+0xab  (/lib/tls/i686/cmov/libc.so.6)
151
[ALERT]:CRASH: build.Linux/tvheadend 0x807ee1a
152
[ALERT]:CRASH: build.Linux/tvheadend 0x8080883
153
[ALERT]:CRASH: build.Linux/tvheadend 0x8080ca8
154
[ALERT]:CRASH: /lib/tls/i686/cmov/libpthread.so.0 0x1ca96e
155
[ALERT]:CRASH: clone+0x5e  (/lib/tls/i686/cmov/libc.so.6)
156
157
}}}