Newsgroups: comp.parallel.pvm
From: stuart@cs.ualberta.ca (David Stuart)
Subject: Help!!
Organization: University of Alberta
Date: 18 Feb 1996 18:45:59 GMT
Message-ID: <4g7s57$fk3@scapa.cs.ualberta.ca>

I am having troubles with pvm_initsend, and I have an assignment due,
pronto.. I don't really understand what the problem is.. I have a
function definition, like thus:

/*----------------------------------------------------------------------*/
void sendclient (int Message, int msgtag, int tid) {

        int bufid;      /* The buffer we're sending to */
        int status;     /* 'scratch' result variable */

        bufid = pvm_initsend (PvmDataDefault);
        PVMERROR (bufid, "initializing ");
        status = pvm_pkint (&Message, 1, 1);
        PVMERROR (status, "packing ");
        status = pvm_send (tid, msgtag);
        PVMERROR (status, "sending ");
        status = pvm_freebuf (bufid);   /* Clean up */
        PVMERROR (status, "freeing send buffer");
}
/*----------------------------------------------------------------------*/

and in the body of the program, I call it, like thus:

	sendclient (OPEN_SUCCESS, OPEN, files[i].ownertid);

Where OPEN_SUCCESS and OPEN are #define'd to be integers. When I run the
program, it *sometimes* works, and sometimes doesn't?? Am I doing something
wrong? Here's what dbx says about it:

cab117: stuart/379/as2> dbx server
dbx version 3.19 Nov  3 1994 19:59:46
Core from signal SIGSEGV: Segmentation violation
(dbx) where
>  0 realfree(0x536d0078, 0x10009714, 0x436c6964, 0x436c6965) ["malloc.c":527, 0xfabef40]
   1 cleanfree(0x0, 0x10009714, 0x436c6964, 0x436c6965) ["malloc.c":943, 0xfabc93c]
   2 __malloc(0x536d0078, 0x10009714, 0x1008, 0x436c6965) ["malloc.c":229, 0xfabc684]
   3 _malloc(0x1008, 0x10009714, 0x436c6964, 0x436c6965) ["malloc.c":185, 0xfabf1dc]
   4 da_new(0x536d0078, 0x10009714, 0x436c6964, 0x436c6965) ["../pvmdabuf.c":69, 0x4219e8]
   5 fr_new(0x1000, 0x100056e4, 0x436c6964, 0x436c6965) ["../pvmfrag.c":153, 0x4207f8]
   6 enc_xdr_init(0x536d0078, 0x10009714, 0x436c6964, 0x436c6965) ["../lpvmpack.c":785, 0x415f88]
   7 pvm_setsbuf(0x7, 0x10009714, 0x436c6964, 0x100044e0) ["../lpvmpack.c":1955, 0x418c90]
   8 pvm_initsend(0x0, 0x10009714, 0x436c6964, 0x436c6965) ["../lpvmpack.c":2097, 0x419624]
   9 sendclient(Message = 0, msgtag = 3, tid = 262162) ["/usr/falun1/ugrad/stuart/379/as2/server.c":172, 0x4044dc]
   10 main(argc = 1, argv = 0x7fffaef4) ["/usr/falun1/ugrad/stuart/379/as2/server.c":140, 0x404350]
   11 __start() ["crt1text.s":133, 0x403f3c]

--
If I go up a bunch of levels and do a 'dump', this is what it says:
(dbx) dump
sendclient(Message = 0, msgtag = 3, tid = 262162) ["/usr/falun1/ugrad/stuart/379/as2/server.c":172, 0x4044dc]
bufid = 0
status = 10
--

I don't get it. Can anyone offer some helpful explanations?

Dave
-- 
\o/\o/\o/\o/\o/ \o/\o/\o/\o/\o/email:stuart@falun.cs.ualberta.ca 
 L  A  T  E  R   D  U  D  E  S http://ugweb.cs.ualberta.ca/~stuart/
< \< \< \< \/ \ / \/ >/ >/ >/ >http://ugweb.cs.ualberta.ca/~stuart/monty.cgi
David Stuart, AMUS. 3rd yr. Computing Science University of Alberta Canada

