Another update.
[Samba.git] / docs / Samba-HOWTO-Collection / TOSHARG-Bugs.xml
blob5af66fc05a8e4ae0744ecf142190598903e22759
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE chapter PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <chapter id="bugreport">
5 <chapterinfo>
6         &author.jht;
7         &author.jelmer;
8         &author.tridge;
9         <pubdate> 27 June 1997 </pubdate>
10 </chapterinfo>
12 <title>Reporting Bugs</title>
14 <sect1>
15 <title>Introduction</title>
17 <para>Please report bugs using Samba's
18 <ulink url="https://bugzilla.samba.org/">Bugzilla</ulink> facilities and
19 take the time to read this file before you submit a bug
20 report. Also, check to see if it has changed between releases, as we
21 may be changing the bug reporting mechanism at some point.
22 </para>
24 <para>
25 Please do as much as you can yourself to help track down the
26 bug. Samba is maintained by a dedicated group of people who volunteer
27 their time, skills and efforts. We receive far more mail than
28 we can possibly answer, so you have a much higher chance of a response
29 and a fix if you send us a <quote>developer friendly</quote> bug report that lets
30 us fix it fast. 
31 </para>
33 <para>
34 Do not assume that if you post the bug to the comp.protocols.smb
35 newsgroup or the mailing list that we will read it. If you suspect that your 
36 problem is not a bug but a configuration problem, it is better to send 
37 it to the Samba mailing list, as there are thousands of other users on
38 that list who may be able to help you.
39 </para>
41 <para>
42 You may also like to look though the recent mailing list archives,
43 which are conveniently accessible on the Samba Web pages
44 at <ulink noescape="1" url="http://samba.org/samba/">http://samba.org/samba/</ulink>.
45 </para>
47 </sect1>
49 <sect1>
50 <title>General Information</title>
52 <para>
53 Before submitting a bug report, check your config for silly
54 errors. Look in your log files for obvious messages that tell
55 you've mis-configured something. Run testparm to check your config
56 file for correct syntax.
57 </para>
59 <para>
60 Have you looked through <link linkend="diagnosis">The Samba Checklist</link>? This is extremely important.
61 </para>
63 <para>
64 If you include part of a log file with your bug report, then be sure to
65 annotate it with exactly what you were doing on the client at the
66 time and exactly what the results were.
67 </para>
69 </sect1>
71 <sect1 id="dbglvl">
72 <title>Debug Levels</title>
74 <para>
75 If the bug has anything to do with Samba behaving incorrectly as a
76 server (like refusing to open a file), then the log files will probably
77 be quite useful. Depending on the problem, a log level of between 3 and
78 10 showing the problem may be appropriate. A higher level gives more
79 detail, but may use too much disk space.
80 </para>
82 <para>
83 To set the debug level, use the <smbconfoption name="log level"/> in your 
84 &smb.conf;. You may also find it useful to set the log 
85 level higher for just one machine and keep separate logs for each machine. 
86 To do this, add the following lines to your main &smb.conf; file:
87 </para>
89 <para><smbconfblock>
90 <smbconfoption name="log level">10</smbconfoption>
91 <smbconfoption name="log file">/usr/local/samba/lib/log.%m</smbconfoption>
92 <smbconfoption name="include">/usr/local/samba/lib/smb.conf.%m</smbconfoption>
93 </smbconfblock></para>
95 <para>
96 and create a file <filename>/usr/local/samba/lib/smb.conf.<replaceable>machine</replaceable></filename> where
97 <replaceable>machine</replaceable> is the name of the client you wish to debug. In that file
98 put any &smb.conf; commands you want, for example 
99 <smbconfoption name="log level"/> may be useful. This also allows you to 
100 experiment with different security systems, protocol levels and so on, on just 
101 one machine.
102 </para>
104 <para>
105 The &smb.conf; entry <smbconfoption name="log level"/> 
106 is synonymous with the parameter <smbconfoption name="debuglevel"/> that has
107 been used in older versions of Samba and is being retained for backward 
108 compatibility of &smb.conf; files.
109 </para>
111 <para>
112 As the <smbconfoption name="log level"/> value is increased, you will record 
113 a significantly greater level of debugging information. For most 
114 debugging operations, you may not need a setting higher than 
115 <constant>3</constant>. Nearly 
116 all bugs can be tracked at a setting of <constant>10</constant>, but be 
117 prepared for a large volume of log data.
118 </para>
120         <sect2>
121         <title>Debugging Specific Operations</title>
123         <para>
124         Samba-3.x permits debugging (logging) of specific functional components without unnecessarily
125         cluttering the log files with detailed logs for all operations. An example configuration to 
126         achive this is shown in:
127         </para>
129 <para>
130 <smbconfblock>
131 <smbconfoption name="log level">0 tdb:3 passdb:5 auth:4 vfs:2</smbconfoption>
132 <smbconfoption name="max log size">0</smbconfoption>
133 <smbconfoption name="log file">/var/log/samba/%U.%m.log</smbconfoption>
134 </smbconfblock>
135 </para>
137         <para>
138         This will cause the level of detail to be expanded to the debug class (log level) passed to
139         each funtional area per the value shown above. The first value passed to the <parameter>log level</parameter>
140         of <constant>0</constant> means turn off all unnecessary debugging except the debug classes set for
141         the functional areas as specified. The table shown in <link linkend="dbgclass">Debugable Functions</link>
142         may be used to affect very precise analysis of each SMB operation Samba is conducting.
143         </para>
145         <table frame="all" id="dbgclass">
146                 <title>Debuggable Functions</title>
147         <tgroup cols="2" align="center">
148                 <thead>
149                 <row><entry>Function Name</entry><entry>Function Name</entry></row>
150                 </thead>
151                 <tbody>
152                 <row><entry>all</entry><entry>passdb</entry></row>
153                 <row><entry>tdb</entry><entry>sam</entry></row>
154                 <row><entry>printdrivers</entry><entry>auth</entry></row>
155                 <row><entry>lanman</entry><entry>winbind</entry></row>
156                 <row><entry>smb</entry><entry>vfs</entry></row>
157                 <row><entry>rpc_parse</entry><entry>idmap</entry></row>
158                 <row><entry>rpc_srv</entry><entry>quota</entry></row>
159                 <row><entry>rpc_cli</entry><entry>acls</entry></row>
160                 </tbody>
161         </tgroup>
162         </table>
164         </sect2>
166 </sect1>
168 <sect1>
169 <title>Internal Errors</title>
171 <para>
172 If you get the message <quote><errorname>INTERNAL ERROR</errorname></quote> in your log files, 
173 it means that Samba got an unexpected signal while running. It is probably a
174 segmentation fault and almost certainly means a bug in Samba (unless
175 you have faulty hardware or system software).
176 </para>
178 <para>
179 If the message came from smbd, it will probably be accompanied by
180 a message that details the last SMB message received by smbd. This
181 information is often useful in tracking down the problem so please
182 include it in your bug report.
183 </para>
185 <para>
186 You should also detail how to reproduce the problem, if
187 possible. Please make this reasonably detailed.
188 </para>
191 <para>
192 <indexterm><primary>core files</primary></indexterm>
193 You may also find that a core file appeared in a <filename>corefiles</filename>
194 subdirectory of the directory where you keep your Samba log
195 files. This file is the most useful tool for tracking down the bug. To
196 use it, you do this:
197 <indexterm><primary>gdb</primary></indexterm>
198 <indexterm><primary>debug</primary></indexterm>
199 </para>
202 <screen>
203 &prompt;<userinput>gdb smbd core</userinput>
204 </screen>
206 <para>
207 adding appropriate paths to smbd and core so gdb can find them. If you
208 do not have gdb, try <userinput>dbx</userinput>. Then within the debugger,
209 use the command <command>where</command> to give a stack trace of where the
210 problem occurred. Include this in your report.
211 </para>
213 <para>
214 If you know any assembly language, do a <command>disass</command> of the routine
215 where the problem occurred (if its in a library routine, then
216 disassemble the routine that called it) and try to work out exactly
217 where the problem is by looking at the surrounding code. Even if you
218 do not know assembly, including this information in the bug report can be
219 useful. 
220 </para>
221 </sect1>
223 <sect1>
224 <title>Attaching to a Running Process</title>
226 <para>
227 Unfortunately, some UNIXes (in particular some recent Linux kernels)
228 refuse to dump a core file if the task has changed uid (which smbd
229 does often). To debug with this sort of system, you could try to attach
230 to the running process using
231 <userinput>gdb smbd <replaceable>PID</replaceable></userinput> where you get
232 <replaceable>PID</replaceable> from <application>smbstatus</application>.
233 Then use <command>c</command> to continue and try to cause the core dump
234 using the client. The debugger should catch the fault and tell you
235 where it occurred.
236 </para>
238 <para>
239 Sometimes it is necessary to build a Samba binary files that have debugging
240 symbols so as to make it possible to capture enough information from a crashed
241 operation to permit the Samba Team to fix the problem.
242 </para>
244 <para>
245 Compile with <constant>-g</constant> to ensure you have symbols in place. 
246 Add the following line to the &smb.conf; file global section:
247 <screen>
248 panic action = "/bin/sleep 90000"
249 </screen>
250 to catch any panics. If <command>smbd</command> seems to be frozen look for any sleep
251 processes. If it is not, and appears to be spinning, find the process id
252 of the spinning process and type:
253 <screen>
254 gdb /usr/local/samba/sbin/smbd
255 </screen>
256 then <quote>attach 'pid'</quote> (of the spinning process), then type <quote>bt</quote> to
257 get a backtrace to see where the smbd is in the call path.
258 </para>
260 </sect1>
262 <sect1>
263 <title>Patches</title>
266 <para>
267 <indexterm><primary>diff</primary></indexterm>
268 <indexterm><primary>patch</primary></indexterm>
269 The best sort of bug report is one that includes a fix! If you send us
270 patches, please use <userinput>diff -u</userinput> format if your version of 
271 diff supports it, otherwise use <userinput>diff -c4</userinput>. Make sure 
272 you do the diff against a clean version of the source and let me know 
273 exactly what version you used. 
274 </para>
276 </sect1>
277 </chapter>