Using Insure at Slac
Log onto a SLAC Unix machine for your compilation and execution. Set up your environment for Insight. Recompile your code, and run it in the usual way. For example,
- gmake clean
- gmake CXX=insure CC=insure
- gmake [package name(in our example BetaApp].bin CXX=insure CC=insure
- young@morgan01 $ cd workdir
- young@morgan01 $ ./betarun ../BetaUser/script.tcl
A short explanation for the curious... What happens when you say CXX=insure CC=insure is that while the given compiler is used, all of its heap allocation is traced by Insure.
Once you've done that, you are ready to run your code. Simply type the usual command from workdir and watch your code run. An Insra window should pop up, and as you execute the code, you will see messages you haven't seen before (mostly warnings and
such). It's okay. Once your application exits, Insra will build a report detailing the amount of memory leaked, the fuctions in which you lost the memory and when you click on the blue function links, you will be taken to the exact new statement which is
creating the leak.
(Charlie Young provided this section for a previous version of Insure++. It has been updated with obvious changes, but not yet tested - in the interests of getting this page ready asap. If you run into problems with running Beta using the instructions
below, please contact either Ilya or Charlie.)
The error report file when I ran the job was
~/myBeta/workdir/BetaApp-errs.970126075654.
BetaApp is the executable name, and 970126075654
gives the execution time of January 26, 1997, 07:56:54.
Now comes the hard part of interpreting the error report and fixing the
bugs. I can offer nothing on these points, since I haven't been
through it. Please consult the User
Guide, and/or experts.
- The error report can be intimidatingly detailed. If you are debugging a specific piece of code and are confident that problems elsewhere are not directly relevant, you can selectively activate and deactivate runtime error checking by adding these
lines to your code.
#ifdef __INSURE__
_Insure_set_option("runtime","off");
#endif
#ifdef __INSURE__
_Insure_set_option("runtime","on");
#endif
Code in between will not be checked, and your report should be
correspondingly shorter and more easily decipherable.
It is not essential to remove them when you are finished debugging and
go back to using the standard compiler. __INSURE__ is
defined only when using Insure++.
please contact me with comments/questions at
beylin@SLAC.Stanford.EDU
Memory Leak Page
Insure Home Page
[Top of the Page]
|