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