xref: /OK3568_Linux_fs/kernel/Documentation/admin-guide/reporting-bugs.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. _reportingbugs:
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunReporting bugs
4*4882a593Smuzhiyun++++++++++++++
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunBackground
7*4882a593Smuzhiyun==========
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunThe upstream Linux kernel maintainers only fix bugs for specific kernel
10*4882a593Smuzhiyunversions.  Those versions include the current "release candidate" (or -rc)
11*4882a593Smuzhiyunkernel, any "stable" kernel versions, and any "long term" kernels.
12*4882a593Smuzhiyun
13*4882a593SmuzhiyunPlease see https://www.kernel.org/ for a list of supported kernels.  Any
14*4882a593Smuzhiyunkernel marked with [EOL] is "end of life" and will not have any fixes
15*4882a593Smuzhiyunbackported to it.
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunIf you've found a bug on a kernel version that isn't listed on kernel.org,
18*4882a593Smuzhiyuncontact your Linux distribution or embedded vendor for support.
19*4882a593SmuzhiyunAlternatively, you can attempt to run one of the supported stable or -rc
20*4882a593Smuzhiyunkernels, and see if you can reproduce the bug on that.  It's preferable
21*4882a593Smuzhiyunto reproduce the bug on the latest -rc kernel.
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunHow to report Linux kernel bugs
25*4882a593Smuzhiyun===============================
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun
28*4882a593SmuzhiyunIdentify the problematic subsystem
29*4882a593Smuzhiyun----------------------------------
30*4882a593Smuzhiyun
31*4882a593SmuzhiyunIdentifying which part of the Linux kernel might be causing your issue
32*4882a593Smuzhiyunincreases your chances of getting your bug fixed. Simply posting to the
33*4882a593Smuzhiyungeneric linux-kernel mailing list (LKML) may cause your bug report to be
34*4882a593Smuzhiyunlost in the noise of a mailing list that gets 1000+ emails a day.
35*4882a593Smuzhiyun
36*4882a593SmuzhiyunInstead, try to figure out which kernel subsystem is causing the issue,
37*4882a593Smuzhiyunand email that subsystem's maintainer and mailing list.  If the subsystem
38*4882a593Smuzhiyunmaintainer doesn't answer, then expand your scope to mailing lists like
39*4882a593SmuzhiyunLKML.
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun
42*4882a593SmuzhiyunIdentify who to notify
43*4882a593Smuzhiyun----------------------
44*4882a593Smuzhiyun
45*4882a593SmuzhiyunOnce you know the subsystem that is causing the issue, you should send a
46*4882a593Smuzhiyunbug report.  Some maintainers prefer bugs to be reported via bugzilla
47*4882a593Smuzhiyun(https://bugzilla.kernel.org), while others prefer that bugs be reported
48*4882a593Smuzhiyunvia the subsystem mailing list.
49*4882a593Smuzhiyun
50*4882a593SmuzhiyunTo find out where to send an emailed bug report, find your subsystem or
51*4882a593Smuzhiyundevice driver in the MAINTAINERS file.  Search in the file for relevant
52*4882a593Smuzhiyunentries, and send your bug report to the person(s) listed in the "M:"
53*4882a593Smuzhiyunlines, making sure to Cc the mailing list(s) in the "L:" lines.  When the
54*4882a593Smuzhiyunmaintainer replies to you, make sure to 'Reply-all' in order to keep the
55*4882a593Smuzhiyunpublic mailing list(s) in the email thread.
56*4882a593Smuzhiyun
57*4882a593SmuzhiyunIf you know which driver is causing issues, you can pass one of the driver
58*4882a593Smuzhiyunfiles to the get_maintainer.pl script::
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun     perl scripts/get_maintainer.pl -f <filename>
61*4882a593Smuzhiyun
62*4882a593SmuzhiyunIf it is a security bug, please copy the Security Contact listed in the
63*4882a593SmuzhiyunMAINTAINERS file.  They can help coordinate bugfix and disclosure.  See
64*4882a593Smuzhiyun:ref:`Documentation/admin-guide/security-bugs.rst <securitybugs>` for more information.
65*4882a593Smuzhiyun
66*4882a593SmuzhiyunIf you can't figure out which subsystem caused the issue, you should file
67*4882a593Smuzhiyuna bug in kernel.org bugzilla and send email to
68*4882a593Smuzhiyunlinux-kernel@vger.kernel.org, referencing the bugzilla URL.  (For more
69*4882a593Smuzhiyuninformation on the linux-kernel mailing list see
70*4882a593Smuzhiyunhttp://vger.kernel.org/lkml/).
71*4882a593Smuzhiyun
72*4882a593Smuzhiyun
73*4882a593SmuzhiyunTips for reporting bugs
74*4882a593Smuzhiyun-----------------------
75*4882a593Smuzhiyun
76*4882a593SmuzhiyunIf you haven't reported a bug before, please read:
77*4882a593Smuzhiyun
78*4882a593Smuzhiyun	https://www.chiark.greenend.org.uk/~sgtatham/bugs.html
79*4882a593Smuzhiyun
80*4882a593Smuzhiyun	http://www.catb.org/esr/faqs/smart-questions.html
81*4882a593Smuzhiyun
82*4882a593SmuzhiyunIt's REALLY important to report bugs that seem unrelated as separate email
83*4882a593Smuzhiyunthreads or separate bugzilla entries.  If you report several unrelated
84*4882a593Smuzhiyunbugs at once, it's difficult for maintainers to tease apart the relevant
85*4882a593Smuzhiyundata.
86*4882a593Smuzhiyun
87*4882a593Smuzhiyun
88*4882a593SmuzhiyunGather information
89*4882a593Smuzhiyun------------------
90*4882a593Smuzhiyun
91*4882a593SmuzhiyunThe most important information in a bug report is how to reproduce the
92*4882a593Smuzhiyunbug.  This includes system information, and (most importantly)
93*4882a593Smuzhiyunstep-by-step instructions for how a user can trigger the bug.
94*4882a593Smuzhiyun
95*4882a593SmuzhiyunIf the failure includes an "OOPS:", take a picture of the screen, capture
96*4882a593Smuzhiyuna netconsole trace, or type the message from your screen into the bug
97*4882a593Smuzhiyunreport.  Please read "Documentation/admin-guide/bug-hunting.rst" before posting your
98*4882a593Smuzhiyunbug report. This explains what you should do with the "Oops" information
99*4882a593Smuzhiyunto make it useful to the recipient.
100*4882a593Smuzhiyun
101*4882a593SmuzhiyunThis is a suggested format for a bug report sent via email or bugzilla.
102*4882a593SmuzhiyunHaving a standardized bug report form makes it easier for you not to
103*4882a593Smuzhiyunoverlook things, and easier for the developers to find the pieces of
104*4882a593Smuzhiyuninformation they're really interested in.  If some information is not
105*4882a593Smuzhiyunrelevant to your bug, feel free to exclude it.
106*4882a593Smuzhiyun
107*4882a593SmuzhiyunFirst run the ver_linux script included as scripts/ver_linux, which
108*4882a593Smuzhiyunreports the version of some important subsystems.  Run this script with
109*4882a593Smuzhiyunthe command ``awk -f scripts/ver_linux``.
110*4882a593Smuzhiyun
111*4882a593SmuzhiyunUse that information to fill in all fields of the bug report form, and
112*4882a593Smuzhiyunpost it to the mailing list with a subject of "PROBLEM: <one line
113*4882a593Smuzhiyunsummary from [1.]>" for easy identification by the developers::
114*4882a593Smuzhiyun
115*4882a593Smuzhiyun  [1.] One line summary of the problem:
116*4882a593Smuzhiyun  [2.] Full description of the problem/report:
117*4882a593Smuzhiyun  [3.] Keywords (i.e., modules, networking, kernel):
118*4882a593Smuzhiyun  [4.] Kernel information
119*4882a593Smuzhiyun  [4.1.] Kernel version (from /proc/version):
120*4882a593Smuzhiyun  [4.2.] Kernel .config file:
121*4882a593Smuzhiyun  [5.] Most recent kernel version which did not have the bug:
122*4882a593Smuzhiyun  [6.] Output of Oops.. message (if applicable) with symbolic information
123*4882a593Smuzhiyun       resolved (see Documentation/admin-guide/bug-hunting.rst)
124*4882a593Smuzhiyun  [7.] A small shell script or example program which triggers the
125*4882a593Smuzhiyun       problem (if possible)
126*4882a593Smuzhiyun  [8.] Environment
127*4882a593Smuzhiyun  [8.1.] Software (add the output of the ver_linux script here)
128*4882a593Smuzhiyun  [8.2.] Processor information (from /proc/cpuinfo):
129*4882a593Smuzhiyun  [8.3.] Module information (from /proc/modules):
130*4882a593Smuzhiyun  [8.4.] Loaded driver and hardware information (/proc/ioports, /proc/iomem)
131*4882a593Smuzhiyun  [8.5.] PCI information ('lspci -vvv' as root)
132*4882a593Smuzhiyun  [8.6.] SCSI information (from /proc/scsi/scsi)
133*4882a593Smuzhiyun  [8.7.] Other information that might be relevant to the problem
134*4882a593Smuzhiyun         (please look in /proc and include all information that you
135*4882a593Smuzhiyun         think to be relevant):
136*4882a593Smuzhiyun  [X.] Other notes, patches, fixes, workarounds:
137*4882a593Smuzhiyun
138*4882a593Smuzhiyun
139*4882a593SmuzhiyunFollow up
140*4882a593Smuzhiyun=========
141*4882a593Smuzhiyun
142*4882a593SmuzhiyunExpectations for bug reporters
143*4882a593Smuzhiyun------------------------------
144*4882a593Smuzhiyun
145*4882a593SmuzhiyunLinux kernel maintainers expect bug reporters to be able to follow up on
146*4882a593Smuzhiyunbug reports.  That may include running new tests, applying patches,
147*4882a593Smuzhiyunrecompiling your kernel, and/or re-triggering your bug.  The most
148*4882a593Smuzhiyunfrustrating thing for maintainers is for someone to report a bug, and then
149*4882a593Smuzhiyunnever follow up on a request to try out a fix.
150*4882a593Smuzhiyun
151*4882a593SmuzhiyunThat said, it's still useful for a kernel maintainer to know a bug exists
152*4882a593Smuzhiyunon a supported kernel, even if you can't follow up with retests.  Follow
153*4882a593Smuzhiyunup reports, such as replying to the email thread with "I tried the latest
154*4882a593Smuzhiyunkernel and I can't reproduce my bug anymore" are also helpful, because
155*4882a593Smuzhiyunmaintainers have to assume silence means things are still broken.
156*4882a593Smuzhiyun
157*4882a593SmuzhiyunExpectations for kernel maintainers
158*4882a593Smuzhiyun-----------------------------------
159*4882a593Smuzhiyun
160*4882a593SmuzhiyunLinux kernel maintainers are busy, overworked human beings.  Some times
161*4882a593Smuzhiyunthey may not be able to address your bug in a day, a week, or two weeks.
162*4882a593SmuzhiyunIf they don't answer your email, they may be on vacation, or at a Linux
163*4882a593Smuzhiyunconference.  Check the conference schedule at https://LWN.net for more info:
164*4882a593Smuzhiyun
165*4882a593Smuzhiyun	https://lwn.net/Calendar/
166*4882a593Smuzhiyun
167*4882a593SmuzhiyunIn general, kernel maintainers take 1 to 5 business days to respond to
168*4882a593Smuzhiyunbugs.  The majority of kernel maintainers are employed to work on the
169*4882a593Smuzhiyunkernel, and they may not work on the weekends.  Maintainers are scattered
170*4882a593Smuzhiyunaround the world, and they may not work in your time zone.  Unless you
171*4882a593Smuzhiyunhave a high priority bug, please wait at least a week after the first bug
172*4882a593Smuzhiyunreport before sending the maintainer a reminder email.
173*4882a593Smuzhiyun
174*4882a593SmuzhiyunThe exceptions to this rule are regressions, kernel crashes, security holes,
175*4882a593Smuzhiyunor userspace breakage caused by new kernel behavior.  Those bugs should be
176*4882a593Smuzhiyunaddressed by the maintainers ASAP.  If you suspect a maintainer is not
177*4882a593Smuzhiyunresponding to these types of bugs in a timely manner (especially during a
178*4882a593Smuzhiyunmerge window), escalate the bug to LKML and Linus Torvalds.
179*4882a593Smuzhiyun
180*4882a593SmuzhiyunThank you!
181*4882a593Smuzhiyun
182*4882a593Smuzhiyun[Some of this is taken from Frohwalt Egerer's original linux-kernel FAQ]
183