19
19
<LINK REL="STYLESHEET" HREF="asterisk.css">
21
<LINK REL="previous" HREF="node281.html">
22
<LINK REL="up" HREF="node281.html">
21
<LINK REL="next" HREF="node284.html">
22
<LINK REL="previous" HREF="node272.html">
23
<LINK REL="up" HREF="asterisk.html">
23
24
<LINK REL="next" HREF="node283.html">
28
29
<DIV CLASS="navigation"><!--Navigation Panel-->
29
<A NAME="tex2html4336"
30
<A NAME="tex2html4340"
30
31
HREF="node283.html">
31
32
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
32
33
SRC="/usr/share/latex2html/icons/next.png"></A>
33
<A NAME="tex2html4332"
34
<A NAME="tex2html4336"
35
36
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
36
37
SRC="/usr/share/latex2html/icons/up.png"></A>
37
<A NAME="tex2html4328"
38
<A NAME="tex2html4330"
38
39
HREF="node281.html">
39
40
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
40
41
SRC="/usr/share/latex2html/icons/prev.png"></A>
41
<A NAME="tex2html4334"
42
<A NAME="tex2html4338"
43
44
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
44
45
SRC="/usr/share/latex2html/icons/contents.png"></A>
46
<B> Next:</B> <A NAME="tex2html4337"
47
HREF="node283.html">About this document ...</A>
48
<B> Up:</B> <A NAME="tex2html4333"
49
HREF="node281.html">Development</A>
50
<B> Previous:</B> <A NAME="tex2html4329"
51
HREF="node281.html">Development</A>
52
<B> <A NAME="tex2html4335"
47
<B> Next:</B> <A NAME="tex2html4341"
48
HREF="node283.html">Backtrace</A>
49
<B> Up:</B> <A NAME="tex2html4337"
50
HREF="asterisk.html">Asterisk Reference Information Version</A>
51
<B> Previous:</B> <A NAME="tex2html4331"
52
HREF="node281.html">Putting it all together</A>
53
<B> <A NAME="tex2html4339"
53
54
HREF="node1.html">Contents</A></B>
56
57
<!--End of Navigation Panel-->
58
<H1><A NAME="SECTION001610000000000000000">
59
<H1><A NAME="SECTION001600000000000000000">
61
This document is intended to provide information on how to obtain the
62
backtraces required on the asterisk bug tracker, available at
63
<TT><A NAME="tex2html37"
64
HREF="http://bugs.digium.com">http://bugs.digium.com</A></TT>. The information is required by developers to
65
help fix problem with bugs of any kind. Backtraces provide information
66
about what was wrong when a program crashed; in our case,
67
Asterisk. There are two kind of backtraces (aka 'bt') which are
68
useful: bt and bt full.
71
First of all, when you start Asterisk, you MUST start it with option
72
-g. This tells Asterisk to produce a core file if it crashes.
75
If you start Asterisk with the safe_asterisk script, it automatically
76
starts using the option -g.
79
If you're not sure if Asterisk is running with the -g option, type the
80
following command in your shell:
86
debian:/tmp# ps aux | grep asterisk
87
root 17832 0.0 1.2 2348 788 pts/1 S Aug12 0:00 /bin/sh /usr/sbin/safe_asterisk
88
root 26686 0.0 2.8 15544 1744 pts/1 S Aug13 0:02 asterisk -vvvg -c
90
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
94
The interesting information is located in the last column.
97
Second, your copy of Asterisk must have been built without
98
optimization or the backtrace will be (nearly) unusable. This can be
99
done by selecting the 'DONT_OPTIMIZE' option in the Compiler Flags
100
submenu in the 'make menuselect' tree before building Asterisk.
103
After Asterisk crashes, a core file will be "dumped" in your /tmp/
104
directory. To make sure it's really there, you can just type the
105
following command in your shell:
111
debian:/tmp# ls -l /tmp/core.*
112
-rw------- 1 root root 10592256 Aug 12 19:40 /tmp/core.26252
113
-rw------- 1 root root 9924608 Aug 12 20:12 /tmp/core.26340
114
-rw------- 1 root root 10862592 Aug 12 20:14 /tmp/core.26374
115
-rw------- 1 root root 9105408 Aug 12 20:19 /tmp/core.26426
116
-rw------- 1 root root 9441280 Aug 12 20:20 /tmp/core.26462
117
-rw------- 1 root root 8331264 Aug 13 00:32 /tmp/core.26647
119
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
123
In the event that there are multiple core files present (as in the
124
above example), it is important to look at the file timestamps in
125
order to determine which one you really intend to look at.
128
Now that we've verified the core file has been written to disk, the
129
final part is to extract 'bt' from the core file. Core files are
130
pretty big, don't be scared, it's normal.
133
<SPAN CLASS="textbf">NOTE: Don't attach core files on the bug tracker, we only need the bt and bt full.</SPAN>
136
For extraction, we use a really nice tool, called gdb. To verify that
137
you have gdb installed on your system:
145
Copyright 2004 Free Software Foundation, Inc.
146
GDB is free software, covered by the GNU General Public License, and you are
147
welcome to change it and/or distribute copies of it under certain conditions.
148
Type "show copying" to see the conditions.
149
There is absolutely no warranty for GDB. Type "show warranty" for details.
150
This GDB was configured as "i386-linux".
152
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
156
Which is great, we can continue. If you don't have gdb installed, go install gdb.
159
Now load the core file in gdb, as follows:
165
debian:/tmp# gdb asterisk /tmp/core.26252
167
(You would see a lot of output here.)
169
Reading symbols from /usr/lib/asterisk/modules/app_externalivr.so...done.
170
Loaded symbols for /usr/lib/asterisk/modules/app_externalivr.so
171
#0 0x29b45d7e in ?? ()
173
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
177
Now at the gdb prompt, type: bt
178
You would see output similar to:
185
#0 0x29b45d7e in ?? ()
186
#1 0x08180bf8 in ?? ()
187
#2 0xbcdffa58 in ?? ()
188
#3 0x08180bf8 in ?? ()
189
#4 0xbcdffa60 in ?? ()
190
#5 0x08180bf8 in ?? ()
191
#6 0x180bf894 in ?? ()
192
#7 0x0bf80008 in ?? ()
193
#8 0x180b0818 in ?? ()
194
#9 0x08068008 in ast_stopstream (tmp=0x40758d38) at file.c:180
195
#10 0x000000a0 in ?? ()
196
#11 0x000000a0 in ?? ()
197
#12 0x00000000 in ?? ()
198
#13 0x407513c3 in confcall_careful_stream (conf=0x8180bf8, filename=0x8181de8 "DAHDI/pseudo-1324221520") at app_meetme.c:262
199
#14 0x40751332 in streamconfthread (args=0x8180bf8) at app_meetme.c:1965
200
#15 0xbcdffbe0 in ?? ()
201
#16 0x40028e51 in pthread_start_thread () from /lib/libpthread.so.0
202
#17 0x401ec92a in clone () from /lib/libc.so.6
204
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
208
The bt's output is the information that we need on the bug tracker.
214
Now do a bt full as follows:
216
#0 0x29b45d7e in ?? ()
217
No symbol table info available.
218
#1 0x08180bf8 in ?? ()
219
No symbol table info available.
220
#2 0xbcdffa58 in ?? ()
221
No symbol table info available.
222
#3 0x08180bf8 in ?? ()
223
No symbol table info available.
224
#4 0xbcdffa60 in ?? ()
225
No symbol table info available.
226
#5 0x08180bf8 in ?? ()
227
No symbol table info available.
228
#6 0x180bf894 in ?? ()
229
No symbol table info available.
230
#7 0x0bf80008 in ?? ()
231
No symbol table info available.
232
#8 0x180b0818 in ?? ()
233
No symbol table info available.
234
#9 0x08068008 in ast_stopstream (tmp=0x40758d38) at file.c:180
236
#10 0x000000a0 in ?? ()
237
No symbol table info available.
238
#11 0x000000a0 in ?? ()
239
No symbol table info available.
240
#12 0x00000000 in ?? ()
241
No symbol table info available.
242
#13 0x407513c3 in confcall_careful_stream (conf=0x8180bf8, filename=0x8181de8 "DAHDI/pseudo-1324221520") at app_meetme.c:262
243
f = (struct ast_frame *) 0x8180bf8
244
trans = (struct ast_trans_pvt *) 0x0
245
#14 0x40751332 in streamconfthread (args=0x8180bf8) at app_meetme.c:1965
247
#15 0xbcdffbe0 in ?? ()
248
No symbol table info available.
249
#16 0x40028e51 in pthread_start_thread () from /lib/libpthread.so.0
250
No symbol table info available.
251
#17 0x401ec92a in clone () from /lib/libc.so.6
252
No symbol table info available.
254
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
258
We also need gdb's output. That output gives more details compared to
259
the simple "bt". So we recommend that you use bt full instead of bt.
260
But, if you could include both, we appreciate that.
263
The final "extraction" would be to know all traces by all
264
threads. Even if asterisk runs on the same thread for each call, it
265
could have created some new threads.
268
To make sure we have the correct information, just do:
269
(gdb) thread apply all bt
275
Thread 1 (process 26252):
276
#0 0x29b45d7e in ?? ()
277
#1 0x08180bf8 in ?? ()
278
#2 0xbcdffa58 in ?? ()
279
#3 0x08180bf8 in ?? ()
280
#4 0xbcdffa60 in ?? ()
281
#5 0x08180bf8 in ?? ()
282
#6 0x180bf894 in ?? ()
283
#7 0x0bf80008 in ?? ()
284
#8 0x180b0818 in ?? ()
285
#9 0x08068008 in ast_stopstream (tmp=0x40758d38) at file.c:180
286
#10 0x000000a0 in ?? ()
287
#11 0x000000a0 in ?? ()
288
#12 0x00000000 in ?? ()
289
#13 0x407513c3 in confcall_careful_stream (conf=0x8180bf8, filename=0x8181de8 "DAHDI/pseudo-1324221520") at app_meetme.c:262
290
#14 0x40751332 in streamconfthread (args=0x8180bf8) at app_meetme.c:1965
291
#15 0xbcdffbe0 in ?? ()
292
#16 0x40028e51 in pthread_start_thread () from /lib/libpthread.so.0
293
#17 0x401ec92a in clone () from /lib/libc.so.6
295
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
299
That output tells us crucial information about each thread.
302
Now, just create an output.txt file and dump your "bt full"
303
(and/or "bt") ALONG WITH "thread apply all bt" into it.
306
Note: Please ATTACH your output, DO NOT paste it as a note.
309
And you're ready for upload on the bug tracker.
312
If you have questions or comments regarding this documentation, feel
313
free to pass by the #asterisk-bugs channel on irc.freenode.net.
317
<DIV CLASS="navigation"><HR>
318
<!--Navigation Panel-->
319
<A NAME="tex2html4336"
321
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
322
SRC="/usr/share/latex2html/icons/next.png"></A>
323
<A NAME="tex2html4332"
325
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
326
SRC="/usr/share/latex2html/icons/up.png"></A>
327
<A NAME="tex2html4328"
329
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
330
SRC="/usr/share/latex2html/icons/prev.png"></A>
331
<A NAME="tex2html4334"
333
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
334
SRC="/usr/share/latex2html/icons/contents.png"></A>
336
<B> Next:</B> <A NAME="tex2html4337"
337
HREF="node283.html">About this document ...</A>
338
<B> Up:</B> <A NAME="tex2html4333"
339
HREF="node281.html">Development</A>
340
<B> Previous:</B> <A NAME="tex2html4329"
341
HREF="node281.html">Development</A>
342
<B> <A NAME="tex2html4335"
343
HREF="node1.html">Contents</A></B> </DIV>
344
<!--End of Navigation Panel-->
63
<!--Table of Child-Links-->
64
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
66
<UL CLASS="ChildLinks">
67
<LI><A NAME="tex2html4342"
68
HREF="node283.html">Backtrace</A>
70
<!--End of Table of Child-Links-->