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">
9 <pubdate> 27 June 1997 </pubdate>
12 <title>Reporting Bugs</title>
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.
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
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.
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>.
50 <title>General Information</title>
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.
60 Have you looked through <link linkend="diagnosis">The Samba Checklist</link>? This is extremely important.
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.
72 <title>Debug Levels</title>
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.
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:
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>
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
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.
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.
121 <title>Debugging Specific Operations</title>
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:
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>
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.
145 <table frame="all" id="dbgclass">
146 <title>Debuggable Functions</title>
147 <tgroup cols="2" align="center">
149 <row><entry>Function Name</entry><entry>Function Name</entry></row>
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>
169 <title>Internal Errors</title>
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).
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.
186 You should also detail how to reproduce the problem, if
187 possible. Please make this reasonably detailed.
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
197 <indexterm><primary>gdb</primary></indexterm>
198 <indexterm><primary>debug</primary></indexterm>
203 &prompt;<userinput>gdb smbd core</userinput>
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.
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
224 <title>Attaching to a Running Process</title>
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
241 <title>Patches</title>
245 <indexterm><primary>diff</primary></indexterm>
246 <indexterm><primary>patch</primary></indexterm>
247 The best sort of bug report is one that includes a fix! If you send us
248 patches, please use <userinput>diff -u</userinput> format if your version of
249 diff supports it, otherwise use <userinput>diff -c4</userinput>. Make sure
250 you do the diff against a clean version of the source and let me know
251 exactly what version you used.