Newsgroups: comp.parallel.pvm
From: erd@regent.e-technik.tu-muenchen.de (Eric Doenges)
Subject: Error in pvm_mkbuf() ?
Organization: Technische Universitaet Muenchen, Germany	
Date: 26 Jun 1995 07:09:13 GMT
Message-ID: <3slmep$4g4@sunsystem5.informatik.tu-muenchen.de>

I have the following PVM problem:

I modefied an existing (working !) parallel logic simulator using P4 for
communications to use PVM. Now, the simulator crashes. I have traced the crash
to the pvm_mkbuf function, which somehow overwrites an object's virtual
function table. I am very shure that the error must be in the pvm_mkbuf
function, because I have used GDB to verify that said object's data is correct
right up to the moment I call pvm_mkbuf, and is corrupt right after the
pvm_mkbuf call. I am using PVM Version 3.3.0 on DEC 5000 workstations.

Is this a bug in PVM version 3.3.0 or am I missing something important
in my 'send' routine ? (included below)


void SimCommPVM::send(int type, int to, char *msg, int len)
{
  int bufid;

  //bufid = pvm_initsend(PvmDataDefault);

  bufid = pvm_mkbuf(PvmDataDefault);

  if(bufid < 0) {
    pvm_perror("Bad error in SimCommPVM::send - initsend returned error !");
    exit(100);
  }

  pvm_setsbuf(bufid);

  // only pkbyte if length > 0

  pvm_pkint(&len, 1, 1);

  if(len > 0)
    pvm_pkbyte(msg, len, 1);

  pvm_send(sim_tids[to], type );
  pvm_freebuf(bufid);
}

NOTES:

- The call to "pvm_initsend" also crashes the simulator in exactly the same
way, presumably because it calls "pvm_mkbuf" internally.

- I am certain that the error is not in the code before the call to 'send',
because the code worked in the past and wasn't changed

Any help would be greatly appreceated.

--
                                                                          (__)
     _/_/_/ _/_/   _/_/                                                   (oo)
    _/     _/ _/  _/ _/  Eric Doenges                             /--------\/
   _/_/   _/_/   _/ _/   (erd@regent.e-technik.tu-muenchen.de)   * o|     ||
  _/     _/ _/  _/ _/                                               ||----||
 _/_/_/ _/  _/ _/_/                                              ooo~~    ~~



