syncing up docs, examples, & packaging from 3.0
[bbaumbach/samba-autobuild/.git] / docs / docbook / projdoc / Bugs.xml
1 <chapter id="bugreport">
2
3 <chapterinfo>
4         &author.jht;
5         &author.jelmer;
6         &author.tridge;
7         <pubdate> 27 June 1997 </pubdate>
8 </chapterinfo>
9
10 <title>Reporting Bugs</title>
11
12 <sect1>
13 <title>Introduction</title>
14
15 <para>Please report bugs using Samba's
16 <ulink url="https://bugzilla.samba.org/">Bugzilla</ulink> facilities and
17 take the time to read this file before you submit a bug
18 report. Also, check to see if it has changed between releases, as we
19 may be changing the bug reporting mechanism at some point.
20 </para>
21
22 <para>
23 Please do as much as you can yourself to help track down the
24 bug. Samba is maintained by a dedicated group of people who volunteer
25 their time, skills and efforts. We receive far more mail than
26 we can possibly answer, so you have a much higher chance of a response
27 and a fix if you send us a <quote>developer friendly</quote> bug report that lets
28 us fix it fast. 
29 </para>
30
31 <para>
32 Do not assume that if you post the bug to the comp.protocols.smb
33 newsgroup or the mailing list that we will read it. If you suspect that your 
34 problem is not a bug but a configuration problem, it is better to send 
35 it to the Samba mailing list, as there are thousands of other users on
36 that list who may be able to help you.
37 </para>
38
39 <para>
40 You may also like to look though the recent mailing list archives,
41 which are conveniently accessible on the Samba Web pages
42 at <ulink noescape="1" url="http://samba.org/samba/">http://samba.org/samba/</ulink>.
43 </para>
44
45 </sect1>
46
47 <sect1>
48 <title>General Information</title>
49
50 <para>
51 Before submitting a bug report, check your config for silly
52 errors. Look in your log files for obvious messages that tell
53 you've misconfigured something. Run testparm to check your config
54 file for correct syntax.
55 </para>
56
57 <para>
58 Have you looked through <link linkend="diagnosis"/>? This is extremely important.
59 </para>
60
61 <para>
62 If you include part of a log file with your bug report, then be sure to
63 annotate it with exactly what you were doing on the client at the
64 time and exactly what the results were.
65 </para>
66
67 </sect1>
68
69 <sect1>
70 <title>Debug Levels</title>
71
72 <para>
73 If the bug has anything to do with Samba behaving incorrectly as a
74 server (like refusing to open a file), then the log files will probably
75 be quite useful. Depending on the problem, a log level of between 3 and
76 10 showing the problem may be appropriate. A higher level gives more
77 detail, but may use too much disk space.
78 </para>
79
80 <para>
81 To set the debug level, use the <smbconfoption><name>log level</name></smbconfoption> in your 
82 &smb.conf;. You may also find it useful to set the log 
83 level higher for just one machine and keep separate logs for each machine. 
84 To do this, add the following lines to your main &smb.conf; file:
85 </para>
86
87 <para><smbconfblock>
88 <smbconfoption><name>log level</name><value>10</value></smbconfoption>
89 <smbconfoption><name>log file</name><value>/usr/local/samba/lib/log.%m</value></smbconfoption>
90 <smbconfoption><name>include</name><value>/usr/local/samba/lib/smb.conf.%m</value></smbconfoption>
91 </smbconfblock></para>
92
93 <para>
94 and create a file <filename>/usr/local/samba/lib/smb.conf.<replaceable>machine</replaceable></filename> where
95 <replaceable>machine</replaceable> is the name of the client you wish to debug. In that file
96 put any &smb.conf; commands you want, for example 
97 <smbconfoption><name>log level</name></smbconfoption> may be useful. This also allows you to 
98 experiment with different security systems, protocol levels and so on, on just 
99 one machine.
100 </para>
101
102 <para>
103 The &smb.conf; entry <smbconfoption><name>log level</name></smbconfoption> 
104 is synonymous with the parameter <smbconfoption><name>debuglevel</name></smbconfoption> that has
105 been used in older versions of Samba and is being retained for backward 
106 compatibility of &smb.conf; files.
107 </para>
108
109 <para>
110 As the <smbconfoption><name>log level</name></smbconfoption> value is increased, you will record 
111 a significantly greater level of debugging information. For most 
112 debugging operations, you may not need a setting higher than 
113 <constant>3</constant>. Nearly 
114 all bugs can be tracked at a setting of <constant>10</constant>, but be 
115 prepared for a large volume of log data.
116 </para>
117
118 </sect1>
119
120 <sect1>
121 <title>Internal Errors</title>
122
123 <para>
124 If you get the message <quote><errorname>INTERNAL ERROR</errorname></quote> in your log files, 
125 it means that Samba got an unexpected signal while running. It is probably a
126 segmentation fault and almost certainly means a bug in Samba (unless
127 you have faulty hardware or system software).
128 </para>
129
130 <para>
131 If the message came from smbd, it will probably be accompanied by
132 a message that details the last SMB message received by smbd. This
133 information is often useful in tracking down the problem so please
134 include it in your bug report.
135 </para>
136
137 <para>
138 You should also detail how to reproduce the problem, if
139 possible. Please make this reasonably detailed.
140 </para>
141
142
143 <para>
144 <indexterm><primary>core files</primary></indexterm>
145 You may also find that a core file appeared in a <filename>corefiles</filename>
146 subdirectory of the directory where you keep your Samba log
147 files. This file is the most useful tool for tracking down the bug. To
148 use it, you do this:
149 <indexterm><primary>gdb</primary></indexterm>
150 <indexterm><primary>debug</primary></indexterm>
151 </para>
152
153
154 <screen>
155 &prompt;<userinput>gdb smbd core</userinput>
156 </screen>
157
158 <para>
159 adding appropriate paths to smbd and core so gdb can find them. If you
160 do not have gdb, try <userinput>dbx</userinput>. Then within the debugger,
161 use the command <command>where</command> to give a stack trace of where the
162 problem occurred. Include this in your report.
163 </para>
164
165 <para>
166 If you know any assembly language, do a <command>disass</command> of the routine
167 where the problem occurred (if its in a library routine, then
168 disassemble the routine that called it) and try to work out exactly
169 where the problem is by looking at the surrounding code. Even if you
170 do not know assembly, including this information in the bug report can be
171 useful. 
172 </para>
173 </sect1>
174
175 <sect1>
176 <title>Attaching to a Running Process</title>
177
178 <para>
179 Unfortunately, some UNIXes (in particular some recent Linux kernels)
180 refuse to dump a core file if the task has changed uid (which smbd
181 does often). To debug with this sort of system, you could try to attach
182 to the running process using
183 <userinput>gdb smbd <replaceable>PID</replaceable></userinput> where you get
184 <replaceable>PID</replaceable> from <application>smbstatus</application>.
185 Then use <command>c</command> to continue and try to cause the core dump
186 using the client. The debugger should catch the fault and tell you
187 where it occurred.
188 </para>
189
190 </sect1>
191
192 <sect1>
193 <title>Patches</title>
194
195
196 <para>
197 <indexterm><primary>diff</primary></indexterm>
198 <indexterm><primary>patch</primary></indexterm>
199 The best sort of bug report is one that includes a fix! If you send us
200 patches, please use <userinput>diff -u</userinput> format if your version of 
201 diff supports it, otherwise use <userinput>diff -c4</userinput>. Make sure 
202 you do the diff against a clean version of the source and let me know 
203 exactly what version you used. 
204 </para>
205
206 </sect1>
207 </chapter>