| 1 |
fox2mike |
1.1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
|
|
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
|
| 3 |
vapier |
1.6 |
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/bugzilla-howto.xml,v 1.5 2005/07/22 23:46:11 neysx Exp $ -->
|
| 4 |
fox2mike |
1.1 |
|
| 5 |
|
|
<guide link="/doc/en/bugzilla-howto.xml">
|
| 6 |
|
|
<title>Gentoo Bug Reporting Guide</title>
|
| 7 |
|
|
|
| 8 |
|
|
<author title="Author">
|
| 9 |
|
|
<mail link="chriswhite@gentoo.org">Chris White</mail>
|
| 10 |
|
|
</author>
|
| 11 |
|
|
<author title="Editor">
|
| 12 |
|
|
<mail link="fox2mike@gentoo.org">Shyam Mani</mail>
|
| 13 |
|
|
</author>
|
| 14 |
|
|
|
| 15 |
|
|
<abstract>
|
| 16 |
|
|
This document shows the proper method of reporting bugs using Bugzilla.
|
| 17 |
|
|
</abstract>
|
| 18 |
|
|
|
| 19 |
|
|
<!-- The content of this document is licensed under the CC-BY-SA license -->
|
| 20 |
|
|
<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
|
| 21 |
|
|
<license/>
|
| 22 |
|
|
|
| 23 |
vapier |
1.6 |
<version>1.5</version>
|
| 24 |
|
|
<date>2005-08-29</date>
|
| 25 |
fox2mike |
1.1 |
|
| 26 |
|
|
<chapter>
|
| 27 |
|
|
<title>Introduction</title>
|
| 28 |
|
|
<section>
|
| 29 |
|
|
<title>Preface</title>
|
| 30 |
|
|
<body>
|
| 31 |
|
|
|
| 32 |
|
|
<p>
|
| 33 |
fox2mike |
1.3 |
One of the factors that delay a bug being fixed is the way it is reported. By
|
| 34 |
|
|
creating this guide, we hope to help improve the communication between
|
| 35 |
fox2mike |
1.1 |
developers and users in bug resolution. Getting bugs fixed is an important, if
|
| 36 |
fox2mike |
1.3 |
not crucial part of the quality assurance for any project and hopefully this
|
| 37 |
fox2mike |
1.1 |
guide will help make that a success.
|
| 38 |
|
|
</p>
|
| 39 |
|
|
|
| 40 |
|
|
</body>
|
| 41 |
|
|
</section>
|
| 42 |
|
|
<section>
|
| 43 |
fox2mike |
1.3 |
<title>Bugs!!!!</title>
|
| 44 |
fox2mike |
1.1 |
<body>
|
| 45 |
|
|
|
| 46 |
|
|
<p>
|
| 47 |
fox2mike |
1.3 |
You're emerge-ing a package or working with a program and suddenly the worst
|
| 48 |
|
|
happens -- you find a bug. Bugs come in many forms like emerge failures or
|
| 49 |
|
|
segmentation faults. Whatever the cause, the fact still remains that such a bug
|
| 50 |
|
|
must be fixed. Here is a few examples of such bugs.
|
| 51 |
fox2mike |
1.1 |
</p>
|
| 52 |
|
|
|
| 53 |
|
|
<pre caption="A run time error">
|
| 54 |
|
|
$ <i>./bad_code `perl -e 'print Ax100'`</i>
|
| 55 |
|
|
Segmentation fault
|
| 56 |
|
|
</pre>
|
| 57 |
|
|
|
| 58 |
|
|
<pre caption="An emerge failure">
|
| 59 |
|
|
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/g++-v3/backward/backward_warning.h:32:2:
|
| 60 |
|
|
warning: #warning This file includes at least one deprecated or antiquated
|
| 61 |
|
|
header. Please consider using one of the 32 headers found in section 17.4.1.2 of
|
| 62 |
|
|
the C++ standard. Examples include substituting the <X> header for the <X.h>
|
| 63 |
|
|
header for C++ includes, or <sstream> instead of the deprecated header
|
| 64 |
|
|
<strstream.h>. To disable this warning use -Wno-deprecated.
|
| 65 |
|
|
In file included from main.cc:40:
|
| 66 |
|
|
menudef.h:55: error: brace-enclosed initializer used to initialize `
|
| 67 |
|
|
OXPopupMenu*'
|
| 68 |
|
|
menudef.h:62: error: brace-enclosed initializer used to initialize `
|
| 69 |
|
|
OXPopupMenu*'
|
| 70 |
|
|
menudef.h:70: error: brace-enclosed initializer used to initialize `
|
| 71 |
|
|
OXPopupMenu*'
|
| 72 |
|
|
menudef.h:78: error: brace-enclosed initializer used to initialize `
|
| 73 |
|
|
OXPopupMenu*'
|
| 74 |
|
|
main.cc: In member function `void OXMain::DoOpen()':
|
| 75 |
|
|
main.cc:323: warning: unused variable `FILE*fp'
|
| 76 |
|
|
main.cc: In member function `void OXMain::DoSave(char*)':
|
| 77 |
|
|
main.cc:337: warning: unused variable `FILE*fp'
|
| 78 |
|
|
make[1]: *** [main.o] Error 1
|
| 79 |
|
|
make[1]: Leaving directory
|
| 80 |
|
|
`/var/tmp/portage/xclass-0.7.4/work/xclass-0.7.4/example-app'
|
| 81 |
|
|
make: *** [shared] Error 2
|
| 82 |
|
|
|
| 83 |
|
|
!!! ERROR: x11-libs/xclass-0.7.4 failed.
|
| 84 |
|
|
!!! Function src_compile, Line 29, Exitcode 2
|
| 85 |
|
|
!!! 'emake shared' failed
|
| 86 |
|
|
</pre>
|
| 87 |
|
|
|
| 88 |
|
|
<p>
|
| 89 |
neysx |
1.5 |
These errors can be quite troublesome. However, once you find them, what do you
|
| 90 |
|
|
do? The following sections will look at two important tools for handling run
|
| 91 |
|
|
time errors. After that, we'll take a look at compile errors, and how to handle
|
| 92 |
|
|
them. Let's start out with the first tool for debugging run time errors --
|
| 93 |
|
|
<c>gdb</c>.
|
| 94 |
fox2mike |
1.1 |
</p>
|
| 95 |
|
|
|
| 96 |
|
|
</body>
|
| 97 |
|
|
</section>
|
| 98 |
|
|
</chapter>
|
| 99 |
|
|
|
| 100 |
|
|
|
| 101 |
|
|
<chapter>
|
| 102 |
|
|
<title>Debugging using GDB</title>
|
| 103 |
|
|
<section>
|
| 104 |
|
|
<title>Introduction</title>
|
| 105 |
|
|
<body>
|
| 106 |
|
|
|
| 107 |
|
|
<p>
|
| 108 |
|
|
GDB, or the (G)NU (D)e(B)ugger, is a program used to find run time errors that
|
| 109 |
|
|
normally involve memory corruption. First off, let's take a look at what
|
| 110 |
|
|
debugging entails. One of the main things you must do in order to debug a
|
| 111 |
fox2mike |
1.3 |
program is to <c>emerge</c> the program with <c>FEATURES="nostrip"</c>. This
|
| 112 |
|
|
prevents the stripping of debug symbols. Why are programs stripped by default?
|
| 113 |
|
|
The reason is the same as that for having gzipped man pages -- saving space.
|
| 114 |
neysx |
1.5 |
Here's how the size of a program varies with and without debug symbol stripping.
|
| 115 |
fox2mike |
1.1 |
</p>
|
| 116 |
|
|
|
| 117 |
|
|
<pre caption="Filesize Comparison">
|
| 118 |
|
|
<comment>(debug symbols stripped)</comment>
|
| 119 |
|
|
-rwxr-xr-x 1 chris users 3140 6/28 13:11 bad_code
|
| 120 |
|
|
<comment>(debug symbols intact)</comment>
|
| 121 |
|
|
-rwxr-xr-x 1 chris users 6374 6/28 13:10 bad_code
|
| 122 |
|
|
</pre>
|
| 123 |
|
|
|
| 124 |
|
|
<p>
|
| 125 |
|
|
Just for reference, <e>bad_code</e> is the program we'll be debugging with
|
| 126 |
|
|
<c>gdb</c> later on. As you can see, the program without debugging symbols is
|
| 127 |
|
|
3140 bytes, while the program with them is 6374 bytes. That's close to double
|
| 128 |
fox2mike |
1.3 |
the size! Two more things can be done for debugging. The first is adding ggdb3
|
| 129 |
|
|
to your CFLAGS and CXXFLAGS. This flag adds more debugging information than is
|
| 130 |
|
|
generally included. We'll see what that means later on. This is how
|
| 131 |
neysx |
1.5 |
<path>/etc/make.conf</path> <e>might</e> look with the newly added flags.
|
| 132 |
fox2mike |
1.3 |
</p>
|
| 133 |
|
|
|
| 134 |
|
|
<pre caption="make.conf settings">
|
| 135 |
vapier |
1.6 |
CFLAGS="-O1 -pipe -g -ggdb"
|
| 136 |
fox2mike |
1.3 |
CXXFLAGS="${CFLAGS}"
|
| 137 |
|
|
</pre>
|
| 138 |
|
|
|
| 139 |
|
|
<p>
|
| 140 |
neysx |
1.5 |
Lastly, you can also add debug to the package's USE flags. This can be done
|
| 141 |
|
|
with the <path>package.use</path> file.
|
| 142 |
|
|
</p>
|
| 143 |
fox2mike |
1.1 |
|
| 144 |
|
|
<pre caption="Using package.use to add debug USE flag">
|
| 145 |
|
|
# <i>echo "category/package debug" >> /etc/portage/package.use</i>
|
| 146 |
|
|
</pre>
|
| 147 |
|
|
|
| 148 |
|
|
<note>
|
| 149 |
|
|
The directory <path>/etc/portage</path> does not exist by default and you may
|
| 150 |
|
|
have to create it, if you have not already done so. If the package already has
|
| 151 |
|
|
USE flags set in <path>package.use</path>, you will need to manually modify them
|
| 152 |
|
|
in your favorite editor.
|
| 153 |
|
|
</note>
|
| 154 |
|
|
|
| 155 |
|
|
<p>
|
| 156 |
fox2mike |
1.3 |
Then we re-emerge the package with the modifications we've done so far as shown
|
| 157 |
|
|
below.
|
| 158 |
fox2mike |
1.1 |
</p>
|
| 159 |
|
|
|
| 160 |
|
|
<pre caption="Re-emergeing a package with debugging">
|
| 161 |
|
|
# <i>FEATURES="nostrip" emerge package</i>
|
| 162 |
|
|
</pre>
|
| 163 |
|
|
|
| 164 |
|
|
<p>
|
| 165 |
|
|
Now that debug symbols are setup, we can continue with debugging the program.
|
| 166 |
|
|
</p>
|
| 167 |
|
|
|
| 168 |
|
|
</body>
|
| 169 |
|
|
</section>
|
| 170 |
|
|
<section>
|
| 171 |
|
|
<title>Running the program with GDB</title>
|
| 172 |
|
|
<body>
|
| 173 |
|
|
|
| 174 |
|
|
<p>
|
| 175 |
fox2mike |
1.3 |
Let's say we have a program here called "bad_code". Some person claims that the
|
| 176 |
|
|
program crashes and provides an example. You go ahead and test it out:
|
| 177 |
fox2mike |
1.1 |
</p>
|
| 178 |
|
|
|
| 179 |
|
|
<pre caption="Breaking The Program">
|
| 180 |
|
|
$ <i>./bad_code `perl -e 'print Ax100'`</i>
|
| 181 |
|
|
Segmentation fault
|
| 182 |
|
|
</pre>
|
| 183 |
|
|
|
| 184 |
|
|
<p>
|
| 185 |
|
|
It seems this person was right. Since the program is obviously broken, we have
|
| 186 |
|
|
a bug at hand. Now, it's time to use <c>gdb</c> to help solve this matter. First
|
| 187 |
|
|
we run <c>gdb</c> with <c>--args</c>, then give it the full program with
|
| 188 |
|
|
arguments like shown:
|
| 189 |
|
|
</p>
|
| 190 |
|
|
|
| 191 |
|
|
<pre caption="Running Our Program Through GDB">
|
| 192 |
|
|
$ <i>gdb --args ./bad_code `perl -e 'print Ax100'`</i>
|
| 193 |
|
|
GNU gdb 6.3
|
| 194 |
|
|
Copyright 2004 Free Software Foundation, Inc.
|
| 195 |
|
|
GDB is free software, covered by the GNU General Public License, and you are
|
| 196 |
|
|
welcome to change it and/or distribute copies of it under certain conditions.
|
| 197 |
|
|
Type "show copying" to see the conditions.
|
| 198 |
|
|
There is absolutely no warranty for GDB. Type "show warranty" for details.
|
| 199 |
|
|
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
|
| 200 |
|
|
</pre>
|
| 201 |
|
|
|
| 202 |
fox2mike |
1.3 |
<note>
|
| 203 |
|
|
One can also debug with core dumps. These core files contain the same
|
| 204 |
|
|
information that the program would produce when run with gdb. In order to debug
|
| 205 |
|
|
with a core file with bad_code, you would run <c>gdb ./bad_code core</c> where
|
| 206 |
|
|
core is the name of the core file.
|
| 207 |
|
|
</note>
|
| 208 |
|
|
|
| 209 |
fox2mike |
1.1 |
<p>
|
| 210 |
fox2mike |
1.3 |
You should see a prompt that says "(gdb)" and waits for input. First, we have to
|
| 211 |
|
|
run the program. We type in <c>run</c> at the command and receive a notice like:
|
| 212 |
fox2mike |
1.1 |
</p>
|
| 213 |
|
|
|
| 214 |
|
|
<pre caption="Running the program in GDB">
|
| 215 |
fox2mike |
1.3 |
(gdb) <i>run</i>
|
| 216 |
fox2mike |
1.1 |
Starting program: /home/chris/bad_code
|
| 217 |
|
|
|
| 218 |
|
|
Program received signal SIGSEGV, Segmentation fault.
|
| 219 |
|
|
0xb7ec6dc0 in strcpy () from /lib/libc.so.6
|
| 220 |
|
|
</pre>
|
| 221 |
|
|
|
| 222 |
|
|
<p>
|
| 223 |
|
|
Here we see the program starting, as well as a notification of SIGSEGV, or
|
| 224 |
|
|
Segmentation Fault. This is GDB telling us that our program has crashed. It
|
| 225 |
|
|
also gives the last run function it could trace when the program crashes.
|
| 226 |
|
|
However, this isn't too useful, as there could be multiple strcpy's in the
|
| 227 |
|
|
program, making it hard for developers to find which one is causing the issue.
|
| 228 |
|
|
In order to help them out, we do what's called a backtrace. A backtrace runs
|
| 229 |
|
|
backwards through all the functions that occurred upon program execution, to the
|
| 230 |
|
|
function at fault. Functions that return (without causing a crash) will not show
|
| 231 |
|
|
up on the backtrace. To get a backtrace, at the (gdb) prompt, type in <c>bt</c>.
|
| 232 |
|
|
You will get something like this:
|
| 233 |
|
|
</p>
|
| 234 |
|
|
|
| 235 |
|
|
<pre caption="Program backtrace">
|
| 236 |
fox2mike |
1.3 |
(gdb) <i>bt</i>
|
| 237 |
fox2mike |
1.1 |
#0 0xb7ec6dc0 in strcpy () from /lib/libc.so.6
|
| 238 |
|
|
#1 0x0804838c in run_it ()
|
| 239 |
|
|
#2 0x080483ba in main ()
|
| 240 |
|
|
</pre>
|
| 241 |
|
|
|
| 242 |
|
|
<p>
|
| 243 |
fox2mike |
1.3 |
You can notice the trace pattern clearly. main() is called first, followed by
|
| 244 |
|
|
run_it(), and somewhere in run_it() lies the strcpy() at fault. Things such as
|
| 245 |
|
|
this help developers narrow down problems. There are a few exceptions to the
|
| 246 |
|
|
output. First off is forgetting to enable debug symbols with
|
| 247 |
|
|
<c>FEATURES="nostrip"</c>. With debug symbols stripped, the output looks something
|
| 248 |
|
|
like this:
|
| 249 |
fox2mike |
1.1 |
</p>
|
| 250 |
|
|
|
| 251 |
|
|
<pre caption="Program backtrace With debug symbols stripped">
|
| 252 |
fox2mike |
1.3 |
(gdb) <i>bt</i>
|
| 253 |
fox2mike |
1.1 |
#0 0xb7e2cdc0 in strcpy () from /lib/libc.so.6
|
| 254 |
|
|
#1 0x0804838c in ?? ()
|
| 255 |
|
|
#2 0xbfd19510 in ?? ()
|
| 256 |
|
|
#3 0x00000000 in ?? ()
|
| 257 |
|
|
#4 0x00000000 in ?? ()
|
| 258 |
|
|
#5 0xb7eef148 in libgcc_s_personality () from /lib/libc.so.6
|
| 259 |
|
|
#6 0x080482ed in ?? ()
|
| 260 |
|
|
#7 0x080495b0 in ?? ()
|
| 261 |
|
|
#8 0xbfd19528 in ?? ()
|
| 262 |
|
|
#9 0xb7dd73b8 in __guard_setup () from /lib/libc.so.6
|
| 263 |
|
|
#10 0xb7dd742d in __guard_setup () from /lib/libc.so.6
|
| 264 |
|
|
#11 0x00000006 in ?? ()
|
| 265 |
|
|
#12 0xbfd19548 in ?? ()
|
| 266 |
|
|
#13 0x080483ba in ?? ()
|
| 267 |
|
|
#14 0x00000000 in ?? ()
|
| 268 |
|
|
#15 0x00000000 in ?? ()
|
| 269 |
|
|
#16 0xb7deebcc in __new_exitfn () from /lib/libc.so.6
|
| 270 |
|
|
#17 0x00000000 in ?? ()
|
| 271 |
|
|
#18 0xbfd19560 in ?? ()
|
| 272 |
|
|
#19 0xb7ef017c in nullserv () from /lib/libc.so.6
|
| 273 |
|
|
#20 0xb7dd6f37 in __libc_start_main () from /lib/libc.so.6
|
| 274 |
|
|
#21 0x00000001 in ?? ()
|
| 275 |
|
|
#22 0xbfd195d4 in ?? ()
|
| 276 |
|
|
#23 0xbfd195dc in ?? ()
|
| 277 |
|
|
#24 0x08048201 in ?? ()
|
| 278 |
|
|
</pre>
|
| 279 |
|
|
|
| 280 |
|
|
<p>
|
| 281 |
|
|
This backtrace contains a large number of ?? marks. This is because without
|
| 282 |
fox2mike |
1.3 |
debug symbols, <c>gdb</c> doesn't know how the program was run. Hence, it is
|
| 283 |
|
|
crucial that debug symbols are <e>not</e> stripped. Now remember a while ago we
|
| 284 |
vapier |
1.6 |
mentioned the -ggdb flag. Let's see what the output looks like with the flag
|
| 285 |
fox2mike |
1.3 |
enabled:
|
| 286 |
fox2mike |
1.1 |
</p>
|
| 287 |
|
|
|
| 288 |
fox2mike |
1.3 |
<pre caption="Program backtrace with -ggdb3">
|
| 289 |
|
|
(gdb) <i>bt</i>
|
| 290 |
fox2mike |
1.1 |
#0 0xb7e4bdc0 in strcpy () from /lib/libc.so.6
|
| 291 |
|
|
#1 0x0804838c in run_it (input=0x0) at bad_code.c:7
|
| 292 |
|
|
#2 0x080483ba in main (argc=1, argv=0xbfd3a434) at bad_code.c:12
|
| 293 |
|
|
</pre>
|
| 294 |
|
|
|
| 295 |
|
|
<p>
|
| 296 |
|
|
Here we see that a lot more information is available for developers. Not only is
|
| 297 |
fox2mike |
1.3 |
function information displayed, but even the exact line numbers of the source
|
| 298 |
fox2mike |
1.1 |
files. This method is the most preferred if you can spare the extra space.
|
| 299 |
vapier |
1.6 |
Here's how much the file size varies between debug, strip, and -ggdb enabled
|
| 300 |
fox2mike |
1.3 |
programs.
|
| 301 |
fox2mike |
1.1 |
</p>
|
| 302 |
|
|
|
| 303 |
vapier |
1.6 |
<pre caption="Filesize differences With -ggdb flag">
|
| 304 |
fox2mike |
1.1 |
<comment>(debug symbols stripped)</comment>
|
| 305 |
|
|
-rwxr-xr-x 1 chris users 3140 6/28 13:11 bad_code
|
| 306 |
|
|
<comment>(debug symbols enabled)</comment>
|
| 307 |
|
|
-rwxr-xr-x 1 chris users 6374 6/28 13:10 bad_code
|
| 308 |
vapier |
1.6 |
<comment>(-ggdb flag enabled)</comment>
|
| 309 |
fox2mike |
1.3 |
-rwxr-xr-x 1 chris users 19552 6/28 13:11 bad_code
|
| 310 |
fox2mike |
1.1 |
</pre>
|
| 311 |
|
|
|
| 312 |
|
|
<p>
|
| 313 |
vapier |
1.6 |
As you can see, -ggdb adds about <e>13178</e> more bytes to the file size over the one
|
| 314 |
fox2mike |
1.1 |
with debugging symbols. However, as shown above, this increase in file size can
|
| 315 |
fox2mike |
1.4 |
be worth it if presenting debug information to developers. The backtrace can be
|
| 316 |
fox2mike |
1.3 |
saved to a file by copying and pasting from the terminal (if it's a non-x based
|
| 317 |
|
|
terminal, you can use gpm. To keep this doc simple, I recommend you read up on
|
| 318 |
|
|
the documentation for gpm to see how to copy and paste with it). Now that we're
|
| 319 |
|
|
done with <c>gdb</c>, we can quit.
|
| 320 |
fox2mike |
1.1 |
</p>
|
| 321 |
|
|
|
| 322 |
|
|
<pre caption="Quitting GDB">
|
| 323 |
fox2mike |
1.3 |
(gdb) <i>quit</i>
|
| 324 |
|
|
The program is running. Exit anyway? (y or n) <i>y</i>
|
| 325 |
fox2mike |
1.1 |
$
|
| 326 |
|
|
</pre>
|
| 327 |
|
|
|
| 328 |
|
|
<p>
|
| 329 |
fox2mike |
1.3 |
This ends the walk-through of <c>gdb</c>. Using <c>gdb</c>, we hope that you will
|
| 330 |
fox2mike |
1.1 |
be able to use it to create better bug reports. However, there are other types
|
| 331 |
|
|
of errors that can cause a program to fail during run time. One of the other
|
| 332 |
|
|
ways is through improper file access. We can find those using a nifty little
|
| 333 |
|
|
tool called <c>strace</c>.
|
| 334 |
|
|
</p>
|
| 335 |
|
|
|
| 336 |
|
|
</body>
|
| 337 |
|
|
</section>
|
| 338 |
|
|
</chapter>
|
| 339 |
|
|
|
| 340 |
|
|
<chapter>
|
| 341 |
|
|
<title>Finding file access errors using strace</title>
|
| 342 |
|
|
<section>
|
| 343 |
|
|
<title>Introduction</title>
|
| 344 |
|
|
<body>
|
| 345 |
|
|
|
| 346 |
|
|
<p>
|
| 347 |
fox2mike |
1.3 |
Programs often use files to fetch configuration information, access hardware or
|
| 348 |
|
|
write logs. Sometimes, a program attempts to reach such files incorrectly. A
|
| 349 |
|
|
tool called <c>strace</c> was created to help deal with this. <c>strace</c>
|
| 350 |
|
|
traces system calls (hence the name) which include calls that use the memory and
|
| 351 |
|
|
files. For our example, we're going to take a program foobar2. This is an
|
| 352 |
|
|
updated version of foobar. However, during the change over to foobar2, you notice
|
| 353 |
|
|
all your configurations are missing! In foobar version 1, you had it setup to
|
| 354 |
|
|
say "foo", but now it's using the default "bar".
|
| 355 |
fox2mike |
1.1 |
</p>
|
| 356 |
|
|
|
| 357 |
|
|
<pre caption="Foobar2 With an invalid configuration">
|
| 358 |
|
|
$ <i>./foobar2</i>
|
| 359 |
|
|
Configuration says: bar
|
| 360 |
|
|
</pre>
|
| 361 |
|
|
|
| 362 |
|
|
<p>
|
| 363 |
|
|
Our previous configuration specifically had it set to foo, so let's use
|
| 364 |
|
|
<c>strace</c> to find out what's going on.
|
| 365 |
|
|
</p>
|
| 366 |
|
|
|
| 367 |
|
|
</body>
|
| 368 |
|
|
</section>
|
| 369 |
|
|
<section>
|
| 370 |
|
|
<title>Using strace to track the issue</title>
|
| 371 |
|
|
<body>
|
| 372 |
|
|
|
| 373 |
|
|
<p>
|
| 374 |
fox2mike |
1.3 |
We make <c>strace</c> log the results of the system calls. To do this, we run
|
| 375 |
|
|
<c>strace</c> with the -o[file] arguments. Let's use it on foobar2 as shown.
|
| 376 |
fox2mike |
1.1 |
</p>
|
| 377 |
|
|
|
| 378 |
|
|
<pre caption="Running foobar2 through strace">
|
| 379 |
|
|
# <i>strace -ostrace.log ./foobar2</i>
|
| 380 |
|
|
</pre>
|
| 381 |
|
|
|
| 382 |
|
|
<p>
|
| 383 |
fox2mike |
1.2 |
This creates a file called <path>strace.log</path> in the current directory. We
|
| 384 |
|
|
check the file, and shown below are the relevant parts from the file.
|
| 385 |
fox2mike |
1.1 |
</p>
|
| 386 |
|
|
|
| 387 |
|
|
<pre caption="A Look At the strace Log">
|
| 388 |
|
|
open(".foobar2/config", O_RDONLY) = 3
|
| 389 |
|
|
read(3, "bar", 3) = 3
|
| 390 |
|
|
</pre>
|
| 391 |
|
|
|
| 392 |
|
|
<p>
|
| 393 |
|
|
Aha! So There's the problem. Someone moved the configuration directory to
|
| 394 |
|
|
<path>.foobar2</path> instead of <path>.foobar</path>. We also see the program
|
| 395 |
|
|
reading in "bar" as it should. In this case, we can recommend the ebuild
|
| 396 |
|
|
maintainer to put a warning about it. For now though, we can copy over the
|
| 397 |
fox2mike |
1.2 |
config file from <path>.foobar</path> and modify it to produce the correct
|
| 398 |
neysx |
1.5 |
results.
|
| 399 |
fox2mike |
1.1 |
</p>
|
| 400 |
|
|
|
| 401 |
|
|
</body>
|
| 402 |
|
|
</section>
|
| 403 |
|
|
<section>
|
| 404 |
|
|
<title>Conclusion</title>
|
| 405 |
|
|
<body>
|
| 406 |
|
|
|
| 407 |
|
|
<p>
|
| 408 |
|
|
Now we've taken care of finding run time bugs. These bugs prove to be
|
| 409 |
|
|
problematic when you try and run your programs. However, run time errors are
|
| 410 |
fox2mike |
1.3 |
the least of your concerns if your program won't compile at all. Let's take a
|
| 411 |
fox2mike |
1.1 |
look at how to address <c>emerge</c> compile errors.
|
| 412 |
|
|
</p>
|
| 413 |
|
|
|
| 414 |
|
|
</body>
|
| 415 |
|
|
</section>
|
| 416 |
|
|
</chapter>
|
| 417 |
|
|
|
| 418 |
|
|
<chapter>
|
| 419 |
|
|
<title>Handling emerge Errors</title>
|
| 420 |
|
|
<section>
|
| 421 |
|
|
<title>Introduction</title>
|
| 422 |
|
|
<body>
|
| 423 |
|
|
|
| 424 |
|
|
<p>
|
| 425 |
|
|
<c>emerge</c> errors, such as the one displayed earlier, can be a major cause
|
| 426 |
fox2mike |
1.3 |
of frustration for users. Reporting them is considered crucial for maintaining
|
| 427 |
|
|
the health of Gentoo. Let's take a look at a sample ebuild, foobar2, which
|
| 428 |
|
|
contains some build errors.
|
| 429 |
fox2mike |
1.1 |
</p>
|
| 430 |
|
|
|
| 431 |
|
|
</body>
|
| 432 |
|
|
</section>
|
| 433 |
|
|
<section id="emerge_error">
|
| 434 |
|
|
<title>Evaluating emerge Errors</title>
|
| 435 |
|
|
<body>
|
| 436 |
|
|
|
| 437 |
|
|
<p>
|
| 438 |
|
|
Let's take a look at this very simple <c>emerge</c> error:
|
| 439 |
|
|
</p>
|
| 440 |
|
|
|
| 441 |
|
|
<pre caption="emerge Error">
|
| 442 |
|
|
gcc -D__TEST__ -D__GNU__ -D__LINUX__ -L/usr/lib -I/usr/include -L/usr/lib/nspr/ -I/usr/include/fmod -c -o foobar2-7.o foobar2-7.c
|
| 443 |
|
|
gcc -D__TEST__ -D__GNU__ -D__LINUX__ -L/usr/lib -I/usr/include -L/usr/lib/nspr/ -I/usr/include/fmod -c -o foobar2-8.o foobar2-8.c
|
| 444 |
|
|
gcc -D__TEST__ -D__GNU__ -D__LINUX__ -L/usr/lib -I/usr/include -L/usr/lib/nspr/ -I/usr/include/fmod -c -o foobar2-9.o foobar2-9.c
|
| 445 |
|
|
gcc -D__TEST__ -D__GNU__ -D__LINUX__ -L/usr/lib -I/usr/include -L/usr/lib/nspr/ -I/usr/include/fmod -c -o foobar2.o foobar2.c
|
| 446 |
|
|
foobar2.c:1:17: ogg.h: No such file or directory
|
| 447 |
|
|
make: *** [foobar2.o] Error 1
|
| 448 |
|
|
|
| 449 |
|
|
!!! ERROR: sys-apps/foobar2-1.0 failed.
|
| 450 |
|
|
!!! Function src_compile, Line 19, Exitcode 2
|
| 451 |
|
|
!!! Make failed!
|
| 452 |
|
|
!!! If you need support, post the topmost build error, NOT this status message
|
| 453 |
|
|
</pre>
|
| 454 |
|
|
|
| 455 |
|
|
<p>
|
| 456 |
fox2mike |
1.3 |
The program is compiling smoothly when it suddenly stops and presents an error message. This
|
| 457 |
|
|
particular error can be split into 3 different sections, The compile messages, the build
|
| 458 |
fox2mike |
1.1 |
error, and the emerge error message as shown below.
|
| 459 |
|
|
</p>
|
| 460 |
|
|
|
| 461 |
|
|
<pre caption="Parts of the error">
|
| 462 |
fox2mike |
1.3 |
<comment>(Compilation Messages)</comment>
|
| 463 |
fox2mike |
1.1 |
gcc -D__TEST__ -D__GNU__ -D__LINUX__ -L/usr/lib -I/usr/include -L/usr/lib/nspr/ -I/usr/include/fmod -c -o foobar2-7.o foobar2-7.c
|
| 464 |
|
|
gcc -D__TEST__ -D__GNU__ -D__LINUX__ -L/usr/lib -I/usr/include -L/usr/lib/nspr/ -I/usr/include/fmod -c -o foobar2-8.o foobar2-8.c
|
| 465 |
|
|
gcc -D__TEST__ -D__GNU__ -D__LINUX__ -L/usr/lib -I/usr/include -L/usr/lib/nspr/ -I/usr/include/fmod -c -o foobar2-9.o foobar2-9.c
|
| 466 |
|
|
gcc -D__TEST__ -D__GNU__ -D__LINUX__ -L/usr/lib -I/usr/include -L/usr/lib/nspr/ -I/usr/include/fmod -c -o foobar2.o foobar2.c
|
| 467 |
|
|
|
| 468 |
|
|
<comment>(Build Error)</comment>
|
| 469 |
|
|
foobar2.c:1:17: ogg.h: No such file or directory
|
| 470 |
|
|
make: *** [foobar2.o] Error 1
|
| 471 |
|
|
|
| 472 |
fox2mike |
1.3 |
<comment>(emerge Error)</comment>
|
| 473 |
fox2mike |
1.1 |
!!! ERROR: sys-apps/foobar2-1.0 failed.
|
| 474 |
|
|
!!! Function src_compile, Line 19, Exitcode 2
|
| 475 |
|
|
!!! Make failed!
|
| 476 |
|
|
!!! If you need support, post the topmost build error, NOT this status message
|
| 477 |
|
|
</pre>
|
| 478 |
|
|
|
| 479 |
|
|
<p>
|
| 480 |
fox2mike |
1.3 |
The compilation messages are what lead up to the error. Most often, it's good to
|
| 481 |
|
|
at least include 10 lines of compile information so that the developer knows
|
| 482 |
|
|
where the compilation was at when the error occurred.
|
| 483 |
|
|
</p>
|
| 484 |
|
|
|
| 485 |
|
|
<p>
|
| 486 |
|
|
Make errors are the actual error and the information the developer needs. When
|
| 487 |
|
|
you see "make: ***", this is often where the error has occurred. Normally, you
|
| 488 |
|
|
can copy and paste 10 lines above it and the developer will be able to address
|
| 489 |
|
|
the issue. However, this may not always work and we'll take a look at an
|
| 490 |
|
|
alternative shortly.
|
| 491 |
|
|
</p>
|
| 492 |
|
|
|
| 493 |
|
|
<p>
|
| 494 |
|
|
The emerge error is what <c>emerge</c> throws out as an error. Sometimes, this
|
| 495 |
|
|
might also contain some important information. Often people make the mistake of
|
| 496 |
|
|
posting the emerge error and that's all. This is useless by itself, but with
|
| 497 |
|
|
make error and compile information, a developer can get what application and
|
| 498 |
|
|
what version of the package is failing. As a side note, make is commonly used as
|
| 499 |
|
|
the build process for programs (<b>but not always</b>). If you can't find a
|
| 500 |
|
|
"make: ***" error anywhere, then simply copy and paste 20 lines before the
|
| 501 |
|
|
emerge error. This should take care of most all build system error messages. Now
|
| 502 |
|
|
let's say the errors seem to be quite large. 10 lines won't be enough to catch
|
| 503 |
|
|
everything. That's where PORT_LOGDIR comes into play.
|
| 504 |
fox2mike |
1.1 |
</p>
|
| 505 |
|
|
|
| 506 |
|
|
</body>
|
| 507 |
|
|
</section>
|
| 508 |
|
|
<section>
|
| 509 |
|
|
<title>emerge and PORT_LOGDIR</title>
|
| 510 |
|
|
<body>
|
| 511 |
|
|
|
| 512 |
|
|
<p>
|
| 513 |
neysx |
1.5 |
PORT_LOGDIR is a portage variable that sets up a log directory for separate
|
| 514 |
|
|
emerge logs. Let's take a look and see what that entails. First, run your
|
| 515 |
|
|
emerge with PORT_LOGDIR set to your favorite log location. Let's say we have a
|
| 516 |
fox2mike |
1.3 |
location <path>/var/log/portage</path>. We'll use that for our log directory:
|
| 517 |
fox2mike |
1.1 |
</p>
|
| 518 |
|
|
|
| 519 |
|
|
<note>
|
| 520 |
fox2mike |
1.3 |
In the default setup, <path>/var/log/portage</path> does not exist, and you will
|
| 521 |
|
|
most likely have to create it. If you do not, portage will fail to write the
|
| 522 |
|
|
logs.
|
| 523 |
fox2mike |
1.1 |
</note>
|
| 524 |
|
|
|
| 525 |
|
|
<pre caption="emerge-ing With PORT_LOGDIR">
|
| 526 |
|
|
# <i>PORT_LOGDIR=/var/log/portage emerge foobar2</i>
|
| 527 |
|
|
</pre>
|
| 528 |
|
|
|
| 529 |
|
|
<p>
|
| 530 |
|
|
Now the emerge fails again. However, this time we have a log we can work with,
|
| 531 |
|
|
and attach to the bug later on. Let's take a quick look at our log directory.
|
| 532 |
|
|
</p>
|
| 533 |
|
|
|
| 534 |
|
|
<pre caption="PORT_LOGDIR Contents">
|
| 535 |
|
|
# <i>ls -la /var/log/portage</i>
|
| 536 |
|
|
total 16
|
| 537 |
|
|
drwxrws--- 2 root root 4096 Jun 30 10:08 .
|
| 538 |
|
|
drwxr-xr-x 15 root root 4096 Jun 30 10:08 ..
|
| 539 |
|
|
-rw-r--r-- 1 root root 7390 Jun 30 10:09 2115-foobar2-1.0.log
|
| 540 |
|
|
</pre>
|
| 541 |
|
|
|
| 542 |
|
|
<p>
|
| 543 |
|
|
The log files have the format [counter]-[package name]-[version].log. Counter
|
| 544 |
|
|
is a special variable that is meant to state this package as the n-th package
|
| 545 |
|
|
you've emerged. This prevents duplicate logs from appearing. A quick look at
|
| 546 |
|
|
the log file will show the entire emerge process. This can be attached later
|
| 547 |
|
|
on as we'll see in the bug reporting section. Now that we've safely obtained
|
| 548 |
|
|
our information needed to report the bug we can continue to do so. However,
|
| 549 |
|
|
before we get started on that, we need to make sure no one else has reported
|
| 550 |
|
|
the issue. Let's take a look at searching for bugs.
|
| 551 |
|
|
</p>
|
| 552 |
|
|
|
| 553 |
|
|
</body>
|
| 554 |
|
|
</section>
|
| 555 |
|
|
</chapter>
|
| 556 |
|
|
|
| 557 |
|
|
<chapter>
|
| 558 |
|
|
<title>Searching Using Bugzilla</title>
|
| 559 |
|
|
<section>
|
| 560 |
|
|
<title>Introduction</title>
|
| 561 |
|
|
<body>
|
| 562 |
|
|
|
| 563 |
|
|
<p>
|
| 564 |
|
|
<uri link="http://www.bugzilla.org">Bugzilla</uri> is what we at Gentoo use to
|
| 565 |
|
|
handle bugs. Gentoo's Bugzilla is reachable by HTTPS and HTTP. HTTPS is
|
| 566 |
|
|
available for those on insecure networks or simply paranoid :). For the sake of
|
| 567 |
fox2mike |
1.3 |
consistency, we will be using the HTTPS version in the examples to follow. Head
|
| 568 |
fox2mike |
1.1 |
over to <uri link="https://bugs.gentoo.org">Gentoo Bugs</uri> to see how it
|
| 569 |
|
|
looks.
|
| 570 |
|
|
</p>
|
| 571 |
|
|
|
| 572 |
|
|
<p>
|
| 573 |
fox2mike |
1.3 |
One of the most frustrating things for developers and bug-wranglers is finding
|
| 574 |
|
|
duplicate bug reports. These cost them valuable time that they could otherwise
|
| 575 |
|
|
use to work on more important bugs. Often, this can be prevented by a few simple
|
| 576 |
fox2mike |
1.1 |
search methods. So we're going to see how to search for bugs and find out if
|
| 577 |
|
|
you have one that's similar. For this example, we're going to use the xclass
|
| 578 |
fox2mike |
1.3 |
emerge error that was used earlier.
|
| 579 |
fox2mike |
1.1 |
</p>
|
| 580 |
|
|
|
| 581 |
|
|
<pre caption="xclass emerge error">
|
| 582 |
|
|
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/g++-v3/backward/backward_warning.h:32:2:
|
| 583 |
|
|
warning: #warning This file includes at least one deprecated or antiquated
|
| 584 |
|
|
header. Please consider using one of the 32 headers found in section 17.4.1.2 of
|
| 585 |
|
|
the C++ standard. Examples include substituting the <X> header for the <X.h>
|
| 586 |
|
|
header for C++ includes, or <sstream> instead of the deprecated header
|
| 587 |
|
|
<strstream.h>. To disable this warning use -Wno-deprecated.
|
| 588 |
|
|
In file included from main.cc:40:
|
| 589 |
|
|
menudef.h:55: error: brace-enclosed initializer used to initialize `
|
| 590 |
|
|
OXPopupMenu*'
|
| 591 |
|
|
menudef.h:62: error: brace-enclosed initializer used to initialize `
|
| 592 |
|
|
OXPopupMenu*'
|
| 593 |
|
|
menudef.h:70: error: brace-enclosed initializer used to initialize `
|
| 594 |
|
|
OXPopupMenu*'
|
| 595 |
|
|
menudef.h:78: error: brace-enclosed initializer used to initialize `
|
| 596 |
|
|
OXPopupMenu*'
|
| 597 |
|
|
main.cc: In member function `void OXMain::DoOpen()':
|
| 598 |
|
|
main.cc:323: warning: unused variable `FILE*fp'
|
| 599 |
|
|
main.cc: In member function `void OXMain::DoSave(char*)':
|
| 600 |
|
|
main.cc:337: warning: unused variable `FILE*fp'
|
| 601 |
|
|
make[1]: *** [main.o] Error 1
|
| 602 |
|
|
make[1]: Leaving directory
|
| 603 |
|
|
`/var/tmp/portage/xclass-0.7.4/work/xclass-0.7.4/example-app'
|
| 604 |
|
|
make: *** [shared] Error 2
|
| 605 |
|
|
|
| 606 |
|
|
!!! ERROR: x11-libs/xclass-0.7.4 failed.
|
| 607 |
|
|
!!! Function src_compile, Line 29, Exitcode 2
|
| 608 |
|
|
!!! 'emake shared' failed
|
| 609 |
|
|
</pre>
|
| 610 |
|
|
|
| 611 |
|
|
<p>
|
| 612 |
|
|
So to begin searching, we head over to the <uri
|
| 613 |
fox2mike |
1.2 |
link="https://bugs.gentoo.org/">Bugzilla Homepage</uri>.
|
| 614 |
fox2mike |
1.1 |
</p>
|
| 615 |
|
|
|
| 616 |
|
|
<figure link="/images/docs/bugzie-homepage.png" caption="Bugzilla Homepage"/>
|
| 617 |
|
|
|
| 618 |
|
|
<p>
|
| 619 |
fox2mike |
1.3 |
We'll click on "Query Existing bug reports". The reason why we choose this
|
| 620 |
|
|
over the basic bug search is because the basic bug search tends to give vague
|
| 621 |
|
|
results and often hinders users from looking through the results and finding the
|
| 622 |
|
|
duplicate bug. Once we click on the query screen, we reach the next page:
|
| 623 |
fox2mike |
1.1 |
</p>
|
| 624 |
|
|
|
| 625 |
|
|
<figure link="/images/docs/bugzie-search.png" caption="Bugzilla Search Page"/>
|
| 626 |
|
|
|
| 627 |
|
|
<note>
|
| 628 |
|
|
If you've used the Advanced Search before, you'll most likely see that screen
|
| 629 |
|
|
instead.
|
| 630 |
|
|
</note>
|
| 631 |
|
|
|
| 632 |
|
|
<p>
|
| 633 |
fox2mike |
1.3 |
Proceed by clicking on the "Advanced Search" link to bring up the Advanced
|
| 634 |
|
|
Search page.
|
| 635 |
fox2mike |
1.1 |
</p>
|
| 636 |
|
|
|
| 637 |
|
|
<figure link="/images/docs/bugzie-adv-search.png" caption="Advanced Search Page"/>
|
| 638 |
|
|
|
| 639 |
|
|
<p>
|
| 640 |
|
|
This is how the Advanced Search Page looks like. While it may seem overwhelming
|
| 641 |
|
|
at first, we're going to look at a few simple areas to narrow down the rather
|
| 642 |
neysx |
1.5 |
vague searches bugzilla returns.
|
| 643 |
fox2mike |
1.1 |
</p>
|
| 644 |
|
|
|
| 645 |
|
|
<figure link="/images/docs/bugzie-content.png" caption="Content"/>
|
| 646 |
|
|
|
| 647 |
|
|
<p>
|
| 648 |
|
|
The first field is the summary of the bug. Here we're simply going to put the
|
| 649 |
fox2mike |
1.3 |
name of the package that's crashing. If bugzie doesn't return results, try
|
| 650 |
fox2mike |
1.1 |
removing the package name, just in case someone didn't put that in the summary
|
| 651 |
fox2mike |
1.3 |
(highly unlikely, but we've seen a fair share of strange bug reports).
|
| 652 |
fox2mike |
1.1 |
</p>
|
| 653 |
|
|
|
| 654 |
|
|
<p>
|
| 655 |
|
|
Product, Component, and Version should all be set to the default. This
|
| 656 |
|
|
prevents us from being too specific and missing all the bugs.
|
| 657 |
|
|
</p>
|
| 658 |
|
|
|
| 659 |
|
|
<p>
|
| 660 |
fox2mike |
1.3 |
Comment is the important part. Use the comment field to list what appears to be a
|
| 661 |
fox2mike |
1.1 |
specific instance of the error. Basically, don't use anything like the
|
| 662 |
|
|
beginning of the build error, find a line that's before it stating a true
|
| 663 |
|
|
error. Also, you'll want to filter out any punctuation to prevent bugzilla
|
| 664 |
|
|
from interpreting the results the comment the wrong way. Example from the xclass
|
| 665 |
|
|
emerge error:
|
| 666 |
|
|
</p>
|
| 667 |
|
|
|
| 668 |
|
|
<pre caption="Comment Line Content">
|
| 669 |
|
|
menudef.h:78: error: brace-enclosed initializer used to initialize `OXPopupMenu'
|
| 670 |
|
|
<comment>(Remove the quotes ' ')</comment>
|
| 671 |
|
|
menudef.h 78 error brace-enclosed initializer used to initialize OXPopupMenu
|
| 672 |
|
|
</pre>
|
| 673 |
|
|
|
| 674 |
|
|
<p>
|
| 675 |
|
|
The above is specific enough to where we'll find the bug without wading through
|
| 676 |
|
|
other xclass compile failure candidates.
|
| 677 |
|
|
</p>
|
| 678 |
|
|
|
| 679 |
|
|
<p>
|
| 680 |
|
|
URI, Whiteboard, and Keywords can all be left alone. What we've entered so far
|
| 681 |
fox2mike |
1.3 |
should be enough to find our bug. Let's take a look at what we have filled out.
|
| 682 |
fox2mike |
1.1 |
</p>
|
| 683 |
|
|
|
| 684 |
|
|
<figure link="/images/docs/bugzie-comp-search.png" caption="Completed Search Form"/>
|
| 685 |
|
|
|
| 686 |
|
|
<p>
|
| 687 |
fox2mike |
1.3 |
Now we click on the Search button and here come the results...
|
| 688 |
fox2mike |
1.1 |
</p>
|
| 689 |
|
|
|
| 690 |
|
|
<figure link="/images/docs/bugzie-search-result.png" caption="Search Results"/>
|
| 691 |
|
|
|
| 692 |
|
|
<p>
|
| 693 |
|
|
Only 2 bugs! That's a lot easier to deal with. We click on the first one to
|
| 694 |
fox2mike |
1.3 |
check, and sure enough it's the one we're looking for.
|
| 695 |
fox2mike |
1.1 |
</p>
|
| 696 |
|
|
|
| 697 |
|
|
<figure link="/images/docs/bugzie-located.png" caption="Bug Located"/>
|
| 698 |
|
|
|
| 699 |
|
|
<p>
|
| 700 |
|
|
Not only is it the one we want, but it has also been resolved. By checking the
|
| 701 |
|
|
last comment we see the solution and know what to do in order to resolve it.
|
| 702 |
fox2mike |
1.3 |
Now, let's see what would have happened if we had not used the advanced search.
|
| 703 |
fox2mike |
1.1 |
</p>
|
| 704 |
|
|
|
| 705 |
|
|
<figure link="/images/docs/bugzie-basic-search-result.png" caption="Basic Search Results"/>
|
| 706 |
|
|
|
| 707 |
|
|
<p>
|
| 708 |
|
|
4 more bugs to deal with! It gets even worse with larger packages. However,
|
| 709 |
|
|
with these simple tools, we're able to significantly narrow down the search to
|
| 710 |
|
|
try and locate a specific bug.
|
| 711 |
|
|
</p>
|
| 712 |
|
|
|
| 713 |
|
|
</body>
|
| 714 |
|
|
</section>
|
| 715 |
|
|
<section>
|
| 716 |
|
|
<title>Conclusion</title>
|
| 717 |
|
|
<body>
|
| 718 |
|
|
|
| 719 |
|
|
<p>
|
| 720 |
|
|
Let's say that you have searched and searched but still can't find a bug.
|
| 721 |
|
|
You've found yourself a new bug. Let's take a look at the bug reporting process
|
| 722 |
|
|
for submitting your new bug.
|
| 723 |
|
|
</p>
|
| 724 |
|
|
|
| 725 |
|
|
</body>
|
| 726 |
|
|
</section>
|
| 727 |
|
|
</chapter>
|
| 728 |
|
|
|
| 729 |
|
|
<chapter>
|
| 730 |
|
|
<title>Reporting Bugs</title>
|
| 731 |
|
|
<section>
|
| 732 |
|
|
<title>Introduction</title>
|
| 733 |
|
|
<body>
|
| 734 |
|
|
|
| 735 |
|
|
<p>
|
| 736 |
|
|
In this chapter, we'll figure out how to use Bugzilla to file a shiny, new bug.
|
| 737 |
|
|
Head over to <uri link="https://bugs.gentoo.org">Gentoo Bugs</uri> and...
|
| 738 |
|
|
</p>
|
| 739 |
|
|
|
| 740 |
|
|
<figure link="/images/docs/bugzie-homepage.png" caption="Bugzilla Homepage"/>
|
| 741 |
|
|
|
| 742 |
|
|
<p>
|
| 743 |
fox2mike |
1.3 |
Click on "Report a Bug - Using the guided format".
|
| 744 |
fox2mike |
1.1 |
</p>
|
| 745 |
|
|
|
| 746 |
|
|
<figure link="/images/docs/bugzie-prod-select.png" caption="Product Selection"/>
|
| 747 |
|
|
|
| 748 |
|
|
<p>
|
| 749 |
|
|
As you can see, <b>major</b> emphasis has been placed on putting your bug in the
|
| 750 |
fox2mike |
1.3 |
right place. Gentoo Linux is where a large majority of bugs go.
|
| 751 |
|
|
</p>
|
| 752 |
|
|
|
| 753 |
|
|
<p>
|
| 754 |
|
|
Despite this, some people will file ebuild bugs in portage development
|
| 755 |
|
|
(assumption that portage team handles the portage tree) or infra (assumption
|
| 756 |
|
|
that infra has access to mirrors and rsync and can fix it directly). This is
|
| 757 |
|
|
simply not how things work.
|
| 758 |
|
|
</p>
|
| 759 |
|
|
|
| 760 |
|
|
<p>
|
| 761 |
|
|
Another common misconception occurs with our Documentation bugs. For example, a
|
| 762 |
neysx |
1.5 |
user finds a bug with the <uri link="/proj/en/releng/catalyst/">Catalyst
|
| 763 |
fox2mike |
1.3 |
Docs</uri>. The general tendency is to file a bug under Docs-user, which gets
|
| 764 |
|
|
assigned to the <uri link="http://gdp.gentoo.org">GDP</uri>, when it should
|
| 765 |
neysx |
1.5 |
actually go to a member of the <uri link="/proj/en/releng/">Release
|
| 766 |
|
|
Engineering</uri> team. As a rule of thumb, only documentation under
|
| 767 |
|
|
<path>http://www.gentoo.org/doc/*</path> is under the GDP. Anything under
|
| 768 |
|
|
<path>http://www.gentoo.org/proj/*</path> is under the respective teams.
|
| 769 |
fox2mike |
1.1 |
</p>
|
| 770 |
|
|
|
| 771 |
|
|
<note>
|
| 772 |
fox2mike |
1.3 |
We would rather see a bug whose product was not supposed to be Gentoo Linux but
|
| 773 |
|
|
has been filed under the same rather than seeing a bug which belongs the Gentoo
|
| 774 |
|
|
Linux product and filed elsewhere. While neither is preferred, the former is more
|
| 775 |
|
|
acceptable and understandable (except website bugs.. we might have an issue with
|
| 776 |
|
|
that...).
|
| 777 |
fox2mike |
1.1 |
</note>
|
| 778 |
|
|
|
| 779 |
|
|
<p>
|
| 780 |
neysx |
1.5 |
Our bug goes in Gentoo Linux as it's an ebuild bug. We head over there and are
|
| 781 |
|
|
presented with the multi-step bug reporting process. Let us now proceed with
|
| 782 |
|
|
Step 1...
|
| 783 |
fox2mike |
1.1 |
</p>
|
| 784 |
|
|
|
| 785 |
|
|
<figure link="/images/docs/bugzie-guide-step1.png" caption="Guided Format Step 1"/>
|
| 786 |
|
|
|
| 787 |
|
|
<p>
|
| 788 |
|
|
The first step here is really important (as the red text tells you). This is
|
| 789 |
|
|
where you search to see that someone else hasn't hit the same bug you have, yet.
|
| 790 |
fox2mike |
1.3 |
If you do skip this step and a bug like yours already exists, it will be marked
|
| 791 |
fox2mike |
1.1 |
as a DUPLICATE thus wasting a large amount of QA effort. To give you an idea,
|
| 792 |
fox2mike |
1.3 |
the bug numbers that are struck out above are duplicate bugs. Now comes step 2,
|
| 793 |
fox2mike |
1.1 |
where we give the information.
|
| 794 |
|
|
</p>
|
| 795 |
|
|
|
| 796 |
|
|
</body>
|
| 797 |
|
|
</section>
|
| 798 |
|
|
<section>
|
| 799 |
|
|
<title>Required Information</title>
|
| 800 |
|
|
<body>
|
| 801 |
|
|
|
| 802 |
fox2mike |
1.3 |
<figure link="/images/docs/bugzie-basic.png" caption="Basic Information"/>
|
| 803 |
|
|
|
| 804 |
fox2mike |
1.1 |
<p>
|
| 805 |
fox2mike |
1.3 |
Let us take a closer look at what's what.
|
| 806 |
fox2mike |
1.1 |
</p>
|
| 807 |
|
|
|
| 808 |
fox2mike |
1.3 |
<ul>
|
| 809 |
|
|
<li>
|
| 810 |
neysx |
1.5 |
First, there's the Product. The product will narrow down the bug to a
|
| 811 |
|
|
specific area of Gentoo like Bugzilla (for bugs relating to
|
| 812 |
|
|
bugs.gentoo.org), Docs-user(for User Documentation) or Gentoo Linux (for
|
| 813 |
|
|
ebuilds and the like).
|
| 814 |
fox2mike |
1.3 |
</li>
|
| 815 |
|
|
<li>
|
| 816 |
neysx |
1.5 |
Component is where exactly the problem occurs, more specifically which part
|
| 817 |
|
|
of selected product the bug comes under. This makes classification easier.
|
| 818 |
fox2mike |
1.3 |
</li>
|
| 819 |
|
|
<li>
|
| 820 |
neysx |
1.5 |
Hardware platform is what architecture you're running. If you were running
|
| 821 |
|
|
SPARC, you would set it to SPARC.
|
| 822 |
fox2mike |
1.3 |
</li>
|
| 823 |
|
|
<li>
|
| 824 |
neysx |
1.5 |
Operating System is what Operating System you're using. Because Gentoo is
|
| 825 |
|
|
considered a "Meta-distribution", it can run on other operating systems
|
| 826 |
|
|
beside Linux.
|
| 827 |
fox2mike |
1.3 |
</li>
|
| 828 |
|
|
</ul>
|
| 829 |
fox2mike |
1.1 |
|
| 830 |
|
|
<p>
|
| 831 |
fox2mike |
1.3 |
So, for our example bug, we have :
|
| 832 |
fox2mike |
1.1 |
</p>
|
| 833 |
|
|
|
| 834 |
fox2mike |
1.3 |
<ul>
|
| 835 |
neysx |
1.5 |
<li>Product - Gentoo Linux (Since it is an ebuild issue)</li>
|
| 836 |
|
|
<li>Component - Application (It is an application at fault, foobar2)</li>
|
| 837 |
|
|
<li>Hardware Platform - All (This error could occur across architectures)</li>
|
| 838 |
|
|
<li>Operation System - All (It could occur on all types of systems)</li>
|
| 839 |
fox2mike |
1.3 |
</ul>
|
| 840 |
|
|
|
| 841 |
fox2mike |
1.1 |
<figure link="/images/docs/bugzie-basic-comp.png" caption="Completed Basic Information"/>
|
| 842 |
|
|
|
| 843 |
fox2mike |
1.3 |
<ul>
|
| 844 |
|
|
<li>
|
| 845 |
neysx |
1.5 |
Build Identifier is basically the User Agent of the browser that is being
|
| 846 |
|
|
used to report the bugs (for logging purposes). You can just leave this as
|
| 847 |
|
|
is.
|
| 848 |
fox2mike |
1.3 |
</li>
|
| 849 |
|
|
<li>
|
| 850 |
neysx |
1.5 |
URL is optional and is used to point to errors on a site someplace
|
| 851 |
|
|
(pastebin, etc.). However, doing it inside the bug allows the developers be
|
| 852 |
|
|
able to reference to it at any time and is preferred.
|
| 853 |
fox2mike |
1.3 |
</li>
|
| 854 |
|
|
<li>
|
| 855 |
neysx |
1.5 |
In the Summary, you should put the package category, name, and number.
|
| 856 |
fox2mike |
1.3 |
</li>
|
| 857 |
|
|
</ul>
|
| 858 |
|
|
|
| 859 |
fox2mike |
1.1 |
<p>
|
| 860 |
fox2mike |
1.3 |
Not including the category in the summary really isn't too bad, but it's
|
| 861 |
|
|
recommended. If you don't include the package name, however, we won't know what
|
| 862 |
|
|
you're filling a bug for, and will have to ask you about it later. The version
|
| 863 |
|
|
number is important for people searching for bugs. If 20 people filed bugs and
|
| 864 |
|
|
not one put a version number, how would people looking for similar bugs be able
|
| 865 |
|
|
to tell if one was there's? They'd have to look through every single bug, which
|
| 866 |
|
|
isn't too hard, but if there are say, 200 bugs.. it's not that easy. After all
|
| 867 |
|
|
the package information, you'll want to include a small description of the
|
| 868 |
|
|
incident. Here's an example:
|
| 869 |
fox2mike |
1.1 |
</p>
|
| 870 |
|
|
|
| 871 |
|
|
<figure link="/images/docs/bugzie-summary.png" caption="Summary"/>
|
| 872 |
|
|
|
| 873 |
|
|
<p>
|
| 874 |
fox2mike |
1.3 |
These simple rules can make handling bugs a lot easier. Next are the details.
|
| 875 |
|
|
Here we put in the information about the bug. We'll demonstrate with an example:
|
| 876 |
fox2mike |
1.1 |
</p>
|
| 877 |
|
|
|
| 878 |
|
|
<figure link="/images/docs/bugzie-details.png" caption="Details"/>
|
| 879 |
|
|
|
| 880 |
|
|
<p>
|
| 881 |
fox2mike |
1.3 |
Now the developer knows why we're filing the bug. They can then try to
|
| 882 |
fox2mike |
1.1 |
reproduce it. Reproducibility tells us how often we were able to make the
|
| 883 |
|
|
problem recur. In this example, we can reproduce it any time simply by running
|
| 884 |
fox2mike |
1.3 |
foobar2. Let's put that information in.
|
| 885 |
fox2mike |
1.1 |
</p>
|
| 886 |
|
|
|
| 887 |
|
|
<figure link="/images/docs/bugzie-reprod.png" caption="Reproduction"/>
|
| 888 |
|
|
|
| 889 |
|
|
<p>
|
| 890 |
fox2mike |
1.3 |
We have explained how we found the bug. The next step is to explain what were
|
| 891 |
|
|
the results we got and what we think they should actually be.
|
| 892 |
fox2mike |
1.1 |
</p>
|
| 893 |
|
|
|
| 894 |
|
|
<figure link="/images/docs/bugzie-results.png" caption="Results"/>
|
| 895 |
|
|
|
| 896 |
|
|
<p>
|
| 897 |
neysx |
1.5 |
We could then provide additional information. This could be things such as
|
| 898 |
|
|
stack traces, <b>sections</b> (since the whole log is usually big and of not
|
| 899 |
|
|
much use) of strace logs, but most importantly, your <c>emerge --info</c>
|
| 900 |
|
|
output. Here's an example.
|
| 901 |
fox2mike |
1.1 |
</p>
|
| 902 |
|
|
|
| 903 |
|
|
<figure link="/images/docs/bugzie-addl-info.png" caption="Additional Information"/>
|
| 904 |
|
|
|
| 905 |
|
|
<p>
|
| 906 |
|
|
Lastly we select the severity of the bug. Please look this over carefully. In
|
| 907 |
|
|
most cases it's OK to leave it as is and someone will raise/lower it for you.
|
| 908 |
|
|
However, if you raise the severity of the bug, please make sure you read it over
|
| 909 |
fox2mike |
1.3 |
carefully and make sure you're not making a mistake. A run down of the various
|
| 910 |
|
|
levels is given below.
|
| 911 |
fox2mike |
1.1 |
</p>
|
| 912 |
|
|
|
| 913 |
fox2mike |
1.3 |
<ul>
|
| 914 |
|
|
<li>
|
| 915 |
neysx |
1.5 |
Blocker - The program just plain doesn't want to emerge or is a major
|
| 916 |
|
|
hinderance to the system. For example a <c>baselayout</c> issue which
|
| 917 |
|
|
prevents a system from booting up would be a sure candidate to be labelled
|
| 918 |
|
|
blocker.
|
| 919 |
fox2mike |
1.3 |
</li>
|
| 920 |
|
|
<li>
|
| 921 |
neysx |
1.5 |
Critical - The program has loss of data or severe memory leaks during
|
| 922 |
|
|
runtime. Again, an important program like say <c>net-tools</c> failing to
|
| 923 |
|
|
compile could be labelled critical. It won't prevent the system from
|
| 924 |
|
|
starting up, but is quite essential for day to day stuff.
|
| 925 |
fox2mike |
1.3 |
</li>
|
| 926 |
|
|
<li>
|
| 927 |
neysx |
1.5 |
Major - The program crashes, but nothing that causes your system severe
|
| 928 |
|
|
damage or information loss.
|
| 929 |
fox2mike |
1.3 |
</li>
|
| 930 |
|
|
<li>
|
| 931 |
neysx |
1.5 |
Minor - Your program crashes here and there with apparent workarounds.
|
| 932 |
fox2mike |
1.3 |
</li>
|
| 933 |
|
|
<li>
|
| 934 |
neysx |
1.5 |
Normal - The default. If you're not sure leave it here unless it's a new
|
| 935 |
|
|
build or cosmetic change, then read below for more information.
|
| 936 |
fox2mike |
1.3 |
</li>
|
| 937 |
neysx |
1.5 |
<li>Trivial - Things such as a mispelled word or whitespace clean up. </li>
|
| 938 |
fox2mike |
1.3 |
<li>
|
| 939 |
neysx |
1.5 |
Enhancement - A request to enable a new feature in a program, or more
|
| 940 |
|
|
specifically <e>new ebuilds</e>.
|
| 941 |
fox2mike |
1.3 |
</li>
|
| 942 |
|
|
</ul>
|
| 943 |
|
|
|
| 944 |
fox2mike |
1.1 |
<figure link="/images/docs/bugzie-sev.png" caption="Severity"/>
|
| 945 |
|
|
|
| 946 |
|
|
<p>
|
| 947 |
fox2mike |
1.3 |
Here, we'll set it to Normal.
|
| 948 |
|
|
</p>
|
| 949 |
|
|
|
| 950 |
|
|
<p>
|
| 951 |
fox2mike |
1.1 |
Now we can submit the bug report by clicking on the Submit Bug Report box. You
|
| 952 |
|
|
will now see your new bug come up. See <uri
|
| 953 |
|
|
link="https://bugs.gentoo.org/show_bug.cgi?id=97265">Bug 97561</uri> for what
|
| 954 |
|
|
the result looks like. We've reported our bug! Now let's see how it's dealt
|
| 955 |
|
|
with.
|
| 956 |
|
|
</p>
|
| 957 |
|
|
|
| 958 |
|
|
</body>
|
| 959 |
|
|
</section>
|
| 960 |
|
|
</chapter>
|
| 961 |
|
|
|
| 962 |
|
|
<chapter>
|
| 963 |
|
|
<title>Working With Your Bug</title>
|
| 964 |
|
|
<section>
|
| 965 |
|
|
<body>
|
| 966 |
|
|
|
| 967 |
|
|
<p>
|
| 968 |
fox2mike |
1.3 |
Looking at the bug, we see the information we provided earlier. You will notice
|
| 969 |
|
|
that the bug has been assigned to bug-wranglers@gentoo.org. This is the default
|
| 970 |
|
|
location for Application component bugs.
|
| 971 |
fox2mike |
1.1 |
</p>
|
| 972 |
|
|
|
| 973 |
|
|
<figure link="/images/docs/bugzie-new-basic.png" caption="New Bug Basic Information"/>
|
| 974 |
|
|
|
| 975 |
|
|
<p>
|
| 976 |
fox2mike |
1.3 |
The details we entered about the bug are available as well.
|
| 977 |
fox2mike |
1.1 |
</p>
|
| 978 |
|
|
|
| 979 |
|
|
<figure link="/images/docs/bugzie-new-details.png" caption="New Bug Details"/>
|
| 980 |
|
|
|
| 981 |
|
|
<p>
|
| 982 |
fox2mike |
1.3 |
However, bug-wranglers (usually) won't fix our bugs, so we'll reassign it to
|
| 983 |
|
|
someone that can (you can let bug-wranglers re-assign it for you as well). For
|
| 984 |
|
|
this we use the package's metadata.xml. You can normally find them in
|
| 985 |
|
|
<path>/usr/portage/category/package/metadata.xml</path>. Here's one I've made up
|
| 986 |
|
|
for foobar2.
|
| 987 |
fox2mike |
1.1 |
</p>
|
| 988 |
|
|
|
| 989 |
fox2mike |
1.3 |
<note>
|
| 990 |
|
|
You have to be the reporter of the bug or a member of certain Gentoo Bugzilla
|
| 991 |
|
|
groups (like Gentoo Developers) to be able to reassign bugs.
|
| 992 |
|
|
</note>
|
| 993 |
|
|
|
| 994 |
fox2mike |
1.1 |
<pre caption="metadata.xml">
|
| 995 |
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
| 996 |
|
|
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
| 997 |
|
|
<pkgmetadata>
|
| 998 |
|
|
<herd>chriswhite</herd>
|
| 999 |
|
|
<maintainer>
|
| 1000 |
|
|
<email>chriswhite@gentoo.org</email>
|
| 1001 |
|
|
<name>Chris White</name>
|
| 1002 |
|
|
</maintainer>
|
| 1003 |
|
|
<longdescription lang="en">
|
| 1004 |
|
|
Foobar2 is a package that uses a configuration file to display a word.
|
| 1005 |
|
|
</longdescription>
|
| 1006 |
|
|
</pkgmetadata>
|
| 1007 |
|
|
</pre>
|
| 1008 |
|
|
|
| 1009 |
|
|
<p>
|
| 1010 |
fox2mike |
1.3 |
Notice the maintainer section. This lists the maintainer of the package, which
|
| 1011 |
fox2mike |
1.1 |
in this case is myself, Chris White. The email listed is chriswhite@gentoo.org.
|
| 1012 |
|
|
We will use this to re-assign the bug to the proper person. To do this, click
|
| 1013 |
fox2mike |
1.3 |
the bubble next to Reassign bug to, then fill in the email.
|
| 1014 |
fox2mike |
1.1 |
</p>
|
| 1015 |
|
|
|
| 1016 |
|
|
<note>
|
| 1017 |
fox2mike |
1.3 |
A bug for a package without a metadata.xml file should be re-assigned to
|
| 1018 |
|
|
maintainer-needed@gentoo.org and a package that needs a Gentoo Developer to
|
| 1019 |
|
|
maintain should be assigned to maintainer-wanted@gentoo.org.
|
| 1020 |
fox2mike |
1.1 |
</note>
|
| 1021 |
|
|
|
| 1022 |
|
|
<figure link="/images/docs/bugzie-reassign.png" caption="Bug Reassignment"/>
|
| 1023 |
|
|
|
| 1024 |
|
|
<p>
|
| 1025 |
|
|
Then hit the Commit button for the changes to take place. The bug has been
|
| 1026 |
|
|
reassigned to me. Shortly afterward, you notice (by email usually) that I've
|
| 1027 |
|
|
responded to your bug. I've stated that I'd like to see an strace log to figure
|
| 1028 |
|
|
out how the program is trying to reach your configuration file. You follow the
|
| 1029 |
|
|
previous instructions on using strace and obtain an strace log. Now you need to
|
| 1030 |
|
|
attach it to the bug. In order to do this, click on "Create A New Attachment".
|
| 1031 |
|
|
</p>
|
| 1032 |
|
|
|
| 1033 |
|
|
<figure link="/images/docs/bugzie-new-attach.png" caption="New Attachment"/>
|
| 1034 |
|
|
|
| 1035 |
|
|
<p>
|
| 1036 |
fox2mike |
1.3 |
Now we have to attach the log. Let's go throught it step wise.
|
| 1037 |
fox2mike |
1.1 |
</p>
|
| 1038 |
|
|
|
| 1039 |
fox2mike |
1.3 |
<ul>
|
| 1040 |
|
|
<li>
|
| 1041 |
neysx |
1.5 |
File - This is the location of the file in your machine. In this example,
|
| 1042 |
|
|
the location of <path>strace.log</path>. You can use the "Browse..." button
|
| 1043 |
|
|
to select the file, or enter the path directly in the text field.
|
| 1044 |
fox2mike |
1.3 |
</li>
|
| 1045 |
|
|
<li>
|
| 1046 |
neysx |
1.5 |
Description - A short one liner, or a few wors describing the attachment.
|
| 1047 |
|
|
We'll just enter strace.log here, since that's quite self-explanatory.
|
| 1048 |
fox2mike |
1.3 |
</li>
|
| 1049 |
|
|
<li>
|
| 1050 |
neysx |
1.5 |
Content Type - This is the type of the file we're attaching to the bug.
|
| 1051 |
fox2mike |
1.3 |
</li>
|
| 1052 |
|
|
<li>
|
| 1053 |
neysx |
1.5 |
Obsoletes - If there were attachements submitted to the bug before the
|
| 1054 |
|
|
current one, you have an option of declaring them obsoleted by yours. Since
|
| 1055 |
|
|
we have no prior attachments to this bug, we need not bother.
|
| 1056 |
fox2mike |
1.3 |
</li>
|
| 1057 |
|
|
<li>
|
| 1058 |
neysx |
1.5 |
Comment - Enter comments that will be visible along with the attachments.
|
| 1059 |
|
|
You could elaborate on the attachment here, if needed.
|
| 1060 |
fox2mike |
1.3 |
</li>
|
| 1061 |
|
|
</ul>
|
| 1062 |
|
|
|
| 1063 |
|
|
<p>
|
| 1064 |
|
|
With respect to Content Type, here are a few more details. You can check the
|
| 1065 |
neysx |
1.5 |
"patch" checkbox if you're submitting a patch. Otherwise, you could ask
|
| 1066 |
|
|
Bugzilla to "auto-detect" the file type (not advisable). The other options are
|
| 1067 |
|
|
"select from list", which is most frequently used. Use plain text (text/plain)
|
| 1068 |
|
|
for <e>most</e> attachments except binary files like images (which can use
|
| 1069 |
|
|
image/gif, image/jpeg or image/png depending on type) or compressed files like
|
| 1070 |
|
|
.tar.bz2 which would use application/octet-stream as content type.
|
| 1071 |
fox2mike |
1.3 |
</p>
|
| 1072 |
|
|
|
| 1073 |
|
|
|
| 1074 |
fox2mike |
1.1 |
<figure link="/images/docs/bugzie-new-attach-comp.png" caption="New Attachment Completed"/>
|
| 1075 |
|
|
|
| 1076 |
|
|
<p>
|
| 1077 |
fox2mike |
1.3 |
We submit <path>strace.log</path> and it is reflected on the bug report.
|
| 1078 |
fox2mike |
1.1 |
</p>
|
| 1079 |
|
|
|
| 1080 |
|
|
<figure link="/images/docs/bugzie-strace.png" caption="Attached strace log"/>
|
| 1081 |
|
|
|
| 1082 |
|
|
<p>
|
| 1083 |
fox2mike |
1.3 |
We've mentioned before that sometimes ebuilds will tell you to attach a file in
|
| 1084 |
|
|
the emerge error. An example can be seen below.
|
| 1085 |
|
|
</p>
|
| 1086 |
|
|
|
| 1087 |
|
|
<pre caption="Example File Attachment Request">
|
| 1088 |
|
|
configure: error: PNG support requires ZLIB. Use --with-zlib-dir=<DIR>
|
| 1089 |
|
|
|
| 1090 |
|
|
!!! Please attach the config.log to your bug report:
|
| 1091 |
|
|
!!! /var/tmp/portage/php-5.0.3-r1/work/php-5.0.3/config.log
|
| 1092 |
|
|
|
| 1093 |
|
|
!!! ERROR: dev-php/php-5.0.3-r1 failed.
|
| 1094 |
|
|
!!! Function econf, Line 485, Exitcode 0
|
| 1095 |
|
|
!!! econf failed
|
| 1096 |
|
|
!!! If you need support, post the topmost build error, NOT this status message.
|
| 1097 |
|
|
</pre>
|
| 1098 |
|
|
|
| 1099 |
|
|
<p>
|
| 1100 |
|
|
Please attach any file mentioned like this to your bug report.
|
| 1101 |
|
|
</p>
|
| 1102 |
|
|
|
| 1103 |
|
|
<p>
|
| 1104 |
|
|
While we're doing all this, suppose another person finds your bug by searching
|
| 1105 |
|
|
through bugzilla and is curious to keep track of the bug, they may do so by
|
| 1106 |
|
|
putting their email in the Add CC field of the bug as shown below. You could
|
| 1107 |
|
|
also keep track of other bugs by following the same method.
|
| 1108 |
fox2mike |
1.1 |
</p>
|
| 1109 |
|
|
|
| 1110 |
|
|
<figure link="/images/docs/bugzie-add-email.png" caption="Adding Email To CC:"/>
|
| 1111 |
|
|
|
| 1112 |
|
|
<note>
|
| 1113 |
fox2mike |
1.3 |
Email addresses must be registered with Gentoo Bugzilla. In order to CC multiple
|
| 1114 |
fox2mike |
1.1 |
addresses, simply separate them with commas or spaces.
|
| 1115 |
|
|
</note>
|
| 1116 |
|
|
|
| 1117 |
|
|
<p>
|
| 1118 |
fox2mike |
1.3 |
After all this work, the bug can undergo various status markings. This is
|
| 1119 |
|
|
usually done by the Gentoo Developers and sometimes by the reporter. The
|
| 1120 |
|
|
following are the various possible states a bug may go through during its
|
| 1121 |
|
|
lifetime.
|
| 1122 |
fox2mike |
1.1 |
</p>
|
| 1123 |
|
|
|
| 1124 |
|
|
<ul>
|
| 1125 |
|
|
<li>
|
| 1126 |
neysx |
1.5 |
UNCONFIRMED - You're generally not going to see this too often. This means
|
| 1127 |
|
|
that a bug reporter has opened a bug using the advanced method and is
|
| 1128 |
|
|
uncertain his or her bug is an actual bug.
|
| 1129 |
fox2mike |
1.2 |
</li>
|
| 1130 |
neysx |
1.5 |
<li>NEW - Bugs that are first opened are considered new.</li>
|
| 1131 |
fox2mike |
1.1 |
<li>
|
| 1132 |
neysx |
1.5 |
ASSIGNED - When the person you've assigned the bug too validates your bug,
|
| 1133 |
|
|
it will often receive ASSIGNED status while they figure out the issue.
|
| 1134 |
|
|
This lets you know that they've accepted your bug as a real bug.
|
| 1135 |
fox2mike |
1.2 |
</li>
|
| 1136 |
fox2mike |
1.1 |
<li>
|
| 1137 |
neysx |
1.5 |
REOPENED - Someone has resolved a bug and you think the solution is not
|
| 1138 |
|
|
feasible or the problem still persists. At this point, you may re-open the
|
| 1139 |
|
|
bug. Please <b>do not abuse this</b>. If a developer closes the bug a
|
| 1140 |
|
|
second or third time, chances are that your bug is closed.
|
| 1141 |
fox2mike |
1.2 |
</li>
|
| 1142 |
fox2mike |
1.1 |
<li>
|
| 1143 |
neysx |
1.5 |
RESOLVED - A firm decision has been taken on the bug. Usually goes onto
|
| 1144 |
|
|
FIXED to indicate the bug is solved and the matter closed although various
|
| 1145 |
|
|
other resolutions are possible. We'll look into those a little later.
|
| 1146 |
fox2mike |
1.3 |
</li>
|
| 1147 |
|
|
<li>
|
| 1148 |
neysx |
1.5 |
VERIFIED - The steps take to work the bug are correct. This is usually a QA
|
| 1149 |
|
|
thing.
|
| 1150 |
fox2mike |
1.3 |
</li>
|
| 1151 |
|
|
<li>
|
| 1152 |
neysx |
1.5 |
CLOSED - Basically means RIP for the bug and it's buried under the never
|
| 1153 |
|
|
ending flow of new bugs.
|
| 1154 |
fox2mike |
1.2 |
</li>
|
| 1155 |
fox2mike |
1.1 |
</ul>
|
| 1156 |
|
|
|
| 1157 |
|
|
<p>
|
| 1158 |
fox2mike |
1.3 |
Now shortly afterward, we find the error in the strace log and fix the bug and
|
| 1159 |
neysx |
1.5 |
mark it as RESOLVED FIXED and mention that there was a change in the location
|
| 1160 |
|
|
of configuration files, and that I will update the ebuild with a warning about
|
| 1161 |
|
|
it. The bug now becomes resolved, and you are shown the following.
|
| 1162 |
fox2mike |
1.1 |
</p>
|
| 1163 |
|
|
|
| 1164 |
|
|
<figure link="/images/docs/bugzie-reso.png" caption="Resolved Bug"/>
|
| 1165 |
|
|
|
| 1166 |
|
|
<p>
|
| 1167 |
fox2mike |
1.3 |
A little below, you'll see the following:
|
| 1168 |
fox2mike |
1.1 |
</p>
|
| 1169 |
|
|
|
| 1170 |
|
|
<figure link="/images/docs/bugzie-options.png" caption="Bug Options"/>
|
| 1171 |
|
|
|
| 1172 |
|
|
<p>
|
| 1173 |
neysx |
1.5 |
This gives you the option of Reopening the bug if you wish to (i.e. the
|
| 1174 |
|
|
developer thinks it's resolved but it's really not to your standards). Now our
|
| 1175 |
|
|
bug is fixed! However, different resolutions can occur. Here's a small list:
|
| 1176 |
fox2mike |
1.1 |
</p>
|
| 1177 |
|
|
|
| 1178 |
|
|
<ul>
|
| 1179 |
|
|
<li>
|
| 1180 |
neysx |
1.5 |
FIXED - The bug is fixed, follow the instructions to resolve your issue.
|
| 1181 |
fox2mike |
1.2 |
</li>
|
| 1182 |
fox2mike |
1.1 |
<li>
|
| 1183 |
neysx |
1.5 |
INVALID - You did not do something specifically documented, causing the
|
| 1184 |
|
|
bug.
|
| 1185 |
fox2mike |
1.2 |
</li>
|
| 1186 |
neysx |
1.5 |
<li>DUPLICATE - You didn't use this guide and reported a duplicate bug.</li>
|
| 1187 |
fox2mike |
1.1 |
<li>
|
| 1188 |
neysx |
1.5 |
WORKSFORME - Developer/person assigned the bug cannot reproduce your error.
|
| 1189 |
fox2mike |
1.3 |
</li>
|
| 1190 |
|
|
<li>
|
| 1191 |
neysx |
1.5 |
CANTFIX - Somehow the bug cannot be solved because of certain
|
| 1192 |
|
|
circumstances. These circumstances will be noted by the person taking the
|
| 1193 |
|
|
bug.
|
| 1194 |
fox2mike |
1.3 |
</li>
|
| 1195 |
|
|
<li>
|
| 1196 |
neysx |
1.5 |
WONTFIX - This is usually applied to new ebuilds or feature requests.
|
| 1197 |
|
|
Basically the developer does not want to add a certain feature because it
|
| 1198 |
|
|
is not needed, a better alternative exists, or it's just plain broken.
|
| 1199 |
|
|
Sometimes you may be given a solution to get said issue resolved.
|
| 1200 |
fox2mike |
1.3 |
</li>
|
| 1201 |
|
|
<li>
|
| 1202 |
neysx |
1.5 |
UPSTREAM - The bug cannot be fixed by the Gentoo development team, and have
|
| 1203 |
|
|
requested you take the problem upstream (the people that actually made the
|
| 1204 |
|
|
program) for review. Upstream has a few ways of handling bugs. These
|
| 1205 |
|
|
include mailing lists, irc channels, and even bug reporting systems. If
|
| 1206 |
|
|
you're not sure how to contact them, ask in the bug and someone will point
|
| 1207 |
|
|
you to the right direction.
|
| 1208 |
fox2mike |
1.2 |
</li>
|
| 1209 |
fox2mike |
1.1 |
</ul>
|
| 1210 |
|
|
|
| 1211 |
fox2mike |
1.3 |
<p>
|
| 1212 |
|
|
Sometimes, before the bug can be resolved, a developer may request that you
|
| 1213 |
|
|
test an updated ebulid. In the next chapter we'll take a look at testing
|
| 1214 |
|
|
ebuilds.
|
| 1215 |
|
|
</p>
|
| 1216 |
|
|
|
| 1217 |
fox2mike |
1.1 |
</body>
|
| 1218 |
|
|
</section>
|
| 1219 |
fox2mike |
1.3 |
</chapter>
|
| 1220 |
fox2mike |
1.1 |
|
| 1221 |
fox2mike |
1.3 |
<chapter>
|
| 1222 |
|
|
<title>Testing Ebuilds</title>
|
| 1223 |
|
|
<section>
|
| 1224 |
|
|
<title>Getting The Files</title>
|
| 1225 |
|
|
<body>
|
| 1226 |
|
|
|
| 1227 |
|
|
<p>
|
| 1228 |
|
|
Let's say that you reported a bug for the foobar2 compile fix from earlier. Now
|
| 1229 |
|
|
developers might find out what the problem is and might need you to test the
|
| 1230 |
|
|
ebuild for them to be sure it works for you as well:
|
| 1231 |
|
|
</p>
|
| 1232 |
|
|
|
| 1233 |
|
|
<figure link="/images/docs/bugzie-ebuild-request.png" caption="Ebuild Test Request"/>
|
| 1234 |
|
|
|
| 1235 |
|
|
<p>
|
| 1236 |
|
|
Some rather confusing vocabulary is used here. First off, let's see what an
|
| 1237 |
|
|
overlay is. An overlay is a special directory like <path>/usr/portage</path>,
|
| 1238 |
|
|
the difference being that when you <c>emerge sync</c>, files contained within it
|
| 1239 |
|
|
will not be deleted. Luckily, a special <path>/usr/local/portage</path>
|
| 1240 |
|
|
directory is created for that purpose. Let's go ahead and set our portage
|
| 1241 |
|
|
overlay in<path>/etc/make.conf</path>. Open make.conf up in your favorite editor
|
| 1242 |
|
|
and add this towards the end.
|
| 1243 |
|
|
</p>
|
| 1244 |
|
|
|
| 1245 |
|
|
<pre caption="Setting Up PORTDIR_OVERLAY">
|
| 1246 |
|
|
PORTDIR_OVERLAY="/usr/local/portage"
|
| 1247 |
|
|
</pre>
|
| 1248 |
|
|
|
| 1249 |
|
|
<p>
|
| 1250 |
|
|
Now we'll want to create the appropriate directories to put our test ebuild
|
| 1251 |
|
|
files in. In this case, we're supposed to put them in sys-apps/foobar2. You'll
|
| 1252 |
|
|
notice that the second comment asks for a files directory for the patch. The
|
| 1253 |
|
|
files directory holds the digests (md5sums of files for a particular version of
|
| 1254 |
|
|
a package) and any other required files that aren't included with the standard
|
| 1255 |
|
|
source archive (patches, init.d scripts, etc). This is a subdir in the package
|
| 1256 |
|
|
directory called files. Go ahead and create these directories:
|
| 1257 |
|
|
</p>
|
| 1258 |
|
|
|
| 1259 |
|
|
<pre caption="Setting Up The Category And Package Directories">
|
| 1260 |
|
|
# <i>mkdir -p /usr/local/portage/sys-apps/foobar2/files</i>
|
| 1261 |
|
|
</pre>
|
| 1262 |
|
|
|
| 1263 |
|
|
<note>
|
| 1264 |
|
|
The -p in mkdir creates not only the directory you want but also any missing
|
| 1265 |
|
|
parent directories as well (sys-apps and foobar2 in this case).
|
| 1266 |
|
|
</note>
|
| 1267 |
|
|
|
| 1268 |
|
|
<p>
|
| 1269 |
|
|
Ok now, we can go ahead and download the files. First, download the ebuild
|
| 1270 |
|
|
into <path>/usr/local/portage/sys-apps/foobar2</path>, and then add the patch
|
| 1271 |
|
|
to <path>/usr/local/portage/sys-apps/foobar2/files</path>. Now that we have the
|
| 1272 |
|
|
files, we can begin working on testing the ebuild.
|
| 1273 |
|
|
</p>
|
| 1274 |
|
|
|
| 1275 |
|
|
</body>
|
| 1276 |
|
|
</section>
|
| 1277 |
|
|
<section>
|
| 1278 |
|
|
<title>Testing The ebuild</title>
|
| 1279 |
|
|
<body>
|
| 1280 |
|
|
|
| 1281 |
|
|
<p>
|
| 1282 |
|
|
The process to create an ebuild that can be used by emerge is fairly simple. You
|
| 1283 |
|
|
must create a Manifest and a digest file for the ebuild. This can be done with
|
| 1284 |
|
|
the ebuild command. Run it as shown.
|
| 1285 |
|
|
</p>
|
| 1286 |
|
|
|
| 1287 |
|
|
<pre caption="Creating the Manifest and digest files">
|
| 1288 |
|
|
# <i>ebuild foobar2-1.0.ebuild digest</i>
|
| 1289 |
|
|
>>> Generating digest file...
|
| 1290 |
|
|
<<< foobar2-1.0.tar.bz2
|
| 1291 |
|
|
>>> Generating manifest file...
|
| 1292 |
|
|
<<< foobar2-1.0.ebuild
|
| 1293 |
|
|
<<< files/digest-foobar2-1.0
|
| 1294 |
|
|
<<< files/foobar2-1.0-Makefile.patch
|
| 1295 |
|
|
>>> Computed message digests.
|
| 1296 |
|
|
</pre>
|
| 1297 |
|
|
|
| 1298 |
|
|
<p>
|
| 1299 |
|
|
Now let's test to see if it works as it should.
|
| 1300 |
|
|
</p>
|
| 1301 |
|
|
|
| 1302 |
|
|
<pre caption="Testing With emerge -pv">
|
| 1303 |
|
|
# <i>emerge -pv foobar2</i>
|
| 1304 |
|
|
|
| 1305 |
|
|
These are the packages that I would merge, in order:
|
| 1306 |
|
|
|
| 1307 |
|
|
Calculating dependencies ...done!
|
| 1308 |
|
|
[ebuild N ] sys-apps/foobar2-1.0 0 kB [1]
|
| 1309 |
|
|
|
| 1310 |
|
|
Total size of downloads: 0 kB
|
| 1311 |
|
|
Portage overlays:
|
| 1312 |
|
|
[1] /usr/local/portage
|
| 1313 |
|
|
</pre>
|
| 1314 |
|
|
|
| 1315 |
|
|
<p>
|
| 1316 |
|
|
It does seem to have worked! You'll notice the [1] next to the [ebuild] line.
|
| 1317 |
|
|
That points to <path>/usr/local/portage</path>, which is the overlay we created
|
| 1318 |
|
|
earlier. Now we go ahead and emerge the package.
|
| 1319 |
|
|
</p>
|
| 1320 |
|
|
|
| 1321 |
|
|
<pre caption="Emerge Result">
|
| 1322 |
neysx |
1.5 |
# <i>emerge foobar2</i>
|
| 1323 |
fox2mike |
1.3 |
Calculating dependencies ...done!
|
| 1324 |
|
|
<comment>(compile info snipped)</comment>
|
| 1325 |
|
|
>>> Unpacking foobar2-1.0.tar.bz2 to /var/tmp/portage/foobar2-1.0/work
|
| 1326 |
|
|
* Applying foobar2-1.0-Makefile.patch ... [ ok ]
|
| 1327 |
|
|
<comment>(compile info snipped)</comment>
|
| 1328 |
|
|
>>> Merging sys-apps/foobar2-1.0 to /
|
| 1329 |
|
|
>>> chris +sandbox(preinst)
|
| 1330 |
|
|
--- /usr/
|
| 1331 |
|
|
--- /usr/bin/
|
| 1332 |
|
|
>>> /usr/bin/foobar2
|
| 1333 |
|
|
</pre>
|
| 1334 |
|
|
|
| 1335 |
|
|
<p>
|
| 1336 |
|
|
In the first section we see that the emerge started off as it should. The second
|
| 1337 |
|
|
section shows our patch being applied successfully by the "[ ok ]" status
|
| 1338 |
|
|
message to the right. The last section tells us the program compiled ok. The
|
| 1339 |
|
|
patch works! Now we can go and let the developer know that their patch works
|
| 1340 |
|
|
fine, and that they can commit the fix to portage.
|
| 1341 |
|
|
</p>
|
| 1342 |
|
|
|
| 1343 |
|
|
</body>
|
| 1344 |
|
|
</section>
|
| 1345 |
fox2mike |
1.1 |
<section>
|
| 1346 |
|
|
<title>Conclusion</title>
|
| 1347 |
|
|
<body>
|
| 1348 |
|
|
|
| 1349 |
|
|
<p>
|
| 1350 |
|
|
This concludes the howto on working with Bugzilla. I hope you find this useful.
|
| 1351 |
|
|
If you have any questions, comments, or ideas regarding this document, please
|
| 1352 |
neysx |
1.5 |
send them to me at <mail>chriswhite@gentoo.org</mail>. Special thanks go to
|
| 1353 |
|
|
moreon for his notes on -g flags and compile errors, the people at #gentoo-bugs
|
| 1354 |
|
|
for helping out with bug-wrangling, Griffon26 for his notes on
|
| 1355 |
fox2mike |
1.3 |
maintainer-needed, robbat2 for general suggestions and fox2mike for fixing up
|
| 1356 |
|
|
the doc and adding stuff as needed.
|
| 1357 |
fox2mike |
1.1 |
</p>
|
| 1358 |
|
|
|
| 1359 |
|
|
</body>
|
| 1360 |
|
|
</section>
|
| 1361 |
|
|
</chapter>
|
| 1362 |
|
|
</guide>
|