Now that you have decided that your issue merits a problem report, and that it is a FreeBSD problem, it is time to write the actual problem report. Before we get into the mechanics of the program used to generate and submit PRs, here are some tips and tricks to help make sure that your PR will be most effective.
Do not leave the “Synopsis” line empty. The PRs go both onto a mailing list that goes all over the world (where the “Synopsis” is used for the Subject: line), but also into a database. Anyone who comes along later and browses the database by synopsis, and finds a PR with a blank subject line, tends just to skip over it. Remember that PRs stay in this database until they are closed by someone; an anonymous one will usually just disappear in the noise.
Avoid using a weak “Synopsis” line. You should not assume that anyone reading your PR has any context for your submission, so the more you provide, the better. For instance, what part of the system does the problem apply to? Do you only see the problem while installing, or while running? To illustrate, instead of Synopsis: portupgrade is broken, see how much more informative this seems: Synopsis: port sysutils/portupgrade coredumps on -current. (In the case of ports, it is especially helpful to have both the category and portname in the “Synopsis” line.)
If you have a patch, say so. A PR with a patch included is much more likely to be looked at than one without. If you are including one, put the string [patch] at the beginning of the “Synopsis”. (Although it is not mandatory to use that exact string, by convention, that is the one that is used.)
If you are a maintainer, say so. If you are maintaining a part of the source code (for instance, a port), you might consider adding the string [maintainer update] at the beginning of your synopsis line, and you definitely should set the “Class” of your PR to maintainer-update. This way any committer that handles your PR will not have to check.
Be specific. The more information you supply about what problem you are having, the better your chance of getting a response.
Include the version of FreeBSD you are running (there is a place to put that, see below) and on which architecture. You should include whether you are running from a release (e.g. from a CDROM or download), or from a system maintained by cvsup(1) (and, if so, how recently you updated). If you are tracking the FreeBSD-CURRENT branch, that is the very first thing someone will ask, because fixes (especially for high-profile problems) tend to get committed very quickly, and FreeBSD-CURRENT users are expected to keep up.
Include which global options you have specified in your make.conf. Note: specifying -O2 and above to gcc(1) is known to be buggy in many situations. While the FreeBSD developers will accept patches, they are generally unwilling to investigate such issues due to simple lack of time and volunteers, and may instead respond that this just is not supported.
If this is a kernel problem, then be prepared to supply the following information. (You do not have to include these by default, which only tends to fill up the database, but you should include excerpts that you think might be relevant):
your kernel configuration (including which hardware devices you have installed)
whether or not you have debugging options enabled (such as WITNESS), and if so, whether the problem persists when you change the sense of that option
a backtrace, if one was generated
the fact that you have read src/UPDATING and that your problem is not listed there (someone is guaranteed to ask)
whether or not you can run any other kernel as a fallback (this is to rule out hardware-related issues such as failing disks and overheating CPUs, which can masquerade as kernel problems)
If this is a ports problem, then be prepared to supply the following information. (You do not have to include these by default, which only tends to fill up the database, but you should include excerpts that you think might be relevant):
which ports you have installed
any environment variables that override the defaults in bsd.port.mk, such as PORTSDIR
the fact that you have read ports/UPDATING and that your problem is not listed there (someone is guaranteed to ask)
Avoid vague requests for features. PRs of the form “someone should really implement something that does so-and-so” are less likely to get results than very specific requests. Remember, the source is available to everyone, so if you want a feature, the best way to ensure it being included is to get to work! Also consider the fact that many things like this would make a better topic for discussion on freebsd-questions than an entry in the PR database, as discussed above.
Make sure no one else has already submitted a similar PR. Although this has already been mentioned above, it bears repeating here. It only take a minute or two to use the web-based search engine at http://www.FreeBSD.org/cgi/query-pr-summary.cgi?query. (Of course, everyone is guilty of forgetting to do this now and then.)
Avoid controversial requests. If your PR addresses an area that has been controversial in the past, you should probably be prepared to not only offer patches, but also justification for why the patches are “The Right Thing To Do”. As noted above, a careful search of the mailing lists using the archives at http://www.FreeBSD.org/search/search.html#mailinglists is always good preparation.
Be polite. Almost anyone who would potentially work on your PR is a volunteer. No one likes to be told that they have to do something when they are already doing it for some motivation other than monetary gain. This is a good thing to keep in mind at all times on Open Source projects.
If you are using the send-pr(1) program, make sure your VISUAL (or EDITOR if VISUAL is not set) environment variable is set to something sensible.
You should also make sure that mail delivery works fine. send-pr(1) uses mail messages for the submission and tracking of problem reports. If you cannot post mail messages from the machine you are running send-pr(1) on, your problem report will not reach the GNATS database. For details on the setup of mail on FreeBSD, see the “Electronic Mail” chapter of the FreeBSD Handbook at http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/mail.html.
Make sure that your mailer will not mangle the message on its way to GNATS. In particular, if your mailer automatically breaks lines, changes tabs to spaces, or escapes newline characters, any patch that you submit will be rendered unusable. For the text sections, however, we request that you insert manual linebreaks somewhere around 70 characters, so that the web display of the PR will be readable.
Similar considerations apply if you are using the web-based PR submittal form instead of send-pr(1). Note that cut-and-paste operations can have their own side-effects on text formatting. In certain cases it may be necessary to use uuencode(1) to ensure that patches arrive unmodified.
Finally, if your submission will be lengthy, you should to prepare your work offline so that nothing will be lost in case there is a problem submitting it. This can be an especial problem with the web form.
The following applies to submitting PRs via email:
The send-pr(1) program has
provisions for attaching files to a problem report. You can attach as many files as
you want provided that each has a unique base name (i.e. the name of the file
proper, without the path). Just use the -a
command-line
option to specify the names of the files you wish to attach:
% send-pr -a /var/run/dmesg -a /tmp/errors
Do not worry about binary files, they will be automatically encoded so as not to upset your mail agent.
If you attach a patch, make sure you use the -c
or
-u
option to diff(1) to create a
context or unified diff (unified is preferred), and make sure to specify the
exact CVS revision numbers of the files you modified so the developers who read your
report will be able to apply them easily. For problems with the kernel or the
base utilities, a patch against FreeBSD-CURRENT (the HEAD CVS branch) is
preferred since all new code should be applied and tested there first. After
appropriate or substantial testing has been done, the code will be merged/migrated
to the FreeBSD-STABLE branch.
If you attach a patch inline, instead of as an attachment, note that the most common problem by far is the tendency of some email programs to render tabs as spaces, which will completely ruin anything intended to be part of a Makefile.
Do not send patches as attachments using Content-Transfer-Encoding: quoted-printable. These will perform character escaping and the entire patch will be useless.
Also note that while including small patches in a PR is generally all right——particularly when they fix the problem described in the PR——large patches and especially new code which may require substantial review before committing should be placed on a web or ftp server, and the URL should be included in the PR instead of the patch. Patches in email tend to get mangled, especially when GNATS is involved, and the larger the patch, the harder it will be for interested parties to unmangle it. Also, posting a patch on the web allows you to modify it without having to resubmit the entire patch in a followup to the original PR. Finally, large patches simply increase the size of the database, since closed PRs are not actually deleted but instead kept and simply marked as closed.
You should also take note that unless you explicitly specify otherwise in your PR or in the patch itself, any patches you submit will be assumed to be licensed under the same terms as the original file you modified.
The next section applies to the email method only:
When you run send-pr(1), you are presented with a template. The template consists of a list of fields, some of which are pre-filled, and some of which have comments explaining their purpose or listing acceptable values. Do not worry about the comments; they will be removed automatically if you do not modify them or remove them yourself.
At the top of the template, below the SEND-PR: lines, are the email headers. You do not normally need to modify these, unless you are sending the problem report from a machine or account that can send but not receive mail, in which case you will want to set the From: and Reply-To: to your real email address. You may also want to send yourself (or someone else) a carbon copy of the problem report by adding one or more email addresses to the Cc: header.
In the email template you will find the following two single-line fields:
Submitter-Id: Do not change this. The default value of current-users is correct, even if you run FreeBSD-STABLE.
Confidential: This is prefilled to no. Changing it makes no sense as there is no such thing as a confidential FreeBSD problem report——the PR database is distributed worldwide by CVSup.
The next section describes fields that are common to both the email interface and the web interface:
Originator: Please specify your real name, optionally followed by your email address in angle brackets. In the email interface, this is normally prefilled with the gecos field of the currently logged-in user.
注: The email address you use will become public information and may become available to spammers. You should either have spam handling procedures in place, or use a temporary email account. However, please note that if you do not use a valid email account at all, we will not be able to ask you questions about your PR.
Organization: Whatever you feel like. This field is not used for anything significant.
Synopsis: Fill this out with a short and accurate description of the problem. The synopsis is used as the subject of the problem report email, and is used in problem report listings and summaries; problem reports with obscure synopses tend to get ignored.
As noted above, if your problem report includes a patch, please have the synopsis start with [patch]; if this is a ports PR and you are the maintainer, you may consider adding [maintainer update] and set the “Class” of your PR to maintainer-update.
Severity: One of non-critical, serious or critical. Do not overreact; refrain from labeling your problem critical unless it really is (e.g. data corruption issues, serious regression from previous functionality in -CURRENT) or serious unless it is something that will affect many users (kernel panics or freezes; problems with particular device drivers or system utilities). FreeBSD developers will not necessarily work on your problem faster if you inflate its importance since there are so many other people who have done exactly that —— in fact, some developers pay little attention to this field because of this.
注: Major security problems should not be filed in GNATS, because all GNATS information is public knowledge. Please send such problems in private email to Security Officer Team
<security-officer@FreeBSD.org>
.
Priority: One of low, medium or high. high should be reserved for problems that will affect practically every user of FreeBSD and medium for something that will affect many users.
注: This field has become so widely abused that it is almost completely meaningless.
Category: Choose an appropriate category.
注: There are a number of "platform" categories into which bugs in the base system that are specific to one particular hardware architecture should be filed. Problems that are generic all across versions of FreeBSD should probably be filed as kern or bin; see discussion of those categories below.
Example: you have a common PC-based machine, and think you have encountered a problem specific to a particular chipset or a particular motherboard: i386 is the right category.
Example: You are having a problem with an add-in peripheral card on a commonly seen bus, or a problem with a particular type of hard disk drive: in this case, it probably applies to more than one architecture, and kern is the right category.
Here is the current list of categories (taken from http://www.FreeBSD.org/cgi/cvsweb.cgi/src/gnu/usr.bin/send-pr/categories):
advocacy: problems relating to FreeBSD's public image. Rarely used.
alpha: problems specific to the Alpha platform.
amd64: problems specific to the AMD64 platform.
bin: problems with userland programs in the base system. If running whereis(1) shows /bin, /usr/sbin, or something similar, then this is probably the right category. (A few contributed programs might instead need to be in gnu; see below.)
conf: problems with configuration files, default values, and so forth. Things that affect /usr/share or /etc/rc* belong here.
docs: problems with manual pages or on-line documentation.
gnu: problems with imported GNU software such as gcc(1) or grep(1).
i386: problems specific to the i386™ platform.
ia64: problems specific to the ia64 platform.
java: problems related to the Java™ Virtual Machine. (Ports that merely depend on Java to run should be filed under ports.)
kern: problems with the kernel, (non-platform-specific) device drivers, or the base libraries.
misc: anything that does not fit in any of the other categories. (Note that there is almost nothing that truly belongs in this category, except for problems with the release and build infrastructure. Temporary build failures on HEAD do not belong here. Also note that it is easy for things to get lost in this category).
ports: problems relating to the ports tree.
powerpc: problems specific to the PowerPC® platform.
sparc64: problems specific to the Sparc64® platform.
standards: Standards conformance issues.
threads: problems related to the FreeBSD threads implementation (especially on FreeBSD-CURRENT).
usb: problems related to the FreeBSD USB implementation.
www: Changes or enhancements to the FreeBSD website. Problems with code found in /usr/ports/www do not belong here, they belong in ports instead.
Class: Choose one of the following:
sw-bug: software bugs.
doc-bug: errors in documentation.
change-request: requests for additional features or changes in existing features.
update: updates to ports or other contributed software.
maintainer-update: updates to ports for which you are the maintainer.
Release: The version of FreeBSD that you are running. This is filled out automatically if you are using send-pr(1) and need only be changed if you are sending a problem report from a different system than the one that exhibits the problem.
Finally, there is a series of multi-line fields:
Environment: This should describe, as accurately as possible, the environment in which the problem has been observed. This includes the operating system version, the version of the specific program or file that contains the problem, and any other relevant items such as system configuration, other installed software that influences the problem, etc.——quite simply everything a developer needs to know to reconstruct the environment in which the problem occurs.
Description: A complete and accurate description of the problem you are experiencing. Try to avoid speculating about the causes of the problem unless you are certain that you are on the right track, as it may mislead a developer into making incorrect assumptions about the problem.
How-To-Repeat: A summary of the actions you need to take to reproduce the problem.
Fix: Preferably a patch, or at least a workaround (which not only helps other people with the same problem work around it, but may also help a developer understand the cause for the problem), but if you do not have any firm ideas for either, it is better to leave this field blank than to speculate.
If you are using send-pr(1):
Once you are done filling out the template, have saved it, and exit your editor,
send-pr(1) will prompt
you with s)end, e)dit or a)bort?. You can then hit
s to go ahead and submit the problem report, e to restart the editor and make further modifications, or
a to abort. If you choose the latter, your problem
report will remain on disk (send-pr(1) will tell
you the filename before it terminates), so you can edit it at your leisure, or maybe
transfer it to a system with better net connectivity, before sending it with
the -f
to send-pr(1):
% send-pr -f ~/my-problem-report
This will read the specified file, validate the contents, strip comments and send it off.
If you are using the web form:
Before you hit submit, you will need to fill in a field containing text that is represented in image form on the page. This unfortunate measure has had to be adopted due to misuse by automated systems and a few misguided individuals. It is a necessary evil that no one likes; please do not ask us to remove it.
Note that you are strongly advised to save your work somewhere before hitting submit. A common problem for users is to have their web browser displaying a stale image from its cache. If this happens to you, your submission will be rejected and you may lose your work.
If you are unable to view images for any reason, and are also unable to use send-pr(1), please
accept our apologies for the inconvenience and email your problem report to the
bugbuster team at <freebsd-bugbusters@FreeBSD.org>
.
本文及其他文件,可由此下載:ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/。
若有 FreeBSD 方面疑問,請先閱讀 FreeBSD 相關文件,如不能解決的話,再洽詢
<questions@FreeBSD.org>。
關於本文件的問題,請洽詢 <doc@FreeBSD.org>。