-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrash_whitepaper.html
4733 lines (4165 loc) · 153 KB
/
crash_whitepaper.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- HISTORY:
2008-01-24 MARK YARBOROUGH - Brute force single page
-Started with Dave Anderson's updated 2008 version
-Concatenated main pages into single file
-Converted table of content links to internal anchors
-NOTE: some links (like help files) are still relative
to Dave's people page and will therefore fail if this
page is not viewed in a similar directory tree....
-->
<html>
<head>
<!-- MAIN BODY TABLE is nested for scalability -->
<a name="toc"><h1>White Paper: Crash Utility</h1></a>
<p>by David Anderson</p>
<p>Copyright © 2003, 2008, 2022 by Red Hat, Inc.<br />
Copyright © 2022 by NEC Corporation</p>
<p>
Permission is granted to copy, distribute and/or modify this document under the terms of<br>
the GNU Free Documentation License, Version 1.2 or any later version published by the<br>
Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.<br>
A copy of the license is included in the section entitled "GNU Free Documentation License".
</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/img/pixel.gif" width="1" height="10" border="0" alt="" /></td>
</tr>
<tr>
<td bgcolor="#666666"><img src="/img/pixel.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr>
<td><img src="/img/pixel.gif" width="1" height="10" border="0" alt="" /></td>
</tr>
</table>
<h3>Content</h3>
<ol>
<li><a href="#WHY_CRASH" class="bluelinkbold">Why Crash?</a></li>
<li><a href="#PREREQUISITES" class="bluelinkbold">Prerequisites</a></li>
<li><a href="#BUILD_PROCEDURE" class="bluelinkbold">Build Procedure</a></li>
<li><a href="#INVOCATION" class="bluelinkbold">Invocation</a></li>
<li><a href="#COMMAND_LINE" class="bluelinkbold">Command Input</a></li>
<li><a href="#COMMAND_OUTPUT" class="bluelinkbold">Command Output</a></li>
<li><a href="#CRASH_CONTEXT" class="bluelinkbold">Crash Context</a></li>
<li><a href="#HELP" class="bluelinkbold">Builtin Help</a></li>
<li><a href="#COMMAND_SET" class="bluelinkbold">The Command Set</a></li>
<li><a href="#EXAMPLES" class="bluelinkbold">Crash Usage: A Case Study</a></li>
<li><a href="#EXTENSIONS" class="bluelinkbold">Command Extensions</a></li>
<li><a href="#GFDL" class="bluelinkbold">GNU Free Documentation License</a></li>
</ol>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="/img/pixel.gif" width="1" height="10" border="0" alt="" /></td>
</tr>
<tr>
<td bgcolor="#666666"><img src="/img/pixel.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr>
<td><img src="/img/pixel.gif" width="1" height="10" border="0" alt="" /></td>
</tr>
</table>
<a name="SUPPORTED"></a>
<h3>Abstract</h3>
<p>
The <tt>crash</tt> analysis utility is loosely based on the SVR4 UNIX <tt>crash</tt> command,
but has been significantly enhanced by completely merging it with the GNU <tt>gdb</tt> debugger. The marriage of the two effectively
combines the kernel-specific nature of the traditional UNIX <tt>crash</tt> utility with the source code
level debugging capabilities of <tt>gdb</tt>. The utility can be used to investigate:
<ul>
<li>Live Linux systems</a></li>
<li>Linux kernel core dumps created by the Kdump facility</li>
<li>Compressed Linux kernel core dumps created by the makedumpfile command (from kdump dumpfiles)</li>
<li>Linux kernel core dumps created from by the Red Hat Netdump facility</li>
<li>Linux kernel core dumps created from by the Red Hat Diskdump facility</li>
<li>Compressed Linux kernel core dumps created by the Red Hat Diskdump facility</li>
<li>Xen host Linux kernel core dumps created by the Kdump facility</li>
<li>Xen guest Linux kernel core dumps created by the original xendump facility</li>
<li>Xen guest Linux kernel core dumps created by the ELF-format xendump facility</li>
<li>Xen hypervisor core dumps created by the Kdump facility</li>
<li>KVM guest Linux kernel core dumps created by the <tt>virsh dump</tt> facility</li>
<li>s390 Linux kernel core dumps created by the IBM standalone core dump facility.
<li>s390x Linux kernel core dumps created by the IBM standalone core dump facility.
<li>Linux kernel core dumps created by the LKCD (Linux Kernel Crash Dumps) Sourceforge project</li>
<li>Linux kernel core dumps created by the Mcore patch offered by Mission Critical Linux</li>
</ul>
The current set of commands consist of common kernel core analysis tools such as
kernel stack back traces of all processes, source code disassembly, formatted
kernel structure and variable displays, virtual memory data, dumps of linked-lists, etc.,
along with several commands that delve deeper into specific kernel subsystems.
Relevant <tt>gdb</tt> commands may also be entered, which in turn are passed on to the
<tt>gdb</tt> module for execution.
<p>
The <tt>crash</tt> utility is designed to be independent of Linux version dependencies.
When new kernel source code impacts the correct functionality of <tt>crash</tt> and its
command set, the utility will be updated to recognize new kernel code changes
while maintaining backwards compatibility with earlier releases.
The most current version of the <tt>crash</tt> utility may be found
here: <a href="https://crash-utility.github.io/">https://crash-utility.github.io/</a>
<p><br>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<a name="WHY_CRASH"></a> <hr> <p>
<h3>Why Crash?</h3>
<p>
The Linux operating system originally lacked a built-in, traditional UNIX-like kernel crash dump facility.
This was initially addressed by the Mission Critical Linux Mcore kernel patch and
the LKCD (Linux Kernel Crash Dump) kernel patch from SGI in 1999, and later
by the Red Hat Netdump facility in 2002, and the Red hat Diskdump facility in 2004.
The upstream Linux community finally settled
upon the adoption of the Kdump crash dump facility in 2006.
<p>However, the creation of a kernel crash dump
file is only half of the picture; a utility is required to be
able to recognize the dumpfile format in order to read it, and to offer a useful set of commands
to make sense of it.
</p>
<p>Furthermore, to examine the contents of a live system's kernel internals
from user space, the only readily available
option has been to use <tt>gdb</tt> on <tt>/proc/kcore</tt>.
While <tt>gdb</tt> is an incredibly powerful tool, it is designed to
debug user programs, and is not at all "kernel-aware".
Consequently, using <tt>gdb</tt>
alone has limited usefulness when looking at kernel memory,
essentially constrained to the printing
of kernel data structures <b><i>if</i></b> the <tt>vmlinux</tt> file was built with
the <tt>-g</tt> C flag, the disassembly of kernel text, and raw
data dumps. Furthermore, distributions such as Red Hat Enterprise Linux
have limited the access to <tt>/proc/kcore</tt>, making it unusable
as a kernel memory source.
</p>
<p>As far as kernel crash dump files are concerned,
the Red Hat Netdump and uncompressed Diskdump facilities, and the Kdump facility create
dump files that <b><i>are</i></b> readable by <tt>gdb</tt>, but aside from giving it the
capability of displaying the panicking task's stack trace, it has
the same constraints as when reading <tt>/proc/kcore</tt>.
However, <tt>gdb</tt> cannot read LKCD, Mcore, Xen or s390/s390x dump files.
</p>
<p>
That being the state of things, the <tt>crash</tt> utility was developed as a
convenient means to cover all bases, i.e., all listed
<a href="#SUPPORTED" class="bluelinkbold">dumpfile formats</a>
as well as live systems. Moreover, it is also designed to be
easily enhanced to suit the specific needs of the kernel developers or analysts
using it; the builtin command set can easily be extended or enhanced, and
external command modules may be written and dynamically attached.
</p>
<p><br>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<a name="PREREQUISITES"></a> <hr> <p>
<p>
<h3>Prerequisites</h3>
<p>The <tt>crash</tt> utility has the following prerequisites:</p>
<blockquote>
<dl>
<dt><b>kernel object file:</b></dt>
<dd><br>
A <tt>vmlinux</tt> kernel object file, often referred to as the <i>namelist</i> in this document, which
<b><i>must</i></b> have been built with
the <tt>-g</tt> C flag so that it will contain the debug data
required for symbolic debugging.
<p>
In RHEL3 installations, the <tt>vmlinux</tt> file associated with the running kernel is
split into two files, a stripped version found in the <tt>/boot</tt> directory; which has
have the operating system release string appended to it, for example,
<tt>vmlinux-2.4.21-4.ELsmp</tt>. The stripped file in <tt>/boot</tt> contains a link
to its associated debuginfo file, which is located in the <tt>/usr/lib/debug/boot</tt>
directory.
<p>In RHEL4, RHEL5 and RHEL6 installations, the <tt>vmlinux</tt> file
is part of the kernel debuginfo package, and is found in the relevant
<tt>/usr/lib/debug/lib/modules/<release></tt> directory.
<p>
Ideally the kernel object file
is the same kernel object file that is associated with the memory
image. However, in circumstances where the <tt>vmlinux</tt> file
associated with the crash dump or live system was <b><i>not</i></b> built
with the <tt>-g</tt> flag, there are work-arounds discussed later in the
<a href="#NODASHG" class="bluelinkbold">Invocation</a> section.
</dd>
<dt><br><b>memory image:</b></dt>
<dd><br>
This may consist of a kernel crash dump file generated from
any of the <a href="#SUPPORTED" class="bluelinkbold">supported dump facilties</a>, or
live system memory accessed via <tt>/dev/mem</tt> or its replacement in RHEL4/RHEL5/RHEL6, the <tt>/dev/crash</tt> driver.
If no dump file argument is issued on the <tt>crash</tt> command line,
live system memory will be used by default. When examining a live
system, root privileges are required.
</dd>
<dt><br><b>platform processor types:</b></dt>
<dd><br>
The <tt>crash</tt> utility is actively developed and tested on the
x86, x86_64, ia64, ppc64, arm, s390 and s390x processors. Legacy support for the Alpha and 32-bit PowerPC
platforms exists, but no longer actively maintained.
</dd>
<dt><br><b>Linux kernel versions:</b></dt>
<dd><br>
The <tt>crash</tt> utility is backwards-compatible to at least
Red Hat 6.0 (Linux version 2.2.5-15), up to Red Hat
Enterprise Linux 5 (Linux version 2.6.18+).
Due to the constantly shifting sands of the upstream kernel internals, immediate
support for the latest kernel versions cannot be guaranteed. However,
modifications are constantly being
implemented to support changes in upstream kernel versions.
The intent has always been to make the utility independent of Linux version dependencies,
building in recognition of major kernel code changes so as to adapt to
new kernel versions, while maintaining backwards compatibility.
</dd>
</dl>
</blockquote>
<p><br></p>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<a name="BUILD_PROCEDURE"></a> <hr> <p>
<p>
<h3>Build Procedure</h3>
<p>Starting with the RHEL3 release, the <tt>crash</tt> utility
is automatically installed during system installation if the
<b>Development Tools</b> package set is selected. However, for all other
kernel versions, or if it was not selected during system installation,
the binary RPM can be installed, or if desired, the sources re-built and installed.
<p>
If the <tt>crash</tt> utility is not pre-installed, and if all dependencies
are met on the target system, install the binary RPM like so:
<p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# <b>rpm -ivh crash-4.0-8.11.i386.rpm</b>
Preparing... ########################################### [100%]
1:crash ########################################### [100%]
#
</pre>
</td>
</tr>
</table>
<p>The <tt>crash</tt> executable will be installed in the
<tt>/usr/bin</tt> directory.
<p>
Alternatively, the <tt>crash</tt> source code can be rebuilt.
The <tt>crash</tt> utility's source files come packaged in two typical
formats,
a <a href="#TAR_GZ">compressed tar image</a>.
or a <a href="#SRC_RPM">source RPM file</a>,
So, for example,
<tt>crash</tt> version 4.0-8.11 can be built from either
<tt>crash-4.0-8.11.tar.gz</tt> or
<tt>crash-4.0-8.11.src.rpm</tt>.
<p>
The latest "upstream" version of the <tt>crash</tt> utility,
available in both file formats, can be found
here: <a href="https://crash-utility.github.io/">https://crash-utility.github.io/</a>
<p>
In either case, the source file layout consists of a top-level directory
containing a set of <tt>crash</tt>-specific files, a compressed tar image
containing the full, unmodified, <tt>gdb</tt> source tree,
and a small number of modified <tt>gdb</tt> files required to merge the
two entities. The build
procedure does the following:
<ol>
<li>the unmodified <tt>gdb</tt> sources are extracted into a subdirectory of the
top-level <tt>crash</tt> source directory, and overlayed by the small set
of modified <tt>gdb</tt> files.
</li>
<li>the files in the <tt>gdb</tt> source tree are built first, creating the
<tt>libbfd.a</tt>, <tt>libreadline.a</tt>, <tt>libopcodes.a</tt>,
<tt>libiberty.a</tt> and <tt>libgdb.a</tt> libraries.
</li>
<li>the <tt>crash</tt> sources files in the top-level directory are
then compiled into a <tt>crashlib.a</tt> library.
</li>
<li>the objects are all linked into the <tt>crash</tt> executable,
located in the top-level directory.
</ol>
Depending upon the speed of the host system, the complete build may take
several minutes, primarily due to the time consumed by the build of
the <tt>gdb</tt> portion.
</p>
<a name="TAR_GZ"><hr></a>
<h4>Building from the tar image</h4>
<p>
To build from the compressed tar image, simply uncompress/extract the
source files, <tt>cd</tt> into the resultant source directory,
and enter <tt>make</tt>:
<p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# <b>tar xvzmf crash-4.0-8.11.tar.gz</b>
crash-4.0-8.11/
crash-4.0-8.11/main.c
crash-4.0-8.11/tools.c
crash-4.0-8.11/global_data.c
crash-4.0-8.11/memory.c
crash-4.0-8.11/filesys.c
crash-4.0-8.11/help.c
crash-4.0-8.11/task.c
crash-4.0-8.11/kernel.c
crash-4.0-8.11/test.c
crash-4.0-8.11/gdb_interface.c
crash-4.0-8.11/configure.c
crash-4.0-8.11/net.c
crash-4.0-8.11/dev.c
crash-4.0-8.11/alpha.c
crash-4.0-8.11/x86.c
crash-4.0-8.11/ppc.c
crash-4.0-8.11/ia64.c
crash-4.0-8.11/s390.c
crash-4.0-8.11/s390x.c
crash-4.0-8.11/s390dbf.c
crash-4.0-8.11/ppc64.c
crash-4.0-8.11/x86_64.c
crash-4.0-8.11/extensions.c
crash-4.0-8.11/remote.c
crash-4.0-8.11/va_server.c
crash-4.0-8.11/va_server_v1.c
crash-4.0-8.11/symbols.c
crash-4.0-8.11/cmdline.c
crash-4.0-8.11/lkcd_common.c
crash-4.0-8.11/lkcd_v1.c
crash-4.0-8.11/lkcd_v2_v3.c
crash-4.0-8.11/lkcd_v5.c
crash-4.0-8.11/lkcd_v7.c
crash-4.0-8.11/lkcd_v8.c
crash-4.0-8.11/lkcd_fix_mem.c
crash-4.0-8.11/s390_dump.c
crash-4.0-8.11/lkcd_x86_trace.c
crash-4.0-8.11/netdump.c
crash-4.0-8.11/diskdump.c
crash-4.0-8.11/xendump.c
crash-4.0-8.11/unwind.c
crash-4.0-8.11/unwind_decoder.c
crash-4.0-8.11/unwind_x86_32_64.c
crash-4.0-8.11/xen_hyper.c
crash-4.0-8.11/xen_hyper_command.c
crash-4.0-8.11/xen_hyper_global_data.c
crash-4.0-8.11/xen_hyper_dump_tables.c
crash-4.0-8.11/defs.h
crash-4.0-8.11/xen_hyper_defs.h
crash-4.0-8.11/va_server.h
crash-4.0-8.11/vas_crash.h
crash-4.0-8.11/netdump.h
crash-4.0-8.11/diskdump.h
crash-4.0-8.11/xendump.h
crash-4.0-8.11/unwind.h
crash-4.0-8.11/unwind_i.h
crash-4.0-8.11/rse.h
crash-4.0-8.11/unwind_x86.h
crash-4.0-8.11/unwind_x86_64.h
crash-4.0-8.11/lkcd_vmdump_v1.h
crash-4.0-8.11/lkcd_vmdump_v2_v3.h
crash-4.0-8.11/lkcd_dump_v5.h
crash-4.0-8.11/lkcd_dump_v7.h
crash-4.0-8.11/lkcd_dump_v8.h
crash-4.0-8.11/lkcd_x86_trace.h
crash-4.0-8.11/lkcd_fix_mem.h
crash-4.0-8.11/ibm_common.h
crash-4.0-8.11/Makefile
crash-4.0-8.11/gdb-6.1/
crash-4.0-8.11/gdb-6.1/gdb/
crash-4.0-8.11/gdb-6.1/gdb/Makefile.in
crash-4.0-8.11/gdb-6.1/gdb/main.c
crash-4.0-8.11/gdb-6.1/gdb/symtab.c
crash-4.0-8.11/gdb-6.1/gdb/target.c
crash-4.0-8.11/gdb-6.1/gdb/symfile.c
crash-4.0-8.11/gdb-6.1/gdb/elfread.c
crash-4.0-8.11/gdb-6.1/gdb/ui-file.c
crash-4.0-8.11/gdb-6.1/gdb/utils.c
crash-4.0-8.11/gdb-6.1/gdb/dwarf2read.c
crash-4.0-8.11/gdb-6.1/gdb/ppc-linux-tdep.c
crash-4.0-8.11/gdb-6.1/Makefile.in
crash-4.0-8.11/gdb-6.1/include/
crash-4.0-8.11/gdb-6.1/include/obstack.h
crash-4.0-8.11/gdb-6.1.patch
crash-4.0-8.11/COPYING
crash-4.0-8.11/.rh_rpm_package
crash-4.0-8.11/crash.8
crash-4.0-8.11/extensions/
crash-4.0-8.11/extensions/Makefile
crash-4.0-8.11/extensions/echo.c
crash-4.0-8.11/extensions/dminfo.c
crash-4.0-8.11/extensions/libsial/
crash-4.0-8.11/extensions/libsial/Makefile
crash-4.0-8.11/extensions/libsial/mkbaseop.c
crash-4.0-8.11/extensions/libsial/README
crash-4.0-8.11/extensions/libsial/README.sial
crash-4.0-8.11/extensions/libsial/sial_alloc.c
crash-4.0-8.11/extensions/libsial/sial_api.c
crash-4.0-8.11/extensions/libsial/sial_api.h
crash-4.0-8.11/extensions/libsial/sial_builtin.c
crash-4.0-8.11/extensions/libsial/sial_case.c
crash-4.0-8.11/extensions/libsial/sial_define.c
crash-4.0-8.11/extensions/libsial/sial_func.c
crash-4.0-8.11/extensions/libsial/sial.h
crash-4.0-8.11/extensions/libsial/sial_input.c
crash-4.0-8.11/extensions/libsial/sial.l
crash-4.0-8.11/extensions/libsial/sial-lsed
crash-4.0-8.11/extensions/libsial/sial_member.c
crash-4.0-8.11/extensions/libsial/sial_node.c
crash-4.0-8.11/extensions/libsial/sial_num.c
crash-4.0-8.11/extensions/libsial/sial_op.c
crash-4.0-8.11/extensions/libsial/sialpp.l
crash-4.0-8.11/extensions/libsial/sialpp-lsed
crash-4.0-8.11/extensions/libsial/sialpp.y
crash-4.0-8.11/extensions/libsial/sial_print.c
crash-4.0-8.11/extensions/libsial/sial_stat.c
crash-4.0-8.11/extensions/libsial/sial_str.c
crash-4.0-8.11/extensions/libsial/sial_type.c
crash-4.0-8.11/extensions/libsial/sial_util.c
crash-4.0-8.11/extensions/libsial/sial_var.c
crash-4.0-8.11/extensions/libsial/sial.y
crash-4.0-8.11/extensions/sial.c
crash-4.0-8.11/extensions/sial.mk
crash-4.0-8.11/gdb-6.1.tar.gz
crash-4.0-8.11/README
# <b>cd crash-4.0-8.11</b>
# <b>make</b>
TARGET: X86
CRASH: 4.0-8.11
GDB: 6.1
gdb-6.1/gdb/CONTRIBUTE
gdb-6.1/gdb/COPYING
gdb-6.1/gdb/ChangeLog
gdb-6.1/gdb/ChangeLog-1990
gdb-6.1/gdb/ChangeLog-1991
gdb-6.1/gdb/ChangeLog-1992
gdb-6.1/gdb/ChangeLog-1993
gdb-6.1/gdb/ChangeLog-1994
gdb-6.1/gdb/ChangeLog-1995
gdb-6.1/gdb/ChangeLog-1996
gdb-6.1/gdb/ChangeLog-1997
gdb-6.1/gdb/ChangeLog-1998
gdb-6.1/gdb/ChangeLog-1999
gdb-6.1/gdb/ChangeLog-2000
gdb-6.1/gdb/ChangeLog-2001
gdb-6.1/gdb/ChangeLog-2002
gdb-6.1/gdb/ChangeLog-2003
gdb-6.1/gdb/ChangeLog-3.x
gdb-6.1/gdb/MAINTAINERS
gdb-6.1/gdb/NEWS
gdb-6.1/gdb/PROBLEMS
gdb-6.1/gdb/README
gdb-6.1/gdb/TODO
gdb-6.1/gdb/abug-rom.c
gdb-6.1/gdb/acconfig.h
gdb-6.1/gdb/acinclude.m4
gdb-6.1/gdb/aclocal.m4
gdb-6.1/gdb/ada-exp.y
gdb-6.1/gdb/ada-lang.c
gdb-6.1/gdb/ada-lang.h
<i>(complete output not shown)</i>
ar -rs crashlib.a main.o tools.o global_data.o memory.o filesys.o help.o task.o
build_data.o kernel.o test.o gdb_interface.o net.o dev.o alpha.o x86.o ppc.o ia6
4.o s390.o s390x.o s390dbf.o ppc64.o x86_64.o extensions.o remote.o va_server.o
va_server_v1.o symbols.o cmdline.o lkcd_common.o lkcd_v1.o lkcd_v2_v3.o lkcd_v5.
o lkcd_v7.o lkcd_v8.o lkcd_fix_mem.o s390_dump.o netdump.o diskdump.o xendump.o
lkcd_x86_trace.o unwind_v1.o unwind_v2.o unwind_v3.o unwind_x86_32_64.o xen_hype
r.o xen_hyper_command.o xen_hyper_global_data.o xen_hyper_dump_tables.o
ar: creating crashlib.a
gcc -g -O2 \
-o `cat mergeobj` libgdb.a \
../bfd/libbfd.a ../readline/libreadline.a ../opcodes/libopcod
es.a ../libiberty/libiberty.a -lm -lncurses ../libiberty/libiberty.a -ldl
-rdynamic `cat mergelibs`
#
</pre>
</td>
</tr>
</table>
<p>The resultant <tt>crash</tt> executable will be located in the
top-level source directory. Install it in <tt>/usr/bin</tt>
by entering:
<p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# <b>make install</b>
/usr/bin/install crash /usr/bin
#
</pre>
</td>
</tr>
</table>
<a name="SRC_RPM"><hr></a>
<h4>Building from the source RPM</h4>
<p>
To build from the source RPM, install the <tt>crash-4.0-8.11.src.rpm</tt>,
<tt>cd</tt> to the appropriate <tt>SPECS</tt> directory,
and build the package:
<p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# <b>rpm -Uvh crash-4.0-8.11.src.rpm</b>
1:crash ########################################### [100%]
# <b>cd /usr/src/redhat/SPECS</b>
# <b>rpmbuild -ba crash.spec</b>
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.19005
+ umask 022
+ cd /usr/src/redhat/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /usr/src/redhat/BUILD
+ rm -rf crash-4.0-8.11
+ /bin/gzip -dc /usr/src/redhat/SOURCES/crash-4.0-8.11.tar.gz
+ tar -xvvf -
drwxr-xr-x root/root 0 2002-09-12 16:51:40 crash-4.0-8.11/
-rwxrwxr-x root/root 31916 2002-09-12 16:51:40 crash-4.0-8.11/main.c
-rwxrwxr-x root/root 103454 2002-09-12 16:51:40 crash-4.0-8.11/tools.c
-rwxrwxr-x root/root 5802 2002-09-12 16:51:40 crash-4.0-8.11/global_data.c
-rwxrwxr-x root/root 225343 2002-09-12 16:51:40 crash-4.0-8.11/memory.c
-rwxrwxr-x root/root 75492 2002-09-12 16:51:40 crash-4.0-8.11/filesys.c
-rwxrwxr-x root/root 211519 2002-09-12 16:51:40 crash-4.0-8.11/help.c
-rwxrwxr-x root/root 110604 2002-09-12 16:51:40 crash-4.0-8.11/task.c
-rwxrwxr-x root/root 101805 2002-09-12 16:51:40 crash-4.0-8.11/kernel.c
-rwxrwxr-x root/root 2198 2002-09-12 16:51:40 crash-4.0-8.11/test.c
-rwxrwxr-x root/root 18949 2002-09-12 16:51:40 crash-4.0-8.11/gdb_interface.c
-rwxrwxr-x root/root 20239 2002-09-12 16:51:40 crash-4.0-8.11/configure.c
-rwxrwxr-x root/root 29931 2002-09-12 16:51:40 crash-4.0-8.11/net.c
-rwxrwxr-x root/root 99654 2002-09-12 16:51:40 crash-4.0-8.11/dev.c
-rwxrwxr-x root/root 76146 2002-09-12 16:51:40 crash-4.0-8.11/alpha.c
-rwxrwxr-x root/root 74638 2002-09-12 16:51:40 crash-4.0-8.11/x86.c
-rwxrwxr-x root/root 42109 2002-09-12 16:51:40 crash-4.0-8.11/ppc.c
-rwxrwxr-x root/root 76357 2002-09-12 16:51:40 crash-4.0-8.11/ia64.c
<i>(complete output not shown)</i>
Requires: libc.so.6 libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.
2) libc.so.6(GLIBC_2.2.3) libc.so.6(GLIBC_2.3) libdl.so.2 libdl.so.2(GLIBC_2.0)
libdl.so.2(GLIBC_2.1) libm.so.6 libm.so.6(GLIBC_2.0) libncurses.so.5 libz.so.1
Processing files: crash-debuginfo-4.0-8.11
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHave
Prefix) <= 4.0-1
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/crash-root
Wrote: /usr/src/redhat/SRPMS/crash-4.0-8.11.src.rpm
<b>Wrote: /usr/src/redhat/RPMS/i386/crash-4.0-8.11.i386.rpm</b>
Wrote: /usr/src/redhat/RPMS/i386/crash-debuginfo-4.0-8.11.i386.rpm
#
</pre>
</td>
</tr>
</table>
<p>
Lastly, install the binary RPM, which copies the <tt>crash</tt>
executable to the <tt>/usr/bin</tt> directory:
<p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# <b>rpm -ivh /usr/src/redhat/RPMS/i386/crash-4.0-8.11.i386.rpm </b>
Preparing... ########################################### [100%]
1:crash
#
</pre>
</td>
</tr>
</table>
<br>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<a name="INVOCATION"></a> <hr> <p>
<p>
<h3>Invocation</h3>
<p>When <tt>crash</tt> is run on a dumpfile, at least two arguments are
always required:
<ol>
<li>
The kernel object filename, often referred to as the kernel <i><b>namelist</b></i>.
When initially built from the kernel sources, its name is <tt>vmlinux</tt>.
In RHEL3 installations, it is copied to the <tt>/boot</tt> directory, where the
operating system release number is appended, as in
<tt>vmlinux-2.4.21-4.ELsmp</tt>. In RHEL4, RHEL5 and RHEL6 installations, the <tt>vmlinux</tt> file
is part of the kernel debuginfo package, and is located in the relevant
<tt>/usr/lib/debug/lib/modules/<release></tt> directory.
</li>
<li>
The dumpfile name, typically named <tt>vmcore</tt>.
</li>
</ol>
For example, if both files are located in the current directory:
</p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# crash vmlinux vmcore
</pre>
</td>
</tr>
</table>
<p>
When <tt>crash</tt> is run on a live system, <tt>/dev/mem</tt> is used as the
memory image. In RHEL4, RHEL5 and RHEL6, the <tt>/dev/mem</tt> driver is restricted
on x86 and x86_64 systems, and is replaced by the <tt>/dev/crash</tt> driver.
In any case, only the kernel object filename is required:
</p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# crash vmlinux
</pre>
</td>
</tr>
</table>
<p>Furthermore, when <tt>crash</tt> is run on a live system,
the <tt>vmlinux</tt> argument is <b><i>not</i></b> required when the kernel
object file is located in any of the following locations:
<ul>
<li><tt>/boot</tt></li>
<li><tt>/usr/lib/debug/lib/modules/<<i>release</i>></li>
<li><tt>/</tt> (root directory)</li>
<li>any subdirectory of <tt>/usr/src</tt></li>
<li><tt>/usr/src/redhat/BUILD/kernel-</tt><i>x.x.x</i>/linux-<<i>release</i>></li>
</ul>
</tt>
<p>
When the <tt>vmlinux</tt> file is not entered on the command line, a search
will be made in all of the directories above until a kernel object file
is found that contains a version string that matches the running
kernel, as indicated by <tt>/proc/version</tt>.
If a matching kernel is found, then <tt>crash</tt> may be invoked on
a live system simply by entering:
</p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# crash
</pre>
</td>
</tr>
</table>
<p>In the examples above, it is presumed that the <tt>vmlinux</tt> kernel
has been built with the <tt>-g</tt> C flag, which traditionally has not
been done by default. To address this requirement, starting with Red Hat Enterprise Linux 3
(RHEL3), all RHEL kernels are
now built with <tt>-g</tt> C flag. The manner of accessing the
debug data for
<a href="#RHEL3DASHG">RHEL3</a>,
<a href="#RHEL4DASHG">RHEL4</a>,
<a href="#RHEL5DASHG">RHEL5</a> and
<a href="#RHEL6DASHG">RHEL6</a>
kernels is described in the following sections.
Unfortunately, since RHEL2.1 kernels are not built with <tt>-g</tt>, the
kernel must be rebuilt;
directions for rebuilding
<a href="help_pages/kernel_rebuild.html">RHEL2.1</a>
kernels can
be found
<a href="help_pages/kernel_rebuild.html">here.</a>
<h3><a name="RHEL3DASHG">RHEL3 Kernels</a></h3>
In RHEL3, the <tt>vmlinux</tt> kernel debug information is stripped
and stored in a separate debuginfo file.
The stripped <tt>vmlinux</tt> file in <tt>/boot</tt> has
an embedded link to its associated debuginfo file in
<tt>/usr/lib/debug/boot</tt>, so that the <tt>crash</tt> utility (and the
built-in <tt>gdb</tt> module) knows
where to find it:
<p>
<table border="2" width="100%" cellpadding="8">
<tr align="center">
<td>RHEL3 kernel namelist in <tt>/boot</tt></td>
<td>RHEL3 kernel debuginfo file in <tt>/usr/lib/debug/boot</tt></td>
</tr>
<tr>
<td>
<tt>vmlinux-</tt><i><release></i><tt>.EL</tt>
<br>
<tt>vmlinux-</tt><i><release></i><tt>.ELsmp</tt>
<br>
<tt>vmlinux-</tt><i><release></i><tt>.ELhugemem</tt>
</td>
<td>
<tt>vmlinux-</tt><i><release></i><tt>.EL.debug</tt>
<br>
<tt>vmlinux-</tt><i><release></i><tt>.ELsmp.debug</tt>
<br>
<tt>vmlinux-</tt><i><release></i><tt>.ELhugemem.debug</tt>
</td>
</td>
</tr>
</table>
<p>
The debuginfo files for a specific kernel <i><release></i> come from a
separate RPM that must be installed for the <tt>crash</tt>
utility to work. For example, the i686 RPM for the examples above would
be named <tt>kernel-debuginfo-</tt><i><release></i><tt>.i686.rpm</tt>,
and would install the debuginfo file for all three of the kernel flavors.
<p>
For example, to run <tt>crash</tt> on a live system, the associated
debuginfo package must be installed:
</p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# uname -r
2.4.21-4.ELsmp
# rpm -ivh kernel-debuginfo-2.4.21-4.EL.i686.rpm
Preparing... ########################################### [100%]
1:kernel-debuginfo ########################################### [100%]
# ls /usr/lib/debug/boot
vmlinux-2.4.21-4.EL.debug
vmlinux-2.4.21-4.ELhugemem.debug
vmlinux-2.4.21-4.ELsmp.debug
#
</pre>
</td>
</tr>
</table>
<p>
Accordingly, if the running kernel's <tt>vmlinux</tt>
file is in one the search locations above, <i><b>and</b></i> its associated
debuginfo file is located in
the <tt>/usr/lib/debug/boot</tt> directory <i><b>or</b></i> in the
current directory from which <tt>crash</tt> is invoked, no arguments
are required to run on a live system:
</p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# crash
</pre>
</td>
</tr>
</table>
<p>
However, if the linked debuginfo file is not in either of those locations,
it can be added to the <tt>crash</tt> command line along with the
<tt>vmlinux</tt> filename. So, for example, if the debuginfo file was
located in <tt>/tmp</tt>:
</p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# crash /boot/vmlinux-2.4.21-4.ELsmp /tmp/vmlinux-2.4.21-4.ELsmp.debug
</pre>
</td>
</tr>
</table>
<p>
For analyzing dumpfiles however, the <tt>vmlinux</tt> file name must be on the command
line along with the dumpfile name, as in the following examples:
</p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# crash /boot/vmlinux-2.4.21-4.ELsmp vmcore
</pre>
</td>
</tr>
</table>
<p>
or if the debuginfo file is not in the standard location:
</p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# crash /boot/vmlinux-2.4.21-4.ELsmp /tmp/vmlinux-2.4.21-4.ELsmp.debug vmcore
</pre>
</td>
</tr>
</table>
<p>
<h3><a name="RHEL4DASHG">RHEL4 Kernels</a></h3>
The procedure has been made much simpler for RHEL4 kernels. The kernel
is built with the <tt>-g</tt> flag, and the resultant <tt>vmlinux</tt>
file is stored in the associated debuginfo package.
After installing the debuginfo package, the <tt>vmlinux</tt> file for each kernel
flavor of a given RHEL4 release will be installed in the directory named:
</p>
<tt>/usr/lib/debug/lib/modules/<</tt><i>release</i>><<i>flavor</i>><tt>/vmlinux</tt>
<p>
where for i686 kernels,
<<i>flavor</i>> can be either <tt>hugemem</tt>, <tt>smp</tt>, or nothing (for uniprocessor
kernels). For example:
</p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# uname -r
2.6.9-6.39.ELsmp
# rpm -ivh kernel-debuginfo-2.6.9-6.39.EL.i686.rpm
Preparing... ########################################### [100%]
1:kernel-debuginfo ########################################### [100%]
#
# find /usr/lib/debug/lib/modules/2.6.9-6.39.EL* -name vmlinux
/usr/lib/debug/lib/modules/2.6.9-6.39.ELhugemem/vmlinux
/usr/lib/debug/lib/modules/2.6.9-6.39.ELsmp/vmlinux
/usr/lib/debug/lib/modules/2.6.9-6.39.EL/vmlinux
#
</pre>
</td>
</tr>
</table>
<p>
Once the debuginfo package is installed, <tt>crash</tt> can be invoked on the live system
with no arguments, because the <tt>vmlinux</tt> file will be found automatically:
</p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# crash
</pre>
</td>
</tr>
</table>
<p>
To run <tt>crash</tt> on a dumpfile, however, the appropriate <tt>vmlinux</tt>
file and the dumpfile name must both be on the command line, as in:
</p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# crash /usr/lib/debug/lib/modules/2.6.9-6.39.ELsmp/vmlinux vmcore
</pre>
</td>
</tr>
</table>
<p>
<h3><a name="RHEL5DASHG">RHEL5 Kernels</a></h3>
RHEL5 kernels are also built with the <tt>-g</tt> flag, and the resultant <tt>vmlinux</tt>
file is stored in an associated debuginfo package. Unlike RHEL4, the kernel debuginfo packages
are split into one package per flavor plus a "common" package user by all kernel flavors.
After installing the debuginfo package, the <tt>vmlinux</tt> file for each kernel
flavor of a given RHEL5 release will be installed in the directory named:
</p>
<tt>/usr/lib/debug/lib/modules/<</tt><i>release</i>><<i>flavor</i>><tt>/vmlinux</tt>
<p>
where for i686 kernels, there are 4 possible
<<i>flavor</i>>s, either <tt>PAE</tt>, <tt>xen</tt>, <tt>debug</tt>, or nothing
(for non-PAE SMP kernels). For example:
</p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# rpm -ivh kernel-debuginfo-2.6.18-66.el5.i686.rpm \
kernel-PAE-debuginfo-2.6.18-66.el5.i686.rpm \
kernel-xen-debuginfo-2.6.18-66.el5.i686.rpm \
kernel-debuginfo-common-2.6.18-66.el5.i686.rpm
Preparing... ########################################### [100%]
1:kernel-debuginfo-common########################################### [ 25%]
2:kernel-debuginfo ########################################### [ 50%]
3:kernel-PAE-debuginfo ########################################### [ 75%]
4:kernel-xen-debuginfo ########################################### [100%]
# find /usr/lib/debug/lib/modules/2.6.18-66.el5* -name vmlinux
/usr/lib/debug/lib/modules/2.6.18-66.el5/vmlinux
/usr/lib/debug/lib/modules/2.6.18-66.el5PAE/vmlinux
/usr/lib/debug/lib/modules/2.6.18-66.el5xen/vmlinux
#
</pre>
</td>
</tr>
</table>
<p>
Once the debuginfo package is installed, <tt>crash</tt> can be invoked on the live system
with no arguments, because the <tt>vmlinux</tt> file will be found automatically:
</p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# crash
</pre>
</td>
</tr>
</table>
<p>
To run <tt>crash</tt> on a dumpfile, however, the appropriate <tt>vmlinux</tt>
file and the dumpfile name must both be on the command line, as in:
</p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# crash /usr/lib/debug/lib/modules/2.6.18-66.el5/vmlinux vmcore
</pre>
</td>
</tr>
</table>
<h3><a name="RHEL6DASHG">RHEL6 Kernels</a></h3>
RHEL6 kernels are also built with the <tt>-g</tt> flag, and the resultant <tt>vmlinux</tt>
file is stored in an associated debuginfo package. Like RHEL5, the kernel debuginfo packages
are split into one package per flavor plus a "common" package user by all kernel flavors.
After installing the debuginfo package, the <tt>vmlinux</tt> file for each kernel
flavor of a given RHEL6 release will be installed in the directory named:
</p>
<tt>/usr/lib/debug/lib/modules/<</tt><i>release</i>><<i>flavor</i>><tt>/vmlinux</tt>
<p>
where for x86_64 kernels, there are only 2 possible
<<i>flavor</i>>s, either the standard kernel or the <tt>debug</tt> kernel. For example:
</p>
<table border="0" bgcolor="#E0E0E0" width="100%">
<tr>
<td>
<pre>
# rpm -ivh kernel-debuginfo-common-2.6.32-70.el6.x86_64.rpm \
kernel-debuginfo-2.6.32-70.el6.x86_64.rpm \
kernel-debug-debuginfo-2.6.32-70.el6.x86_64.rpm
Preparing... ########################################### [100%]