hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/Documentation/admin-guide/bug-hunting.rst
....@@ -49,15 +49,19 @@
4949
5050 Despite being an **Oops** or some other sort of stack trace, the offended
5151 line is usually required to identify and handle the bug. Along this chapter,
52
-we'll refer to "Oops" for all kinds of stack traces that need to be analized.
52
+we'll refer to "Oops" for all kinds of stack traces that need to be analyzed.
5353
54
-.. note::
54
+If the kernel is compiled with ``CONFIG_DEBUG_INFO``, you can enhance the
55
+quality of the stack trace by using file:`scripts/decode_stacktrace.sh`.
5556
56
- ``ksymoops`` is useless on 2.6 or upper. Please use the Oops in its original
57
- format (from ``dmesg``, etc). Ignore any references in this or other docs to
58
- "decoding the Oops" or "running it through ksymoops".
59
- If you post an Oops from 2.6+ that has been run through ``ksymoops``,
60
- people will just tell you to repost it.
57
+Modules linked in
58
+-----------------
59
+
60
+Modules that are tainted or are being loaded or unloaded are marked with
61
+"(...)", where the taint flags are described in
62
+file:`Documentation/admin-guide/tainted-kernels.rst`, "being loaded" is
63
+annotated with "+", and "being unloaded" is annotated with "-".
64
+
6165
6266 Where is the Oops message is located?
6367 -------------------------------------
....@@ -71,7 +75,7 @@
7175 Sometimes ``klogd`` dies, in which case you can run ``dmesg > file`` to
7276 read the data from the kernel buffers and save it. Or you can
7377 ``cat /proc/kmsg > file``, however you have to break in to stop the transfer,
74
-``kmsg`` is a "never ending file".
78
+since ``kmsg`` is a "never ending file".
7579
7680 If the machine has crashed so badly that you cannot enter commands or
7781 the disk is not available then you have three options:
....@@ -81,18 +85,18 @@
8185 planned for a crash. Alternatively, you can take a picture of
8286 the screen with a digital camera - not nice, but better than
8387 nothing. If the messages scroll off the top of the console, you
84
- may find that booting with a higher resolution (eg, ``vga=791``)
88
+ may find that booting with a higher resolution (e.g., ``vga=791``)
8589 will allow you to read more of the text. (Caveat: This needs ``vesafb``,
86
- so won't help for 'early' oopses)
90
+ so won't help for 'early' oopses.)
8791
8892 (2) Boot with a serial console (see
8993 :ref:`Documentation/admin-guide/serial-console.rst <serial_console>`),
9094 run a null modem to a second machine and capture the output there
9195 using your favourite communication program. Minicom works well.
9296
93
-(3) Use Kdump (see Documentation/kdump/kdump.txt),
97
+(3) Use Kdump (see Documentation/admin-guide/kdump/kdump.rst),
9498 extract the kernel ring buffer from old memory with using dmesg
95
- gdbmacro in Documentation/kdump/gdbmacros.txt.
99
+ gdbmacro in Documentation/admin-guide/kdump/gdbmacros.txt.
96100
97101 Finding the bug's location
98102 --------------------------
....@@ -104,7 +108,7 @@
104108 gdb
105109 ^^^
106110
107
-The GNU debug (``gdb``) is the best way to figure out the exact file and line
111
+The GNU debugger (``gdb``) is the best way to figure out the exact file and line
108112 number of the OOPS from the ``vmlinux`` file.
109113
110114 The usage of gdb works best on a kernel compiled with ``CONFIG_DEBUG_INFO``.
....@@ -165,7 +169,7 @@
165169 [<ffffffff8802770b>] :jbd:journal_stop+0x1be/0x1ee
166170 ...
167171
168
-this shows the problem likely in the :jbd: module. You can load that module
172
+this shows the problem likely is in the :jbd: module. You can load that module
169173 in gdb and list the relevant code::
170174
171175 $ gdb fs/jbd/jbd.ko
....@@ -199,8 +203,9 @@
199203 You need to be at the top level of the kernel tree for this to pick up
200204 your C files.
201205
202
-If you don't have access to the code you can also debug on some crash dumps
203
-e.g. crash dump output as shown by Dave Miller::
206
+If you don't have access to the source code you can still debug some crash
207
+dumps using the following method (example crash dump output as shown by
208
+Dave Miller)::
204209
205210 EIP is at +0x14/0x4c0
206211 ...
....@@ -230,6 +235,9 @@
230235 mov 0x8(%ebp), %ebx ! %ebx = skb->sk
231236 mov 0x13c(%ebx), %eax ! %eax = inet_sk(sk)->opt
232237
238
+file:`scripts/decodecode` can be used to automate most of this, depending
239
+on what CPU architecture is being debugged.
240
+
233241 Reporting the bug
234242 -----------------
235243
....@@ -241,7 +249,7 @@
241249 the ``get_maintainer.pl`` script.
242250
243251 For example, if you find a bug at the gspca's sonixj.c file, you can get
244
-their maintainers with::
252
+its maintainers with::
245253
246254 $ ./scripts/get_maintainer.pl -f drivers/media/usb/gspca/sonixj.c
247255 Hans Verkuil <hverkuil@xs4all.nl> (odd fixer:GSPCA USB WEBCAM DRIVER,commit_signer:1/1=100%)
....@@ -253,16 +261,17 @@
253261
254262 Please notice that it will point to:
255263
256
-- The last developers that touched on the source code. On the above example,
257
- Tejun and Bhaktipriya (in this specific case, none really envolved on the
258
- development of this file);
264
+- The last developers that touched the source code (if this is done inside
265
+ a git tree). On the above example, Tejun and Bhaktipriya (in this
266
+ specific case, none really envolved on the development of this file);
259267 - The driver maintainer (Hans Verkuil);
260268 - The subsystem maintainer (Mauro Carvalho Chehab);
261269 - The driver and/or subsystem mailing list (linux-media@vger.kernel.org);
262270 - the Linux Kernel mailing list (linux-kernel@vger.kernel.org).
263271
264272 Usually, the fastest way to have your bug fixed is to report it to mailing
265
-list used for the development of the code (linux-media ML) copying the driver maintainer (Hans).
273
+list used for the development of the code (linux-media ML) copying the
274
+driver maintainer (Hans).
266275
267276 If you are totally stumped as to whom to send the report, and
268277 ``get_maintainer.pl`` didn't provide you anything useful, send it to
....@@ -303,9 +312,9 @@
303312 and forwarded to the kernel developers.
304313
305314 Two types of address resolution are performed by ``klogd``. The first is
306
-static translation and the second is dynamic translation. Static
307
-translation uses the System.map file in much the same manner that
308
-ksymoops does. In order to do static translation the ``klogd`` daemon
315
+static translation and the second is dynamic translation.
316
+Static translation uses the System.map file.
317
+In order to do static translation the ``klogd`` daemon
309318 must be able to find a system map file at daemon initialization time.
310319 See the klogd man page for information on how ``klogd`` searches for map
311320 files.