如何使用 reportbug 在 Debian 中报告 bug

我们强烈建议您在 Debian 中报告问题、缺陷与错误时使用 reportbug 程序。如需安装并启动它,您仅需运行:

# apt-get install reportbug
$ reportbug

该程序将引导您一步一步完成缺陷报告流程。

如果您对 reportbug 提供的交互式功能有疑问或者其功能无法满足您的需求的话,请参考本文后面叙述的文档内容,或者在 Debian 用户邮件列表(英文)Debian 中文邮件列表询问。

如何使用电子邮件向 Debian 报告 bug(reportbug 的高级用法)

在您发送缺陷报告之前需要了解的东西

您的报告应当归属哪个软件包之下?

您需要知道您的缺陷报告应该针对哪一个软件包进行提交。请查看这个例子以了解您该如何获取这类信息。 (您还可以通过这些信息了解到您的缺陷报告是否已经被其他人提交过了。

如果您无法确定您的报告应该针对哪一个软件包提交,请向 Debian 用户邮件列表发送邮件询问以得到建议。

如果您遇到的问题并不仅仅和某个单一的软件包相关,而是和某些一般的 Debian 服务有关的话,我们有一些 pseudo-packages (即“伪软件包”)以及 邮件列表。这些设施可以帮助您将相关的信息转递给我们。

您的缺陷报告是否已被提交过了?

在提交报告之前,您应该检查您的缺陷报告是否已被他人提交过了。即,其他人已经提交了一份报告描述了相同的问题。 如需查找某个软件包中已经被提交的问题报告列表,您可以使用缺陷搜索表格中的“package”(软件包)选项进行查找。 如果已经存在一个编号为“#<number>”且与您遇到的问题相同的报告的话,您应该以向收件人为“<number>@bugs.debian.org” 的电子邮件地址发送电子邮件以附加您的评论。此时请不要提交一个新的缺陷报告以避免重复。

请为不同的问题各自提交报告

请不要在单一的缺陷报告中描述多个不相关的问题。当这些问题分属不同的软件包时更是如此。请为每个问题提交各自独立的报告。

避免直接向上游提交报告

如果您已经在 Debian 中提交了一份报告,请不要将其副本原封不动地向上游再报告一份,因为这个问题很可能只在 Debian 中出现。如果真的必要的话,软件包维护者会帮忙将报告 转发给上游。

使用电子邮件发送缺陷报告

您可以使用发送电子邮件的方式向 Debian 提交一份新的缺陷报告,下文将具体描述操作方法。您的电子邮件应当发往 submit@bugs.debian.org,并采取后文中描述的特殊文本格式。 reportbug 工具(参见前文)实质上是自动帮助您撰写了合适格式的电子邮件并进行提交。可能的话,请尽量使用它!

信头

和其它电子邮件一样,您应该在您的邮件中写上一个明晰、描述性的Subject (主题、标题)行。这个标题将为作为追踪系统中报告的初始标题,所以请尽可能地在标题中提供有用的信息!

如果您想要将这份缺陷报告的副本发送给其它的接收者(如邮件列表)的话,您不应该在电子邮件头部写上收件人(即不应该使用标准的抄送、密送方式)。 此时您应该采用一种特殊的方式进行,详见下文

伪信头(Pseudo-Headers)

您的缺陷报告正文的第一部分是伪信头(pseudo-headers),其中应该包含一些与报告相关的信息,如这个报告所针对的软件包名称、对应软件包的版本等等。 邮件正文的第一行必须是一个伪信头信息。它的内容应该是:

Package: <packagename>

请将 <packagename> 替换为 软件包的名称,这个软件包应该存在您正在报告的问题或缺陷。

邮件正文信息的第二行应该是:

Version: <packageversion>

请将 <packageversion> 替换为软件包的版本。除了版本字符串以外,这里请不要填入其它任何文本; 因为缺陷追踪系统需要使用该信息推断出哪些 Debian 发行版本受到该问题的影响。

为了让缺陷追踪系统能够将您的信息正确地转发到软件包维护者处,您需要在伪信头部分提供正确的 Package(软件包名称)一行内容。 请参考 这个例子 以了解如何找到软件包名称的信息。

如需了解其它可用的伪信头,请见额外的伪信头

报告正文

请考虑在您的报告中提供以下信息:

请在报告中包含任何看起来会有点关系的细节——简单来说,报告提供的信息多多益善,您不用担心内容过多过长会有什么问题。如果内容不多的话, 不妨考虑一下顺带提供能够重现问题的任何相关文件。(如果报告真的已经很长的话,可以考虑将这些文件放在互联网上其它的地方,并在报告中给出指向的链接。)

如需了解更多能够帮助开发者解决问题的做法的建议,请阅读 如果有效地报告 Bug 一文。

一份示例缺陷报告

一份拥有信头和伪信头的缺陷报告的原文一般长得像这样:

  To: submit@bugs.debian.org
  From: diligent@testing.linux.org
  Subject: Hello says `goodbye'

  Package: hello
  Version: 1.3-16

  When I invoke `hello' without arguments from an ordinary shell
  prompt it prints `goodbye', rather than the expected `hello, world'.
  Here is a transcript:

  $ hello
  goodbye
  $ /usr/bin/hello
  goodbye
  $

  I suggest that the output string, in hello.c, be corrected.

  I am using Debian GNU/Linux 2.2, kernel 2.2.17-pre-patch-13
  and libc6 2.1.3-10.

如何将缺陷报告的副本抄送到其它电子邮件地址

有时候需要将缺陷报告的副本发送到除 debian-bugs-dist 列表和软件包维护者之外的地方。默认情况下,该报告仅会发送给对应软件包的维护者和上述的邮件列表。

当然,您可以将报告使用电子邮件抄送的功能发送给其它收件人。然而,这么做的问题在于这样的副本在 Subject(标题) 和 Reply-To(回复地址)部分不会包含缺陷报告编号的信息。当那位收件人打算对邮件进行回复时,他们很可能会回复到 submit@bugs.debian.org 这个地址,从而错误地产生一个新缺陷报告。这样最终会产生许多重复的报告。

真正正确的做法是使用名为 X-Debbugs-CC 的伪信头。请在您的邮件正文伪信头部分添加这样内容:

 X-Debbugs-CC: other-list@cosmic.edu

这样会指示缺陷追踪系统将报告的一份副本发送至您在 X-Debbugs-CC 伪信头一行中给出的地址。当然,该报告同样会发送至 debian-bugs-dist 邮件列表。

如果您想指定多个抄送的电子邮件地址,请把它们写入同一行 X-Debbugs-CC 中,并使用英文逗号分隔各个地址。

Avoid sending such copies to the addresses of other bug reports, as they will be caught by the checks that prevent mail loops. There is relatively little point in using X-Debbugs-CC for this anyway, as the bug number added by that mechanism will just be replaced by a new one; use an ordinary CC header instead.

This feature can often be combined usefully with mailing quiet — see below.

其它伪信头

问题严重性

如果您了解所报告问题的严重程度,您可以在提交报告时对其进行设置。这么做并不是必须的,而且软件包维护者会在您未给出严重性信息 (或者选择的严重性等级有误)时赋予该报告正确的严重性等级。

如需对报告赋予严重性等级,请在伪信头部分添加如下面一行这样的信息:

Severity: <severity>

请将 <severity> 替换为某个可用的严重性等级。具体可用的等级列表可以在 高级文档中找到。

Assigning tags

You can set tags on a bug as you are reporting it. For example, if you are including a patch with your bug report, you may wish to set the patch tag. This is not required, however, and the developers will set tags on your report as and when it is appropriate.

To set tags, put a line like this one in the pseudo-header:

Tags: <tags>

Replace <tags> with one or more of the available tags, as described in the advanced documentation. Separate multiple tags with commas, spaces, or both.

User: <username>
Usertags: <usertags>

Replace <usertags> with one or more usertags. Separate multiple tags with commas, spaces, or both. If you specify a <username>, that user's tags will be set. Otherwise, the e-mail address of the sender will be used as the username.

Setting Forwarded

Forwarded: foo@example.com

will mark the newly submitted bug as forwarded to foo@example.com. See Recording that you have passed on a bug report in the developers' documentation for details.

Claiming ownership

Owner: foo@example.com

will indicate that foo@example.com is now responsible for fixing this bug. See Changing bug ownership in the developers' documentation for details.

源码包

Source: foopackage

the equivalent of Package: for bugs present in the source package of foopackage; for most bugs in most packages you don't want to use this option.

Control Commands

Control: control commands

Allows for any of the commands which must be sent to control@bugs.debian.org to work when sent to submit@bugs.debian.org or nnn@bugs.debian.org. -1 initially refers to the current bug (that is, the bug created by a mail to submit@ or the bug messaged with nnn@). Please see the server control documentation for more information on the control commands which are valid.

For example, the following pseudoheader in a message sent to 12345@bugs.debian.org:

Control: retitle -1 this is the title
Control: severity -1 normal
Control: summary -1 0
Control: forward -1 https://bugs.debian.org/nnn

would cause 12345 to be retitled, its severity changed, summary set, and marked as forwarded.

X-Debbugs- headers

Finally, if your MUA doesn't allow you to edit the headers, you can set the various X-Debbugs- headers in the pseudo-headers.

额外信息

Different submission addresses (minor or mass bug reports)

If a bug report is minor, for example, a documentation typo or a trivial build problem, please adjust the severity appropriately and send it to maintonly@bugs.debian.org instead of submit@bugs.debian.org. maintonly will forward the report to the package maintainer only, it won't forward it to the BTS mailing lists.

If you're submitting many reports at once, you should definitely use maintonly@bugs.debian.org so that you don't cause too much redundant traffic on the BTS mailing lists. Before submitting many similar bugs you may also want to post a summary on debian-bugs-dist.

If wish to report a bug to the bug tracking system that's already been sent to the maintainer, you can use quiet@bugs.debian.org. Bugs sent to quiet@bugs.debian.org will not be forwarded anywhere, only filed.

When you use different submission addresses, the bug tracking system will set the Reply-To of any forwarded message so that the replies will by default be processed in the same way as the original report. That means that, for example, replies to maintonly will go to nnn-maintonly@bugs.debian.org instead of nnn@bugs.debian.org, unless of course one overrides this manually.

Acknowledgements

Normally, the bug tracking system will return an acknowledgement to you by e-mail when you report a new bug or submit additional information to an existing bug. If you want to suppress this acknowledgement, include an X-Debbugs-No-Ack header or pseudoheader in your e-mail (the contents of this header do not matter). If you report a new bug with this header, you will need to check the web interface yourself to find the bug number.

Note that this header will not suppress acknowledgements from the control@bugs.debian.org mailserver, since those acknowledgements may contain error messages which should be read and acted upon.

Spamfighting and missing mail

The bug tracking system implements a rather extensive set of rules designed to make sure that spam does not make it through the BTS. While we try to minimize the number of false positives, they do occur. If you suspect your mail has triggered a false positive, feel free to contact owner@bugs.debian.org for assistance. Another common cause of mail not making it through to the BTS is utilizing addresses which match procmail's FROM_DAEMON, which includes mail from addresses like mail@foobar.com. If you suspect your mail matches FROM_DAEMON, see procmailrc(5) to verify, and then resend the mail using an address which does not match FROM_DAEMON.

Bug reports against unknown packages

If the bug tracking system doesn't know who the maintainer of the relevant package is it will forward the report to debian-bugs-dist even if maintonly was used.

When sending to maintonly@bugs.debian.org or nnn-maintonly@bugs.debian.org you should make sure that the bug report is assigned to the right package, by putting a correct Package at the top of an original submission of a report, or by using the control@bugs.debian.org service to (re)assign the report appropriately.

Using dpkg to find the package and version for the report

When using reportbug to report a bug in a command, say grep, the following will automatically select the right package and let you write the report right away: reportbug --file $(which grep)

You can also find out which package installed it by using dpkg --search. You can find out which version of a package you have installed by using dpkg --list or dpkg --status.

For example:

$ which apt-get
/usr/bin/apt-get
$ type apt-get
apt-get is /usr/bin/apt-get
$ dpkg --search /usr/bin/apt-get
apt: /usr/bin/apt-get
$ dpkg --list apt
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
ii  apt            0.3.19         Advanced front-end for dpkg
$ dpkg --status apt
Package: apt
Status: install ok installed
Priority: standard
Section: base
Installed-Size: 1391
Maintainer: APT Development Team <deity@lists.debian.org>
Version: 0.3.19
Replaces: deity, libapt-pkg-doc (<< 0.3.7), libapt-pkg-dev (<< 0.3.7)
Provides: libapt-pkg2.7
Depends: libapt-pkg2.7, libc6 (>= 2.1.2), libstdc++2.10
Suggests: dpkg-dev
Conflicts: deity
Description: Advanced front-end for dpkg
 This is Debian's next generation front-end for the dpkg package manager.
 It provides the apt-get utility and APT dselect method that provides a
 simpler, safer way to install and upgrade packages.
 .
 APT features complete installation ordering, multiple source capability
 and several other unique features, see the Users Guide in
 /usr/doc/apt/guide.text.gz

其它有用的命令和软件包

The querybts tool, available from the same package as reportbug, provides a convenient text-based interface to the bug tracking system.

Emacs users can also use the debian-bug command provided by the debian-el package. When called with M-x debian-bug, it will ask for all necessary information in a similar way to reportbug.


其他错误追踪系统网页:


Debian BTS administrators <owner@bugs.debian.org>

Debian bug tracking system
Copyright © 1999 Darren O. Benham, 1997, 2003 nCipher Corporation Ltd, 1994-1997 Ian Jackson.