Home / Projects / Quality assurance / Tools

Quality Assurance - Notes on using INSURE

Insure is available from CERN SDT. It can be used under CMT as follows.

Setting up INSURE

I. SDT instructions

1. Make a soft link to pttools (on lxplus this has been done for you):

 ln -s /pttools/Insure /afs/cern.ch/pttools/Insure 

2. Do whatever SDT needs

 source  /pttools/Insure/insure/linux/insure.[c]sh 

3. You can configure Insure by editing a text file in your home directory called .psrc.

Example :
 insure++.inuse on 
insure++.summarize leaks

4. Start up the Inuse (the graphical memory usage displays)

  /pttools/Insure/6.1/bin.linux2/inuse &

II. Setting up the code to test

1. Check out the code you want to investigate

2. Check out the the Athena main which is in Control/AthenaCommon.

(you seem to need the main for all this to work)

3 build using CMT as usual, put with the compilation:

   cmt broadcast gmake cpp=insure 

III Testing the code

1. Run athena.

The inuse menus give you a number of things to display.

First experience with Insure to look for an (intentional) bug in Artemis.(by Peter Sherwood)

The Test Case:

ArtemisAlgs is a package that produces a DLL that is loaded by athena.

I intentionally added a leak with rate 10Mbyte/event (!).

I used this to make a first exploration of the memory leak detection capacity of Insure.

After completing the above 3 steps, my huge memory leak was not reported as a memory leak during the event loop, but rather as memory usage. As I never gave the memory back, my leak was reported as a leak on termination.

By using the "Freq" display (which is a histogram of the frequency of memory allocation in bins of memory blocks), I could easily see that a 40 000 000 byte block had been allocated 10 times (I ran for 10 events). The plots of heap usage also showed 10 large steps (although as the scale is self adjusting, the steps look smaller at the end of the run).

By using the query facility, and selecting filtering on block allocations in the range 35 000 000 to 45 000 000, I got a trace back giving the exact line in my code that caused the leak.

First reactions:

This was a very cursory exporation. I remain puzzled why my leaks did not appear in blue (the leak color for all the plots) but as normal heap usage until the end of the job (I promise it was a real leak).

None the less, this very simple case was easy to track down.

The error reports seem relatively clear.

See also

↑ Top