[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::axp-developer

Title:Alpha Developer Support
Notice:[email protected], 800-332-4786
Moderator:HYDRA::SYSTEM
Created:Mon Jun 06 1994
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:3722
Total number of notes:11359

3542.0. "ABB Power Oy - Point 26737" by RDGENG::ASAP () Fri Apr 25 1997 05:11

    Company Name :  ABB Power Oy - Point 26737
    Contact Name :  Jari Kumala
    Phone        :  +358 10 222 5282
    Fax          :  +358 10 222 5210
    Email        :  [email protected]
    Date/Time in :  25-APR-1997 09:10:54
    Entered by   :  Nick Hudson
    SPE center   :  REO

    Category     :  vms
    OS Version   :  7.1
    System H/W   :  


    Brief Description of Problem:
    -----------------------------

From:	RDGENG::MRGATE::"RDGMTS::PMDF::mail.dec.com::MartinB2" 24-APR-1997 16:46:53.98
To:	RDGENG::ASAP
CC:	
Subj:	ESCALATION: POINT 26737  , Company ABB POWER OY  TO ASAP READING:

From:	NAME: Brendan Martin <[email protected]@PMDF@INTERNET>
To:	NAME: '[email protected]' <IMCEAX400-c=US+3Ba=+20+3Bp=DIGITAL+3Bo=SBUEURMFG+3Bdda+3ASMTP=asap+40reo+2Emts+2Edec+2Ecom+3B@mail.dec.com@PMDF@INTERNET>

Hello - 

POINT Log Number	26737 
Company Name 	ABB Power Oy, Helsinki,  ASAP  NO: D60276
Engineers name	Jari Kumala
Telephone Number 	+358 10 222 5282
Fax Number		+358 10 222 5210
E-mail Address	[email protected]

Operating System, Version	OpenVMS Alpha 7.1

Platform			

Problem Statement		
this is Jari Kulmala from ABB Power Oy, Helsinki, Finland. Our ASAP
member number is D60276. Our system manager told that you are a good
forum for getting technical support.

We have a technical problem that deals with the DCE 1.4 software in 
OpenVMS
Alpha V7.1 environment. (DCE$LIB_SHR.EXE ident is V1.4-961030).

The problem is with the remote procedure calls (DCE/RPC). Seems that
long output strings from RPCs are not delivered correctly by the 
software.
For example, I have the following RPC definition:

void t_gets(
   [in] handle_t rpch,
   [in] long cRetStrMax,
   [string,out,size_is(cRetStrMax)] char *szRetStr);

and I call it as follows:
   idl_char txt[512];
   t_gets(rpch, sizeof(txt), txt);

the length of the result string is 300, but only 220 characters are 
seen
by the client routine. The above is part of my simple example. A more 
complex
example also seems to corrupt the program somehow.

The same program works OK in OpenVMS Alpha 6.2 with DCE version 1.2 (
DCE$LIB_SHR.EXE ident is "DCE V1.2-940507"). The example works also 
if
the server is in OpenVMS Alpha 6.2/DCE 1.2, and only the client is in
OpenVMS Alpha V7.1/DCE 1.4, so it seems that the problem is in the
server's side.


Is this a bug in the DCE/RPC software? Is there any remedial kits for 
it?
You can contact me as follows:

   e-mail:	[email protected]
   tel:		+358 10 222 5282
   fax:		+358 10 222 5210


The sources for the complete example program follows:

T_BUILD.COM		- builds the example
T_CLIENT.C
T_CLIENTL.COM
T_COM.COM		- defines t_server and t_client commands
T_IF.H
T_IF.IDL
T_MANAGER.C
T_OUTPUT.TXT		- output example from my environment
T_SERVER.C
T_SERVERL.COM

Make a command procedure from the following, and run in
an empty directory to create the example files.

------------------------------ cut here 
------------------------------
$ C:=CREATE/LOG
$ C T_BUILD.COM
$ DECK/DOLLARS=___$$$___
$ IDL -keep c_source T_IF.IDL -trace all
$ CC/INC=<> T_SERVER.C
$ CC/INC=<> T_MANAGER.C
$ CC/INC=<> T_IF_SSTUB.C
$ CC/INC=<> T_IF_CSTUB.C
$ CC/INC=<> T_CLIENT.C
$ @T_SERVERL.COM
$ @T_CLIENTL.COM
___$$$___
$ C T_CLIENT.C
$ DECK/DOLLARS=___$$$___
/*=====================================================================  
=======
==
t_client.c
=======================================================================  
=======
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>


#include "t_if.h"

#include <dce/dce_error.h>

typedef struct
{
   idl_char bytes[dce_c_error_string_len];
} errstr_store_rec;

/*---------------------------------------------------------------------  
-------
--
-----------------------------------------------------------------------  
-------
*/
static idl_char *GetDceErrText(error_status_t st, errstr_store_rec 
*str_store)
{
   int retst;
   dce_error_inq_text(st, str_store->bytes, &retst);
   return str_store->bytes;
}

/*---------------------------------------------------------------------  
-------
--
-----------------------------------------------------------------------  
-------
*/
static void Exercise(
   rpc_binding_handle_t	rpch)
{
   idl_char txt[512];
   t_gets(rpch, sizeof(txt), txt);
   printf("Text = '%s'\n", txt);
}


/*---------------------------------------------------------------------  
-------
--
-----------------------------------------------------------------------  
-------
*/
static void TestMain(int argc, char **argv)
{

   rpc_binding_handle_t	bh;
   error_status_t	st;
   idl_char		*string_binding;
   errstr_store_rec	errstr;

   if (argc >= 2)
   {
      string_binding = (idl_char*) argv[1];
   }
   else
   {
      string_binding = (idl_char*) "ncacn_ip_tcp:138.221.156.11";
   }

   printf("Connecting to string binding '%s' ...\n", string_binding);

   rpc_binding_from_string_binding(string_binding, &bh, &st);

   if (st != error_status_ok)
   {
      fprintf(stderr, "Invalid address '%s' - %s\n", string_binding,
GetDceErrText(st, &errstr));
      exit(2);
   }

   printf("Bound to %s, rpch = %d\n", string_binding, bh);

   Exercise(bh);

   rpc_binding_free(&bh, &st);
   if (st != error_status_ok)
   {
      fprintf(stderr, "Failed to execute rpc_binding_free - %s\n",
GetDceErrText(st, &errstr));
      exit(2);
   }
   puts("Binding freed");

}

main(int argc, char **argv)
{
   TestMain(argc, argv);
   return 1;
}
___$$$___
$ C T_CLIENTL.COM
$ DECK/DOLLARS=___$$$___
$ LINK'P1'/EXE=t_client.exe -
   t_client,T_IF_CSTUB,-
   dce:dce.opt/options
___$$$___
$ C T_COM.COM
$ DECK/DOLLARS=___$$$___
$ t_server :== $sys$disk:<>t_server
$ t_client :== $sys$disk:<>t_client
___$$$___
$ C T_IF.H
$ DECK/DOLLARS=___$$$___
/* Generated by IDL compiler version DEC DCE T1.2.0-06 */
#ifndef t_if_v1_0_included
#define t_if_v1_0_included
#ifndef IDLBASE_H
#include <dce/idlbase.h>
#endif
#include <dce/rpc.h>

#ifdef __cplusplus
    extern "C" {
#endif

#ifndef nbase_v0_0_included
#include <dce/nbase.h>
#endif
  extern void t_gets(
#ifdef IDL_PROTOTYPES
      /* [in] */ handle_t rpch,
      /* [in] */ idl_long_int cRetStrMax,
      /* [out] */ idl_char *szRetStr
#endif
  );
#if defined(__VMS) && (defined(__DECC) || defined(__cplusplus))
#pragma extern_model __save
#pragma extern_model __common_block __shr
#endif
  typedef struct t_if_v1_0_epv_t {
    void (*t_gets)(
#ifdef IDL_PROTOTYPES
        /* [in] */ handle_t rpch,
        /* [in] */ idl_long_int cRetStrMax,
        /* [out] */ idl_char *szRetStr
#endif
    );
  } t_if_v1_0_epv_t;
  extern rpc_if_handle_t t_if_v1_0_c_ifspec;
  extern rpc_if_handle_t t_if_v1_0_s_ifspec;
#if defined(__VMS) && (defined(__DECC) || defined(__cplusplus))
#pragma extern_model __restore
#endif

#ifdef __cplusplus
      }

#else
#endif
#endif
___$$$___
$ C T_IF.IDL
$ DECK/DOLLARS=___$$$___
/*=====================================================================  
=======
==
t_if.idl
=======================================================================  
=======
*/

[
uuid(f5ef0a53-bc8d-11d0-9104-08002b9138c5),
version(1.0)
]
interface t_if
{

void t_gets(
   [in] handle_t rpch,
   [in] long cRetStrMax,
   [string,out,size_is(cRetStrMax)] char *szRetStr);

}
___$$$___
$ C T_MANAGER.C
$ DECK/DOLLARS=___$$$___
/*=====================================================================  
=======
==
t_manager.c
=======================================================================  
=======
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>

#include "t_if.h"


/*---------------------------------------------------------------------  
-------
--
-----------------------------------------------------------------------  
-------
*/
extern void t_gets(
      /* [in] */ handle_t rpch,
      /* [in] */ idl_long_int cRetStrMax,
      /* [out] */ idl_char *szRetStr)
{
   assert(cRetStrMax >= 301);
   memset(szRetStr, 'A', 100);
   memset(szRetStr+100, 'B', 100);
   memset(szRetStr+200, 'C', 100);
   szRetStr[300] = 0;
   printf("Returning '%s'\n", szRetStr);
}
___$$$___
$ C T_OUTPUT.TXT
$ DECK/DOLLARS=___$$$___

Server output:

PXPS02$ RPC_LOG_FILE == " "
PXPS02$ t_server ncacn_ip_tcp
Bindings:
ncacn_ip_tcp:138.221.156.12[2842]
Listening...
1997-04-24-13:54:21.396+03:00I-----   PXPS02:761266657/0  t_if.t_gets 
log_start            all
1997-04-24-13:54:21.424+03:00I-----   PXPS02:761266657/0  t_if.t_gets 
activate             ncacn_ip_tcp:138.221.156.12[
2844]
1997-04-24-13:54:21.427+03:00I-----   PXPS02:761266657/0  t_if.t_gets 
manager_call
Returning
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA  
AAAAAAA
AAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB  
BBBBBBB
BCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC'
1997-04-24-13:54:21.450+03:00I-----   PXPS02:761266657/0  t_if.t_gets 
manager_return
1997-04-24-13:54:21.453+03:00I-----   PXPS02:761266657/0  t_if.t_gets 
terminate


Client output:
PXPS02$ RPC_LOG_FILE == " "
PXPS02$ t_client ncacn_ip_tcp:138.221.156.12[2842]
Connecting to string binding 'ncacn_ip_tcp:138.221.156.12[2842]' ...
Bound to ncacn_ip_tcp:138.221.156.12[2842], rpch = 7338048
1997-04-24-13:54:21.359+03:00I-----   PXPS02:761274150/0  t_if.t_gets 
log_start            all
1997-04-24-13:54:21.369+03:00I-----   PXPS02:761274150/0  t_if.t_gets 
call_start           ncacn_ip_tcp:138.221.156.12[
2842]
1997-04-24-13:54:21.380+03:00I-----   PXPS02:761274150/0  t_if.t_gets 
await_reply
1997-04-24-13:54:21.458+03:00I-----   PXPS02:761274150/0  t_if.t_gets 
receive
1997-04-24-13:54:21.461+03:00I-----   PXPS02:761274150/0  t_if.t_gets 
call_end
Text =
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA  
AAAAAAA
AAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB  
BBBBBCC
CCCCCCCCCCCCCCCCCC'
Binding freed
___$$$___
$ C T_SERVER.C
$ DECK/DOLLARS=___$$$___
#include <stdio.h>
#include <stdlib.h>
#include <dce/dce_error.h>
#include <dce/exc_handling.h>

#include "t_if.h"		/* header file generated by IDL compiler */

#define MAX_CONCURRENT_CALLS 1


extern t_if_v1_0_epv_t t_v1_0_manager_epv;

static uuid_t uuid_nil;

typedef struct
{
   idl_char bytes[dce_c_error_string_len];
} errstr_store_rec;

/*---------------------------------------------------------------------  
-------
--
-----------------------------------------------------------------------  
-------
*/
idl_char *GetDceErrText(error_status_t st, errstr_store_rec 
*str_store)
{
   int retst;
   dce_error_inq_text(st, str_store->bytes, &retst);
   return str_store->bytes;
}

/*---------------------------------------------------------------------  
-------
--
-----------------------------------------------------------------------  
-------
*/
static int main(int argc, char **argv)
{
   rpc_binding_vector_p_t bvec;
   error_status_t	st;
   idl_boolean		validfamily;
   idl_char		*protSeq;
   int			bindi;
   idl_char 		*string_binding;
   errstr_store_rec	errstr;

   if (argc != 2)
   {
      fprintf(stderr, "Usage: %s family\n", argv[0]);
      exit(2);
   }

   protSeq = (idl_char*) argv[1];

   validfamily = rpc_network_is_protseq_valid(protSeq, &st);

   if (st != error_status_ok)
   {
      fprintf(stderr, "Cannot check protocol sequence - %s\n",
GetDceErrText(st, &errstr));
      exit(2);
   }

   if (!validfamily)
   {
      fprintf(stderr, "Protocol sequence '%s' is not valid\n", 
protSeq);
      exit(2);
   }


   rpc_server_use_protseq(protSeq, MAX_CONCURRENT_CALLS, &st);

   if (st != error_status_ok)
   {
      fprintf(stderr, "Cannot use protocol sequence - %s\n", 
GetDceErrText(st,
&errstr));
      exit(2);
   }

   rpc_server_register_if(t_if_v1_0_s_ifspec, &uuid_nil, NULL, &st);

   if (st != error_status_ok)
   {
      fprintf(stderr, "Cannot register interface - %s\n", 
GetDceErrText(st,
&errstr));
      exit(2);
   }


   rpc_server_inq_bindings(&bvec, &st);

   if (st != error_status_ok)
   {
      fprintf(stderr, "Cannot inquire bindings - %s\n", 
GetDceErrText(st,
&errstr));
      exit(2);
   }

   printf("Bindings:\n");
   for (bindi = 0; bindi < bvec->count; bindi++)
   {
      rpc_binding_to_string_binding(bvec->binding_h[bindi], 
&string_binding,
&st);
      printf("%s\n", string_binding);
      rpc_string_free(&string_binding, &st);
   }


   rpc_ep_register(t_if_v1_0_s_ifspec, bvec, (uuid_vector_p_t) NULL,
(unsigned_char_p_t) "t version 1.0 server", &st);

   if (st != error_status_ok)
   {
      fprintf(stderr, "Could not register endpoint - %s\n", 
GetDceErrText(st,
&errstr));
   }

   TRY
   {
      printf("Listening...\n");
      rpc_server_listen(MAX_CONCURRENT_CALLS, &st);
      if (st != error_status_ok)
      {
	 fprintf(stderr, "Error: %s\n", GetDceErrText(st, &errstr));
	 exit(2);
      }
   }
   CATCH_ALL
   {
      printf("Unregistered endpoint\n");
      rpc_ep_unregister(t_if_v1_0_s_ifspec, bvec, (uuid_vector_p_t) 
NULL,
&st);
   }
   ENDTRY;

}
___$$$___
$ C T_SERVERL.COM
$ DECK/DOLLARS=___$$$___
$ LINK'P1'/EXE=t_server.exe -
   T_SERVER.OBJ, -
   T_MANAGER.OBJ, -
   T_IF_SSTUB,-
   dce:dce.opt/options
___$$$___


------------------------------ cut here 
------------------------------








In replying, please use [email protected]



RFC-822-headers:
Received: from reoexc1.reo.dec.com by rg71rw.reo.dec.com (PMDF V5.0-7 #15552)
 id <[email protected]> for [email protected]; Thu,
 24 Apr 1997 15:15:06 +0100
Received: by reoexc1.reo.dec.com with SMTP
 (Microsoft Exchange Server Internet Mail Connector Version 4.0.994.63)
 id <[email protected]>; Thu, 24 Apr 1997 15:16:49 +0100
X-Mailer: Microsoft Exchange Server Internet Mail Connector Version 4.0.994.63
T.RTitleUserPersonal
Name
DateLines