Operating System - OpenVMS
1752290 Members
4976 Online
108786 Solutions
New Discussion

Re: ICC_OPEN_ASSOC using Pascal

 
SOLVED
Go to solution
Brian Reiter
Valued Contributor

ICC_OPEN_ASSOC using Pascal

Hi Folks,

 

I'm experimenting with the Intra Cluster Communications calls, we're looking at making some legacy software cluster aware and the ICC calls seem like a useful ser of tools. Anyway, I cannot seem to fathom out the exact set of parameters required for the connect/disconnect AST routine when using the ICC_OPEN_ASSOC. The program crashes wih an access violation (both attached).

 

I'm using OpenVMS V8.3-1H1 on an RX2660, the problem occurs with Pascal versions V6.0-111 and  V6.1-119. I've attached (with any luck) the required files.

 

The server sits there quite happyily until a connection event occurs, at which point it bombs up. I've tried various combinations of paramters for the AST routine but with no change.

 

Hope someone can help.

 

cheers

 

Brian

 

17 REPLIES 17
Ruslan Laishev
Occasional Advisor

Re: ICC_OPEN_ASSOC using Pascal

Hi!

 

 

Is there . LIS files ?

Brian Reiter
Valued Contributor

Re: ICC_OPEN_ASSOC using Pascal

Hi there,

 

There would be, but the forum software seems to dislike them.

 

Ah well, will try a different extension.

 

cheers

 

Brian

Brian Reiter
Valued Contributor

Re: ICC_OPEN_ASSOC using Pascal

And now the listings - it has to be .TXT files not .LIS

 

 

Ruslan Laishev
Occasional Advisor

Re: ICC_OPEN_ASSOC using Pascal

Have you tried run under DEBUG ?

Brian Reiter
Valued Contributor

Re: ICC_OPEN_ASSOC using Pascal

Yep, same thing. Access violation as soon as the AST fires.

Ruslan Laishev
Occasional Advisor

Re: ICC_OPEN_ASSOC using Pascal

logical_name ,
  'ICC$REGISTRY_TABLE',

Descriptors ? Or just ASCIZ string ?

Brian Reiter
Valued Contributor

Re: ICC_OPEN_ASSOC using Pascal

According to the prototype in starlet. it'll go as a CLASS_S so I'll assume its passed by descriptor. This method seems to work for other system service calls from Pascal and certainly doesn't seem to cause any errors in the call to ICC_OPEN_ASSOC (it returns SS$_NORMAL).

 

cheers

 

Brian

John Gillings
Honored Contributor

Re: ICC_OPEN_ASSOC using Pascal

Brian,

 

   I've used ICC quite a lot, and very successfully. It's an excellent mechanism, but the coding can be a bit obscure. I'd also warn that you need to be at up-to-date patch levels, as there were some system crashing bugs in ICC a few years back.  Here's a sample call from my MACRO32 code (oh, and note that several of the system supplied macros for ICC routines are badly defined and don't work! Unlikely to be the case for Pascal). This looks pretty much equivalent to your procedure call. 

 

$ICC_OPEN_ASSOC_S -
  ASSOC_NAME=ServerName,-            ; Class S descriptor
  ASSOC_HANDLE=icc_assoc_handle,-    ; long word by reference init to 0
  LOGICAL_NAME=ServerName,-          ; same descriptor as above
  LOGICAL_TABLE=ICC$REGISTRY_TABLE, -; Class S descriptor "self string"
  CONN_RTN=ICC_ConnEvent,-           ; routines by reference
  DISC_RTN=ICC_DisconnEvent,-
  RECV_RTN=ICC_Receive

 Notice that your ACCVIO is occuring in YOUR code, not in $ICC_OPEN_ASSOC. It's in the prologue of your connection_event routine (line 30). I suspect it's because you've declared all the arguments as VALUE not VAR, so the Pascal prologue is attempting to create local stack copies of all the arguments. I'd have to think about it harder to work it out exactly what the declarations should be, but for a first pass, I'd just declare everything as VAR LONG, set a break point in the routine and examine what gets passed in.

 

Here's my ICC_ConnEvent routine

 

       .ENTRY ICC_ConnEvent,^M<R2,R3,R4,R5,R6,R7,R8,R9,R10,R11>
         ArgList EvtTyp ConnHandle DataLen DataBuf ReplyLen PID UserName
          CMPL EvtTyp_Arg(AP),#ICC$C_EV_CONNECT
          BNEQ ICC_AbortConnect
            BLBS icc_finish,ICC_RejectConnect
              MOVAB ServerName,R9
              MOVL DataBuf_Arg(AP),R8
              MOVL DataLen_Arg(AP),R7
              CMPC3 R7,(R8),@DSC$A_POINTER(R9)
              BNEQ ICC_RejectConnect
                MOVZWL accept_w_len,R3
                CMPL R3,ReplyLen_arg(AP)
                BGTR ICC_RejectConnect
                  GetStruc clcx,R10
                  MOVL PID_Arg(AP),clcx_l_pid(R10)
                  Copy #clcx_k_maxuser,@UserName_Arg(AP),clcx_t_user(R10)
                  CLRL clcx_l_eos(R10)
                  CALL ServerNewClientContext (R10)
                  InsertQueueTail clcx_queue R10
                  $ICC_ACCEPT_S CONN_HANDLE=ConnHandle_Arg(AP),USER_CONTEXT=R10 -
                    ACCEPT_BUF=accept_t_buf,ACCEPT_LEN=R3
                  INCL ICC_ConnectCount
                  RET
          ICC_RejectConnect:
            $ICC_REJECT_S CONN_HANDLE=ConnHandle_Arg(AP)
          RET
          ICC_AbortConnect:
            MOVL #SS$_ABORT,R0
            Abort #^A/CONN/

 

 

 

 

 

A crucible of informative mistakes
John Gillings
Honored Contributor
Solution

Re: ICC_OPEN_ASSOC using Pascal

Brian,

 

   Rereading my code, I notice that several of the arguments to the AST routines are passed by immediate value. So your routines will need to deal with that. I don't think Pascal has a way to describe an incoming argument as passed by immediate value, so you'll probably have to hack it as a reference argument and use IADDRESS to fetch the argument value. You definitely WON'T be able to define them as VALUE parameters (in the Pascal) sense, as the prologue will ACCVIO when it attempts to copy the argument values to stack temporaries (exactly what you're seeing).

 

This will be necessary for arguments EVENT_TYPE, CONN_HANDLE, DATA_LEN, P5 and P6.

 

The DATA_BFR and P7 arguments are NOT CLASS_S descriptors, they're just pointers to text.

 

Let me know if you have trouble making this work. I'll have a stab at a Pascal declaration.

A crucible of informative mistakes