~damg/ubuntu/quantal/asterisk/LP1097687

« back to all changes in this revision

Viewing changes to doc/tex/asterisk/node282.html

  • Committer: Bazaar Package Importer
  • Author(s): Lorenzo De Liso
  • Date: 2010-10-15 22:24:34 UTC
  • mfrom: (1.2.8 upstream) (8.3.8 sid)
  • Revision ID: james.westby@ubuntu.com-20101015222434-iy328q8in3lajzlv
Tags: 1:1.6.2.9-2ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/control:
    + Build-depend on hardening-wrapper
    + Change Maintainer
    + Removed Uploaders field.
    + Removed Debian Vcs-Svn entry and replaced with ubuntu-voip Vcs-Bzr,
      to reflect divergence in packages.
  - debian/rules: Make use of hardening-wrapper
  - debian/asterisk.init: chown /dev/dahdi
  - debian/backports/hardy: add file
  - debian/backports/asterisk.init.hardy: add file
 

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
8
8
<HTML>
9
9
<HEAD>
10
 
<TITLE>Backtrace</TITLE>
11
 
<META NAME="description" CONTENT="Backtrace">
 
10
<TITLE>Development</TITLE>
 
11
<META NAME="description" CONTENT="Development">
12
12
<META NAME="keywords" CONTENT="asterisk">
13
13
<META NAME="resource-type" CONTENT="document">
14
14
<META NAME="distribution" CONTENT="global">
18
18
 
19
19
<LINK REL="STYLESHEET" HREF="asterisk.css">
20
20
 
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">
24
25
</HEAD>
25
26
 
26
27
<BODY >
27
28
 
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
 
  HREF="node281.html">
 
34
<A NAME="tex2html4336"
 
35
  HREF="asterisk.html">
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"
42
43
  HREF="node1.html">
43
44
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
44
45
 SRC="/usr/share/latex2html/icons/contents.png"></A>  
45
46
<BR>
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
 
 &nbsp; <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
 &nbsp; <B>  <A NAME="tex2html4339"
53
54
  HREF="node1.html">Contents</A></B> 
54
55
<BR>
55
56
<BR></DIV>
56
57
<!--End of Navigation Panel-->
57
58
 
58
 
<H1><A NAME="SECTION001610000000000000000">
59
 
Backtrace</A>
 
59
<H1><A NAME="SECTION001600000000000000000">
 
60
Development</A>
60
61
</H1>
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.
69
 
 
70
 
<P>
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.
73
 
 
74
 
<P>
75
 
If you start Asterisk with the safe_asterisk script, it automatically
76
 
starts using the option -g.
77
 
 
78
 
<P>
79
 
If you're not sure if Asterisk is running with the -g option, type the
80
 
following command in your shell:
81
 
 
82
 
<P>
83
 
</B></SMALL>
84
 
<UL>
85
 
<LI><PRE>
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
89
 
[...]
90
 
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
91
 
</LI>
92
 
</UL>
93
 
<P>
94
 
The interesting information is located in the last column.
95
 
 
96
 
<P>
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.
101
 
 
102
 
<P>
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:
106
 
 
107
 
<P>
108
 
</B></SMALL>
109
 
<UL>
110
 
<LI><PRE>
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
118
 
debian:/tmp#
119
 
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
120
 
</LI>
121
 
</UL>
122
 
<P>
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.
126
 
 
127
 
<P>
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.
131
 
 
132
 
<P>
133
 
<SPAN  CLASS="textbf">NOTE: Don't attach core files on the bug tracker, we only need the bt and bt full.</SPAN>
134
 
 
135
 
<P>
136
 
For extraction, we use a really nice tool, called gdb. To verify that
137
 
you have gdb installed on your system:
138
 
 
139
 
<P>
140
 
</B></SMALL>
141
 
<UL>
142
 
<LI><PRE>
143
 
debian:/tmp# gdb -v
144
 
GNU gdb 6.3-debian
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".
151
 
debian:/tmp#
152
 
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
153
 
</LI>
154
 
</UL>
155
 
<P>
156
 
Which is great, we can continue. If you don't have gdb installed, go install gdb.
157
 
 
158
 
<P>
159
 
Now load the core file in gdb, as follows:
160
 
 
161
 
<P>
162
 
</B></SMALL>
163
 
<UL>
164
 
<LI><PRE>
165
 
debian:/tmp# gdb asterisk /tmp/core.26252
166
 
[...]
167
 
(You would see a lot of output here.)
168
 
[...]
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 ?? ()
172
 
(gdb)
173
 
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
174
 
</LI>
175
 
</UL>
176
 
<P>
177
 
Now at the gdb prompt, type: bt
178
 
You would see output similar to:
179
 
 
180
 
<P>
181
 
</B></SMALL>
182
 
<UL>
183
 
<LI><PRE>
184
 
(gdb) bt
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
203
 
(gdb)
204
 
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
205
 
</LI>
206
 
</UL>
207
 
<P>
208
 
The bt's output is the information that we need on the bug tracker.
209
 
 
210
 
<P>
211
 
</B></SMALL>
212
 
<UL>
213
 
<LI><PRE>
214
 
Now do a bt full as follows:
215
 
(gdb) bt full
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
235
 
No locals.
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
246
 
No locals.
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.
253
 
(gdb)
254
 
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
255
 
</LI>
256
 
</UL>
257
 
<P>
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.
261
 
 
262
 
<P>
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.
266
 
 
267
 
<P>
268
 
To make sure we have the correct information, just do:
269
 
(gdb) thread apply all bt
270
 
 
271
 
<P>
272
 
</B></SMALL>
273
 
<UL>
274
 
<LI><PRE>
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
294
 
(gdb)
295
 
</PRE><SMALL CLASS="SCRIPTSIZE"><B>
296
 
</LI>
297
 
</UL>
298
 
<P>
299
 
That output tells us crucial information about each thread.
300
 
 
301
 
<P>
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.
304
 
 
305
 
<P>
306
 
Note: Please ATTACH your output, DO NOT paste it as a note.
307
 
 
308
 
<P>
309
 
And you're ready for upload on the bug tracker.
310
 
 
311
 
<P>
312
 
If you have questions or comments regarding this documentation, feel
313
 
free to pass by the #asterisk-bugs channel on irc.freenode.net.
314
 
 
315
 
<P>
316
 
 
317
 
<DIV CLASS="navigation"><HR>
318
 
<!--Navigation Panel-->
319
 
<A NAME="tex2html4336"
320
 
  HREF="node283.html">
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"
324
 
  HREF="node281.html">
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"
328
 
  HREF="node281.html">
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"
332
 
  HREF="node1.html">
333
 
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
334
 
 SRC="/usr/share/latex2html/icons/contents.png"></A>  
335
 
<BR>
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
 
 &nbsp; <B>  <A NAME="tex2html4335"
343
 
  HREF="node1.html">Contents</A></B> </DIV>
344
 
<!--End of Navigation Panel-->
 
62
  <BR><HR>
 
63
<!--Table of Child-Links-->
 
64
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
 
65
 
 
66
<UL CLASS="ChildLinks">
 
67
<LI><A NAME="tex2html4342"
 
68
  HREF="node283.html">Backtrace</A>
 
69
</UL>
 
70
<!--End of Table of Child-Links-->
 
71
<BR><HR>
345
72
<ADDRESS>
346
73
lmadsen
347
 
2010-05-03
 
74
2010-06-17
348
75
</ADDRESS>
349
76
</BODY>
350
77
</HTML>