Newsgroups: comp.parallel.pvm
Path: ukc!uknet!pipex!howland.reston.ans.net!usc!elroy.jpl.nasa.gov!ucla-cs!oahu.cs.ucla.edu!edmond
From: edmond@oahu.cs.ucla.edu (Edmond Mesrobian)
Subject: PVM 3.2.6 Memory Leak?
Nntp-Posting-Host: oahu.cs.ucla.edu
Organization: UCLA, Computer Science Department
Message-ID: <1994Apr17.192306.19796@cs.ucla.edu>
Date: Sun, 17 Apr 94 19:23:06 GMT
Lines: 38

Hi,
  I am runing PVM 3.2.6 on an IBM SP1 (AIX 3.2). It seems to me that PVM
has a memory leak. I am using the default strategy of doing a pvm_initsend()
and then a bunch of pvm_pk...()'s and a pvm_send(). I then go to a 
pvm_probe() and if any action, a pvm_recv(). Now, as the process is running
(say 5/6 iterations), all is ok, Then I get a malloc death inside the calls
made by the service routines for a pvm_probe(). This consistently happens.
On an lightly loaded machine, it takes longer, but eventually dies. I tried
to use USE_PVM_ALLOC and got i_free to die with a 

[t80040000] [t1c0001] i_free: scribbled in 0x2066f010[-15]
[t80040000] sendmessage() scrapped, no such task t0

Now, I have been looking at the pvm code and have tried to find out where
the current active buffer is freed of all its memory when a pvm_initsend()
is called. 
 
pvm_initsend() -> pvm_freebuf() -> umbuf_free() -> fr_unref()

now, fr_unref() recursively deletes the frag list and calls  da_unref(fp->fr_buf);

But, why is the fp->fr_data not blown away? 


struct frag {
    struct frag *fr_link;   /* chain or 0 */
    struct frag *fr_rlink;
    int fr_ref;             /* refcount (of chain if master else of frag) */
    char *fr_buf;           /* buffer or zero if master frag */
    int fr_max;             /* size of buffer */
    char *fr_dat;           /* data */
    int fr_len;             /* length of data */
};

Is this crazy, or am I missing something obvious!

..Edmond


