Bug-Reporting.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- This file documents the GNU linker LD
  4. (GNU Binutils)
  5. version 2.28.
  6. Copyright (C) 1991-2017 Free Software Foundation, Inc.
  7. Permission is granted to copy, distribute and/or modify this document
  8. under the terms of the GNU Free Documentation License, Version 1.3
  9. or any later version published by the Free Software Foundation;
  10. with no Invariant Sections, with no Front-Cover Texts, and with no
  11. Back-Cover Texts. A copy of the license is included in the
  12. section entitled "GNU Free Documentation License". -->
  13. <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <title>LD: Bug Reporting</title>
  16. <meta name="description" content="LD: Bug Reporting">
  17. <meta name="keywords" content="LD: Bug Reporting">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  21. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  22. <link href="index.html#Top" rel="start" title="Top">
  23. <link href="LD-Index.html#LD-Index" rel="index" title="LD Index">
  24. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  25. <link href="Reporting-Bugs.html#Reporting-Bugs" rel="up" title="Reporting Bugs">
  26. <link href="MRI.html#MRI" rel="next" title="MRI">
  27. <link href="Bug-Criteria.html#Bug-Criteria" rel="prev" title="Bug Criteria">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.smallquotation {font-size: smaller}
  32. div.display {margin-left: 3.2em}
  33. div.example {margin-left: 3.2em}
  34. div.indentedblock {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  38. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  39. div.smalllisp {margin-left: 3.2em}
  40. kbd {font-style:oblique}
  41. pre.display {font-family: inherit}
  42. pre.format {font-family: inherit}
  43. pre.menu-comment {font-family: serif}
  44. pre.menu-preformatted {font-family: serif}
  45. pre.smalldisplay {font-family: inherit; font-size: smaller}
  46. pre.smallexample {font-size: smaller}
  47. pre.smallformat {font-family: inherit; font-size: smaller}
  48. pre.smalllisp {font-size: smaller}
  49. span.nocodebreak {white-space:nowrap}
  50. span.nolinebreak {white-space:nowrap}
  51. span.roman {font-family:serif; font-weight:normal}
  52. span.sansserif {font-family:sans-serif; font-weight:normal}
  53. ul.no-bullet {list-style: none}
  54. -->
  55. </style>
  56. </head>
  57. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  58. <a name="Bug-Reporting"></a>
  59. <div class="header">
  60. <p>
  61. Previous: <a href="Bug-Criteria.html#Bug-Criteria" accesskey="p" rel="prev">Bug Criteria</a>, Up: <a href="Reporting-Bugs.html#Reporting-Bugs" accesskey="u" rel="up">Reporting Bugs</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="LD-Index.html#LD-Index" title="Index" rel="index">Index</a>]</p>
  62. </div>
  63. <hr>
  64. <a name="How-to-Report-Bugs"></a>
  65. <h3 class="section">6.2 How to Report Bugs</h3>
  66. <a name="index-bug-reports"></a>
  67. <a name="index-ld-bugs_002c-reporting"></a>
  68. <p>A number of companies and individuals offer support for <small>GNU</small>
  69. products. If you obtained <code>ld</code> from a support organization, we
  70. recommend you contact that organization first.
  71. </p>
  72. <p>You can find contact information for many support companies and
  73. individuals in the file <samp>etc/SERVICE</samp> in the <small>GNU</small> Emacs
  74. distribution.
  75. </p>
  76. <p>Otherwise, send bug reports for <code>ld</code> to
  77. <a href="http://www.sourceware.org/bugzilla/">http://www.sourceware.org/bugzilla/</a>.
  78. </p>
  79. <p>The fundamental principle of reporting bugs usefully is this:
  80. <strong>report all the facts</strong>. If you are not sure whether to state a
  81. fact or leave it out, state it!
  82. </p>
  83. <p>Often people omit facts because they think they know what causes the
  84. problem and assume that some details do not matter. Thus, you might
  85. assume that the name of a symbol you use in an example does not
  86. matter. Well, probably it does not, but one cannot be sure. Perhaps
  87. the bug is a stray memory reference which happens to fetch from the
  88. location where that name is stored in memory; perhaps, if the name
  89. were different, the contents of that location would fool the linker
  90. into doing the right thing despite the bug. Play it safe and give a
  91. specific, complete example. That is the easiest thing for you to do,
  92. and the most helpful.
  93. </p>
  94. <p>Keep in mind that the purpose of a bug report is to enable us to fix
  95. the bug if it is new to us. Therefore, always write your bug reports
  96. on the assumption that the bug has not been reported previously.
  97. </p>
  98. <p>Sometimes people give a few sketchy facts and ask, &ldquo;Does this ring a
  99. bell?&rdquo; This cannot help us fix a bug, so it is basically useless. We
  100. respond by asking for enough details to enable us to investigate.
  101. You might as well expedite matters by sending them to begin with.
  102. </p>
  103. <p>To enable us to fix the bug, you should include all these things:
  104. </p>
  105. <ul>
  106. <li> The version of <code>ld</code>. <code>ld</code> announces it if you start it with
  107. the &lsquo;<samp>--version</samp>&rsquo; argument.
  108. <p>Without this, we will not know whether there is any point in looking for
  109. the bug in the current version of <code>ld</code>.
  110. </p>
  111. </li><li> Any patches you may have applied to the <code>ld</code> source, including any
  112. patches made to the <code>BFD</code> library.
  113. </li><li> The type of machine you are using, and the operating system name and
  114. version number.
  115. </li><li> What compiler (and its version) was used to compile <code>ld</code>&mdash;e.g.
  116. &ldquo;<code>gcc-2.7</code>&rdquo;.
  117. </li><li> The command arguments you gave the linker to link your example and
  118. observe the bug. To guarantee you will not omit something important,
  119. list them all. A copy of the Makefile (or the output from make) is
  120. sufficient.
  121. <p>If we were to try to guess the arguments, we would probably guess wrong
  122. and then we might not encounter the bug.
  123. </p>
  124. </li><li> A complete input file, or set of input files, that will reproduce the
  125. bug. It is generally most helpful to send the actual object files
  126. provided that they are reasonably small. Say no more than 10K. For
  127. bigger files you can either make them available by FTP or HTTP or else
  128. state that you are willing to send the object file(s) to whomever
  129. requests them. (Note - your email will be going to a mailing list, so
  130. we do not want to clog it up with large attachments). But small
  131. attachments are best.
  132. <p>If the source files were assembled using <code>gas</code> or compiled using
  133. <code>gcc</code>, then it may be OK to send the source files rather than the
  134. object files. In this case, be sure to say exactly what version of
  135. <code>gas</code> or <code>gcc</code> was used to produce the object files. Also say
  136. how <code>gas</code> or <code>gcc</code> were configured.
  137. </p>
  138. </li><li> A description of what behavior you observe that you believe is
  139. incorrect. For example, &ldquo;It gets a fatal signal.&rdquo;
  140. <p>Of course, if the bug is that <code>ld</code> gets a fatal signal, then we
  141. will certainly notice it. But if the bug is incorrect output, we might
  142. not notice unless it is glaringly wrong. You might as well not give us
  143. a chance to make a mistake.
  144. </p>
  145. <p>Even if the problem you experience is a fatal signal, you should still
  146. say so explicitly. Suppose something strange is going on, such as, your
  147. copy of <code>ld</code> is out of sync, or you have encountered a bug in the
  148. C library on your system. (This has happened!) Your copy might crash
  149. and ours would not. If you told us to expect a crash, then when ours
  150. fails to crash, we would know that the bug was not happening for us. If
  151. you had not told us to expect a crash, then we would not be able to draw
  152. any conclusion from our observations.
  153. </p>
  154. </li><li> If you wish to suggest changes to the <code>ld</code> source, send us context
  155. diffs, as generated by <code>diff</code> with the &lsquo;<samp>-u</samp>&rsquo;, &lsquo;<samp>-c</samp>&rsquo;, or
  156. &lsquo;<samp>-p</samp>&rsquo; option. Always send diffs from the old file to the new file.
  157. If you even discuss something in the <code>ld</code> source, refer to it by
  158. context, not by line number.
  159. <p>The line numbers in our development sources will not match those in your
  160. sources. Your line numbers would convey no useful information to us.
  161. </p></li></ul>
  162. <p>Here are some things that are not necessary:
  163. </p>
  164. <ul>
  165. <li> A description of the envelope of the bug.
  166. <p>Often people who encounter a bug spend a lot of time investigating
  167. which changes to the input file will make the bug go away and which
  168. changes will not affect it.
  169. </p>
  170. <p>This is often time consuming and not very useful, because the way we
  171. will find the bug is by running a single example under the debugger
  172. with breakpoints, not by pure deduction from a series of examples.
  173. We recommend that you save your time for something else.
  174. </p>
  175. <p>Of course, if you can find a simpler example to report <em>instead</em>
  176. of the original one, that is a convenience for us. Errors in the
  177. output will be easier to spot, running under the debugger will take
  178. less time, and so on.
  179. </p>
  180. <p>However, simplification is not vital; if you do not want to do this,
  181. report the bug anyway and send us the entire test case you used.
  182. </p>
  183. </li><li> A patch for the bug.
  184. <p>A patch for the bug does help us if it is a good one. But do not omit
  185. the necessary information, such as the test case, on the assumption that
  186. a patch is all we need. We might see problems with your patch and decide
  187. to fix the problem another way, or we might not understand it at all.
  188. </p>
  189. <p>Sometimes with a program as complicated as <code>ld</code> it is very hard to
  190. construct an example that will make the program follow a certain path
  191. through the code. If you do not send us the example, we will not be
  192. able to construct one, so we will not be able to verify that the bug is
  193. fixed.
  194. </p>
  195. <p>And if we cannot understand what bug you are trying to fix, or why your
  196. patch should be an improvement, we will not install it. A test case will
  197. help us to understand.
  198. </p>
  199. </li><li> A guess about what the bug is or what it depends on.
  200. <p>Such guesses are usually wrong. Even we cannot guess right about such
  201. things without first using the debugger to find the facts.
  202. </p></li></ul>
  203. <hr>
  204. <div class="header">
  205. <p>
  206. Previous: <a href="Bug-Criteria.html#Bug-Criteria" accesskey="p" rel="prev">Bug Criteria</a>, Up: <a href="Reporting-Bugs.html#Reporting-Bugs" accesskey="u" rel="up">Reporting Bugs</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="LD-Index.html#LD-Index" title="Index" rel="index">Index</a>]</p>
  207. </div>
  208. </body>
  209. </html>