143
|
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
2 %%%% generic configuration file for %%%% |
|
3 %%%% the ccmalloc memory profiler %%%% |
|
4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
5 |
|
6 %-----------------------------------------------------------------% |
|
7 % COPY THIS FILE TO '.ccmalloc' in your project or home directory % |
|
8 %-----------------------------------------------------------------% |
|
9 |
|
10 ############################################################################## |
|
11 ## (C) 1997-2003 Armin Biere, 1998 Johannes Keukelaar |
|
12 ## $Id: ccmalloc.cfg,v 1.6 2003/02/03 08:03:54 biere Exp $ |
|
13 ############################################################################## |
|
14 |
|
15 %%% '%' and '#' are comments !!!!!!! |
|
16 |
|
17 % This file must be called '.ccmalloc' and is searched for in the |
|
18 % current directory and in the home directory of the user. If it |
|
19 % does not exist then the default values mentioned below are used. |
|
20 |
|
21 % It is also the only available user manual yet ;-) So here is a reading |
|
22 % hint. First have a look at the short one line descriptions of each option |
|
23 % ... |
|
24 |
|
25 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
26 % with 'file' the executable is specified [a.out] |
|
27 % ---------------------------------------------------------------------- |
|
28 % This should not be necessary for Linux and Solaris because the proc |
|
29 % file system can be used to find argv[0]. |
|
30 % |
|
31 % (the rest of this comment only applies to other OS) |
|
32 % |
|
33 % For other OS you should use this option unless the executable is |
|
34 % in the current directory or its name is 'a.out'. |
|
35 % |
|
36 % If you do not specify this then ccmalloc tries to find an executable |
|
37 % in the current directory that matches the running program starting |
|
38 % with 'a.out'. For this process it must call 'nm' on each executable |
|
39 % file in the directory which may be time consuming. With this option |
|
40 % you can speed up this process. |
|
41 % |
|
42 % You can also specify absolute or relative path names. This is |
|
43 % necessary if you do not start your program from the current directory. |
|
44 % But you can also simply link or name your program to 'a.out'. |
|
45 |
|
46 %file FILE |
|
47 |
|
48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
49 % 'log' specify the logfile [stderr] |
|
50 % ---------------------------------------------------------------------- |
|
51 % The default is to use stderr. The argument to 'log' is the name of |
|
52 % the file you want to write to. It can also be 'stdout' or '-' which |
|
53 % sets stdout as logfile. If the logfile is stdout or stderr and is |
|
54 % connected to a terminal then the output is slightly different. |
|
55 % |
|
56 % For big programs the logfile can be really big. To reduce the size |
|
57 % you can use a small chain length (see 'chain-length' below). The other |
|
58 % possibility is to use compressed logfiles. This can be done by |
|
59 % specifying a logfile name with a '.gz' (or a '.Z') suffix. This means |
|
60 % that gnuzip (resp. compress) is used to compress the output. |
|
61 |
|
62 %log FILE |
|
63 |
|
64 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
65 % 'logpid' specify the logfile |
|
66 % ---------------------------------------------------------------------- |
|
67 % Can be used alternatively to the 'log' command if you want to use |
|
68 % ccmalloc for debugging parallel applications where several copies of |
|
69 % the program you are debugging must be run simoultaneously. In this |
|
70 % case you can not use 'log' because you do not want to write to the same |
|
71 % log file. Using 'logpid' uses a file name ending with the <pid> of |
|
72 % the process which means the name is unique even if several copies of |
|
73 % your program are run simoultaneously. |
|
74 % |
|
75 % If you use the compressing suffixes then the <pid> is inserted before |
|
76 % the suffix (e.g. 'logpid ccmalloc.log.gz' uses 'ccmalloc.log.<pid>.gz' |
|
77 % as the name for the log file). |
|
78 |
|
79 %logpid FILE |
|
80 |
|
81 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
82 % 'dont-log-chain' skip info about certain chains [] |
|
83 % ---------------------------------------------------------------------- |
|
84 % This command may be repeated any number of times. The argument to this |
|
85 % command is a comma-separated list of function-or-file-and-line |
|
86 % specifications. Garbage allocated from a callchain that contains this |
|
87 % subchain anywhere will _not_ be logged. |
|
88 % |
|
89 % The ';'-separated list should not contain any spaces. E.g. not: |
|
90 % |
|
91 % main ; foo ; bar |
|
92 % |
|
93 % but: |
|
94 % |
|
95 % main;foo;bar |
|
96 % |
|
97 % A function-or-file-and-line specification is a string followed by an |
|
98 % optional colon and number, for example: main or main:14 or main.c or |
|
99 % main.c:15. Note that the string is compared with both the function and the |
|
100 % file name, if available. If main.c happens to be a function name, that |
|
101 % will cause a match (for that string at least). Not specifying a line |
|
102 % number will match any line number. If line number information is not |
|
103 % available, anything will match! Not specifying a name (e.g. ;;;) will |
|
104 % match an unknown function name. Not giving any parameters at all, will |
|
105 % match a chain containing at least one unknown function. |
|
106 % |
|
107 % Note that if you say 'dont-log-chain wrapper.c' nothing will be logged. |
|
108 |
|
109 %dont-log-chain |
|
110 |
|
111 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
112 % 'only-log-chain' skip info about other chains [] |
|
113 % ---------------------------------------------------------------------- |
|
114 % The obvious counterpart to dont-log-chain. In this case, only matching |
|
115 % chains will be reported. Non-matching chains will not be reported. |
|
116 % Can be repeated any number of times; if the chain matches any of the |
|
117 % instances, it will be reported. |
|
118 |
|
119 %only-log-chain |
|
120 |
|
121 ######################################################################## |
|
122 # # |
|
123 # This is the 'flag' section # |
|
124 # # |
|
125 # 'set FLAG' is the same as 'set FLAG 1' # |
|
126 # # |
|
127 # The default values are those set below. If 'silent' is disabled # |
|
128 # then you will find the banner in the log file (or it is listed on # |
|
129 # stdout or stderr). The banner describes the current settings of all # |
|
130 # these flags. # |
|
131 # # |
|
132 ######################################################################## |
|
133 |
|
134 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
135 % with 'only-count' ccmalloc only counts garbage - no call chains [0] |
|
136 % ---------------------------------------------------------------------- |
|
137 % If only-count is set to one then only one additional pointer for |
|
138 % each allocated data is used and no call chain is generated. This is |
|
139 % the fasted and most space efficient mode ccmalloc can operate |
|
140 % in. In this mode you get at least the size of garbage produced. |
|
141 % |
|
142 % Note that 'check-free-space' does not work at all with 'only-count' |
|
143 % set and over writes ('check-overwrites') are only checked when |
|
144 % calling free. |
|
145 |
|
146 %set only-count 0 |
|
147 |
|
148 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
149 % 'load-dynlibs' load dynamic linked libraries into gdb [0] |
|
150 % ---------------------------------------------------------------------- |
|
151 % If your program is linked with dynamic libraries, function and file |
|
152 % name information is not available for addresses in those libraries, |
|
153 % unless you set 'load-dynlibs' to 1. |
|
154 |
|
155 %set load-dynlibs 0 |
|
156 |
|
157 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
158 % 'keep-deallocated-data' does not recycle deallocated data [0] |
|
159 % ---------------------------------------------------------------------- |
|
160 % If you enable keep-deallocated-data then all data deallocated with |
|
161 % 'free' (or 'delete' in C++) is not given back to the free store |
|
162 % but stays associated with the call chain of its allocation. This is |
|
163 % very useful if your program does multiple deallocation of the |
|
164 % same data. |
|
165 |
|
166 %set keep-deallocated-data 0 |
|
167 |
|
168 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
169 % 'check-overwrites' detect overwrites [0] |
|
170 % ---------------------------------------------------------------------- |
|
171 % If you want to detect 'off by n bytes' errors you should set |
|
172 % 'checking-overwrites' to n/4 (on 32-Bit machines). |
|
173 % |
|
174 % ccmalloc inserts a boundary above allocated data. This boundary |
|
175 % consists of 'check-overwrites' words. If your program writes to |
|
176 % this area then ccmalloc can detect this (see also check-start |
|
177 % and check-interval). 'ccmalloc' also does checking for overwrites |
|
178 % at non word boundaries (e.g. strcpy(malloc(strlen("hello")),"hello");) |
|
179 |
|
180 set check-overwrites 1 |
|
181 |
|
182 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
183 % 'check-underwrites' detect underwrites [0] |
|
184 % ---------------------------------------------------------------------- |
|
185 % same with writes below allocated data. You do not have to set this |
|
186 % option if you only want detect 'off (below) by one' errors because |
|
187 % ccmalloc keeps a magic value just before the user data. |
|
188 |
|
189 set check-underwrites 1 |
|
190 |
|
191 |
|
192 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
193 % 'check-free-space' can be used to find dangling pointers. [0] |
|
194 % ---------------------------------------------------------------------- |
|
195 % A very serious type of bug is to write on data that has already been |
|
196 % freed. If this happens the free space management of malloc is in |
|
197 % trouble and you will perhaps encounter non deterministic behaviour of |
|
198 % your program. To test this first enable 'keep-deallocated-data' and |
|
199 % restart your program. If the problem goes away and ccmalloc does not |
|
200 % report anything then you should *also* enable 'check-free-space'. Now |
|
201 % ccmalloc checks already deallocated data for corruption. |
|
202 % |
|
203 % Note that to perform this check 'keep-deallocated-data' also must |
|
204 % be enabled and 'only-count' disabled. |
|
205 |
|
206 set check-free-space 1 |
|
207 |
|
208 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
209 % 'check-interval' can be used to speed up checks [0] |
|
210 % ---------------------------------------------------------------------- |
|
211 % If check-overwrite, check-underwrites or check-free-space is set then |
|
212 % the default is to do 'write checks' when data is deallocated and |
|
213 % to do 'free space checks' when reporting together with |
|
214 % 'write checks' for garbage. When you want these checks to be |
|
215 % performed more often then you should set 'check-interval' to a |
|
216 % positive number. This number is the interval between the number of |
|
217 % calls to free or malloc without performing the checks. |
|
218 |
|
219 %set check-interval 0 |
|
220 |
|
221 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
222 % 'check-start' can be used to speed up checks [0] |
|
223 % ---------------------------------------------------------------------- |
|
224 % The flag 'check-start' delays the start of checks until the given |
|
225 % number of calls to free and malloc have occured. Together with |
|
226 % 'check-interval' you can use a binary search to find an aproximation |
|
227 % when a corruption occured! If you simply set check-interval to 1 and |
|
228 % check-start to 0 then this will slow done your program too much. |
|
229 |
|
230 %set check-start 0 |
|
231 |
|
232 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
233 % 'silent' disables banner [0] |
|
234 % ---------------------------------------------------------------------- |
|
235 % If you don't want to see the banner of ccmalloc then set |
|
236 % 'silent' to 1 (f.e. when logging to stderr) |
|
237 |
|
238 %set silent |
|
239 |
|
240 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
241 % 'file-info' en/disables file and line number information [1] |
|
242 % ---------------------------------------------------------------------- |
|
243 % If your program was compiled with debugging information (-g) then |
|
244 % ccmalloc can generate line number and file info for call chains opening |
|
245 % a pipe to gdb. For very big programs this method is slow. In this case |
|
246 % you can set 'file-info' to zero and you will only get the function |
|
247 % names. For SunOS 4.3.1 'nm' does not 'demangle' C++ identifiers |
|
248 % very well. So gdb is called instead but only if 'file-info' is |
|
249 % not set to 0. |
|
250 |
|
251 %set file-info 1 |
|
252 |
|
253 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
254 % 'continue' if ccmalloc aborts when something weired happened [0] |
|
255 % ---------------------------------------------------------------------- |
|
256 % If the free function of ccmalloc is called with an argument that does |
|
257 % not make sense to ccmalloc or that has already been freed then you |
|
258 % probably want the program to stop at this point. This is also |
|
259 % the default behaviour. But you can force ccmalloc also to ignore |
|
260 % this if you set 'continue' to 1. This flag also controls the behaviour |
|
261 % of ccmalloc when free space is found to be corrupted or a write |
|
262 % boundary has been overwritten. |
|
263 |
|
264 %set continue 0 |
|
265 |
|
266 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
267 % 'chain-length' is the length of the maximal call chain [0 = infinite] |
|
268 % ---------------------------------------------------------------------- |
|
269 % You can restrict the length of call chains by setting 'chain-length' |
|
270 % to a number greater than zero. If 'chain-length' is zero (the default) |
|
271 % then chains are as long as possible (on a non x86 system only call |
|
272 % chains with a finite maximal length can be generated). For big |
|
273 % programs especially if keep-deallocated-data is enabled this can |
|
274 % reduce the size of the log file from over 100MB to several MB! |
|
275 |
|
276 %set chain-length 0 |
|
277 |
|
278 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
279 % 'print-addresses' of data [0] |
|
280 % ---------------------------------------------------------------------- |
|
281 % If you want to see the addresses of the allocated data (and |
|
282 % deallocated data if keep-deallocated-data is set to 1) set |
|
283 % 'print-addresses' to 1. |
|
284 |
|
285 %set print-addresses 0 |
|
286 |
|
287 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
288 % 'print-on-one-line' shortens log file [0] |
|
289 % ---------------------------------------------------------------------- |
|
290 % The default is to print function names and file/line number info |
|
291 % on separate lines. With 'print-on-one-line' set 1 all are printed |
|
292 % on one line. |
|
293 |
|
294 %set print-on-one-line 0 |
|
295 |
|
296 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
297 % 'additional-line' enlarges readability [1] |
|
298 % ---------------------------------------------------------------------- |
|
299 % When printing call chains an empty line is printed between to |
|
300 % call points. Set 'additional-line' to 0 to disable this feature. |
|
301 |
|
302 %set additional-line 1 |
|
303 |
|
304 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
305 % 'statistics' enables more accurate profiling [0] |
|
306 % ---------------------------------------------------------------------- |
|
307 % Calculate number of allocations and deallocations and bytes also on |
|
308 % a per call chain basis. This uses 4 additional pointers for each |
|
309 % call chain. |
|
310 |
|
311 set statistics 1 |
|
312 |
|
313 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
314 % set order for sorting of call chains [1] [1] |
|
315 % ---------------------------------------------------------------------- |
|
316 % When printing the report to the log file the call chains are sorted by |
|
317 % default with respect to the largest accumulated garbage produced by |
|
318 % that call chain. This can be changed with setting 'sort-by-wasted' |
|
319 % to 0. In this case they are sorted by the number of allocated bytes. |
|
320 % If you want the number of allocations (only possible if 'statistics' |
|
321 % is enabled) as sorting criteria instead then set 'sort-by-size' to 0. |
|
322 |
|
323 %set sort-by-wasted 1 |
|
324 %set sort-by-size 1 |
|
325 |
|
326 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
327 % report library chains [0] |
|
328 % ---------------------------------------------------------------------- |
|
329 % Some external libraries (like libg++) have memory leaks. On some |
|
330 % systems even a call to printf produces a leak. ccmalloc tries to |
|
331 % detect this (only heuristically!) and with this flag you can control |
|
332 % if leaks produced by such library calls are reported. |
|
333 % |
|
334 % Since version 0.2.1 some similar effect can be achieved by using |
|
335 % 'dont-log-chain' with no argument. |
|
336 |
|
337 %set library-chains 0 |
|
338 |
|
339 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
340 % print debugging information [X] (compile time dependend) |
|
341 % ---------------------------------------------------------------------- |
|
342 |
|
343 %set debug X |
|
344 |
|
345 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
346 % align memory on 8 byte boundary [0] (no effect on SunOS or Solaris) |
|
347 % ---------------------------------------------------------------------- |
|
348 |
|
349 %set align-8-byte 0 |
|
350 |
|
351 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
352 % only report allocations which ended up being wasted (i.e don't report |
|
353 % allocations which were completely freed properly. ) [1] |
|
354 % ---------------------------------------------------------------------- |
|
355 |
|
356 %set only-wasting-alloc 1 |