New build path variable
[freeradius.git] / doc / bugs
1 BUGS
2
3 0.INTRODUCTION
4
5   The FreeRADIUS web site is at <URL: http://www.freeradius.org>, and
6   most information referenced in this document can be found there.
7
8   This is primarily for non-developers of the FreeRADIUS server. If you are
9   able to patch the code to work correctly, then we invite you to join the
10   development list to discuss it. If you're the type who know little about
11   how to code, then this is the place for you!
12
13 1.YOU FOUND A BUG
14
15   So you think you've found a bug in the FreeRADIUS server?
16
17   You should first discuss it on the users list, to see if anyone can
18   reproduce it. Often there's a simple explanation of why the server
19   behaves as it does, and it's not necessarily a bug in the code, so
20   browse the lists' archives of the last two months, and if you don't
21   see messages about it, ask!
22
23   If the behavior is correct but confusing, we think that's a bug too, and
24   you should file a bug against our documentation.
25
26   For more information about the users list, the lists' archives and the
27   faq, please visit http://www.freeradius.org/list/users.html
28   Please make sure to READ and RESPECT the house-rules. You will get much
29   better response and much faster if you do!
30
31 2.CORE DUMPS
32
33   If the server, or one of the accompyaning programs core dumps, then
34   you should rebuild the server as follows:
35
36   $ ./configure --enable-developer
37   $ make
38   $ make install
39
40   and then run the program again. You may have to to enable core
41   dumps, via:
42
43   $ ulimit -c unlimited
44
45   When it core dumps, do:
46
47   $ gdb /path/to/executable /path/to/core/file
48
49   Enable logging in gdb via the following commands:
50
51   (gdb) set logging file gdb-radiusd.log
52   (gdb) set logging on
53
54   and follow the instructions in section 4, below.
55
56 3. DEBUGGING A LIVE SERVER
57
58   If you can't get a core dump, or the problem doesn't result in a
59   core dump, you may have to run the server under gdb.  To do this,
60   ensure that you have symbols in the binaries (i.e. a non-stripped
61   binary) by re-building the server as described in the previous
62   section.  Then, run the server under gdb as follows:
63
64   $ gdb radiusd
65
66   Enable logging in gdb via the following commands:
67
68   (gdb) set logging file gdb-radiusd.log
69   (gdb) set logging on
70
71   Tell gdb to pass any necessary command-line arguments to the
72   server:
73
74   (gdb) set args ...
75
76   Where the "..." are the command-line arguments you normally pass to
77   radiusd.  If you don't normally pass command-line arguments, this
78   line is not necessary.
79
80   Then, do:
81
82   (gdb) run
83
84   When something interesting happens, you can hit CTRL-C in the
85   window, and you should be back at the gdb prompt:
86
87   (gdb)
88
89   And follow the instructions in section 4, below.
90
91 4. OBTAINING USEFUL INFORMATION
92
93   If the server was built with threads, you can do:
94
95   (gdb) info threads
96
97   Which will give you information about the threads.  If the server
98   isn't threaded, that command-line will print a message saying so.
99
100   Then, do:
101
102   (gdb) thread apply all bt full
103
104   If the server isn't threaded, the "thread apply" section isn't necessary
105
106   The output should be printed to the screen, and also sent to the
107   gdb-radiusd.log file.  Copy the log gile and mail it to the list, or
108   put it on a web page if it's too large.  Include the name of the
109   operating system.
110   Without this information, it's impossible for anyone to know why the
111   program core dumped.
112
113   You can also submit the information to the bug database at:
114
115     http://bugs.freeradius.org/
116
117   Submitting it to the bug database ensures that the bug report won't
118   get forgotten, and that someone will eventually respond to it.
119
120
121 5. VALGRIND
122
123   On Linux systems, "valgrind" is a useful tool that can catch certain
124   classes of bugs.  To use it, run the server voa:
125
126 $ valgrind --tool=memcheck --leak-check=full radiusd -Xm
127
128   It will print out certain kinds of errors to the screen.  There may
129   be a number of errors related to OpenSSL, dlopen(), or libtldl.  We
130   cannot do anything about those problems.  However, any errors that are
131   inside of the FreeRADIUS source should be brought to our attention.
132
133
134 6. Running with "screen"
135
136   If the bug is a crash of the server, and it takes a long time for the
137   crash to happen, perform the following steps:
138
139  * log in as root
140  * open a screen session (http://blogamundo.net/code/screen/)
141    $ screen bash
142  * make sure FreeRADIUS is not running
143  * make sure you have all the debug symbols about, or a debugable 
144    version of the server installed
145  * configure screen to log to a file; 'Ctrl-A H'
146  * type 'gdb /path/to/radius'  (or /path/to/freeradius on Debian)
147  * at the (gdb) prompt, type 'run -X'
148  * detach from screen 'Ctrl-A D'
149  * when you notice FreeRADIUS has died, reconnect to your screen session
150    $ screen -D -r
151  * at the (gdb) prompt type 'where' or for *lots* of info try
152    'thread apply all bt full'
153  * tell screen to stop logging, 'Ctrl-A H'
154  * logout from screen
155
156 --
157
158 FreeRADIUS Project, copyright 2008
159 $Id$