Newsgroups: comp.parallel.pvm
From: john@elroy.jpl.nasa.gov (John Wright)
Subject: Re: Pb with pvm_upkstr
Keywords: pvm_upkstr
Organization: Image Analysis Systems Group, JPL
Date: 25 Apr 1995 16:17:58 GMT
Message-ID: <3nj7bm$6hf@elroy.jpl.nasa.gov>

In article <3ngf1k$ff2@bisance.citi2.fr>,
Sophie Chabridon <chabridon@math-info.univ-paris.fr> wrote:
>Has anybody around successfully used  the function "pvm_upkstr()" ?
>I am using it to unpack a message sent with pvm_pkstr where
>the string is simply a constant (i.e. pvm_pkstr("string_of_char"); ).
>My problem is that pvm_upkstr creates a core dump and the program stops.
>
>Thanks for any hints.
>S.C.

It seems to work for me.  Are you sure you're allocating the
space for the string before putting it in?  Try the following.

John

      char *cp;
      pvm_setrbuf(recv_msg_buff_id);
      if(pvm_bufinfo(recv_msg_buff_id, &bytes, &msgtag, &tid)) {
              cp = (char *)malloc(bytes);
              return(pvm_upkstr(cp));
      } else {
              return(NULL);
      }


-- 
john@tone.jpl.nasa.gov
---Signature under construction---
(I quail at the impossibility of capturing the 
essence of myself in four lines in an ASCII file)

