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

Conference azur::mcc

Title:DECmcc user notes file. Does not replace IPMT.
Notice:Use IPMT for problems. Newsletter location in note 6187
Moderator:TAEC::BEROUD
Created:Mon Aug 21 1989
Last Modified:Wed Jun 04 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:6497
Total number of notes:27359

2253.0. "MCC_S_MIR_INIT_FAIL with mcc_mir_get_repository_id() ..." by UTES09::GOES (Paul Goes - T&N Digital Utrecht) Mon Feb 03 1992 11:55

Hi, we're trying to upgrade a private AM from version v1.1 to T1.2.4 but
we are facing some problems.

If we run our code and try to create an entity instance a gigantic stackdump
scrolls on the screen.

We found out that a call to mcc_mir_get_repository_id() causes this problem.

We create a descriptor for the repository in the following way:

>     /* create descriptor for private instance repository name */
>
>     strcpy(pabx_inst_rep_name,"MCC_PABX_PRIV_INST_MIR");
>     pabx_inst_rep_name_dsc.mcc_a_pointer=pabx_inst_rep_name;
>     pabx_inst_rep_name_dsc.mcc_w_curlen=strlen(pabx_inst_rep_name);
>
>     /* check if private instance repository already exists */
>     /* if status == MCC_S_NOREPOSEXIST repository does not exist */
>
>     if(status == MCC_S_NORMAL)
>        status = mcc_mir_get_repository_id(
>			    &pabx_inst_rep_name_dsc, 
>			    &pabx_inst_rep_id,
>			    &MCC_K_NULL_PTR);
>

When the mcc_mir_get_repository_id() call is being processed the following
messages scroll over the screen:

> %MCC-W-REPOSNOATTR, repository ID 4 is missing attributes, attempting recovery
> %TRACE-W-TRACEBAMCC_S_MIR_INIT_FAILCK, symbolic stack dump follows
> module name     routine name                     line       rel PC    abs PC
>
>                                                            000D529C  000D529C
>                                                            0007E64A  0007E64A
>                                                            0008DF91  0008DF91
>                 >>> +/- 20 lines deleted <<<
>                                                            001C4584  001C4584
>                                                            000C6E9A  000C6E9A
> MCC_MAIN        main                             8258      00000208  00001E3C
>                                                            000056F7  000056F7
> MCC_KERNEL_INIT MCC_KERNEL_INITIALIZE             163      00000027  0000572B
>                                                            000056D2  000056D2

This is repeated for repository ID 4 to repository ID 15

The call to mcc_mir_get_repository_id() returns with the status:

             MCC_S_MIR_INIT_FAIL       52880764

This code is handled by the AM and is displayed by the FCL PM as:

> An error occurred while encoding the PABX package.
>                          Internal Error = %MCC-F-MIR_INIT_FAIL, the MIR could
>                                           not be initialized

This code worked fine for v1.1 but causes this problems for version T1.2.4.


What does MCC_S_MIR_INIT_FAIL mean ???
What can be the cause of this problem and how can this problem be solved ???


Another strange behavior of the FCL PM is:

If we define MCC_FCL_PM_LOG 8 it will display the call parameter contents:

>  MCC> create pabx .pabx_utrecht lat port name = lta203
>
>  *****************************************************
>  *     FCL PM Arguments before call_function:        *
>  *****************************************************
>
>  VERB code:      12
>  PARTITION code: 10
>  AES dump of ENTITY IN:
>
>  Depth=0  Class = 59 Instance = UTES09_NS:.pabx_utrecht Id = 1 Dt = 5
>
>
>  ILV dump of IN_P:
>
>  [  0 ] (
>      [  1 ]     6c 74 61 32 30 33  -- lta203
>      )
>  ILV dump of IN_Q: in_q is NULL
>  TIME SPEC is: 0, NOW

etc. etc. etc.

The display format for the Instance within the AES dump of ENTITY IN is 
much better than the format in v1.1. But why does it display an >DEPTH<
of > 0 < (ZERO !!!!). Is this the level (starts counting with zero for the
global entity) or is this a bug ?


T.RTitleUserPersonal
Name
DateLines
2253.1Something is definitely out of synchTOOK::GUERTINDon't fight fire with flamesMon Feb 03 1992 16:1622
    The error messages you are getting are consistent with having the two
    MIR master repository files out of synch with each other.  If you look
    in MCC_SYSTEM: for MCC_MIR_DIRECTORY.DAT and MCC_MIR_ATTRIBUTE.DAT you
    will probably see the two files have different creation dates, and
    perhaps even different version numbers (God forbid they should be in
    two different directories!).  Even if they do not, chances are that
    something happened to one or both of the files.  How the wrong file(s)
    got there is worth investigating.  However, for the short term, if you
    find the right pair of files they should be moved back.  If you cannot
    find the right pair, there are two options.  1) copy empty files from
    the developers kit, or restore them from the bms kit. 2) with the V1.1
    DAP, there was code which know how to clean up the MIR master
    repositories (by deleting the records which were inconsistent), you
    just had to run it and it would do validation as part of its startup.
    Re-populating empty MIR master repositories is usually very simple,
    most management modules which use them simply recreate the entries
    as part of their startup.  You may want to re-run the IVP to make sure
    that the repository entries are properly recreated.
    
    Let me know if this helps.
    
    -Matt.
2253.2Yes it helps !!!UTES09::GOESPaul Goes - T&amp;N Digital UtrechtTue Feb 04 1992 07:5115
2253.3It did work. But now I'm into another ACCVIOUTES09::GOESPaul Goes - T&amp;N Digital UtrechtWed Feb 05 1992 06:2597
It worked for a while but now I'm facing a real strange behavior of my code.

To explain, first a piece of stripped AM code:

do_directive()
{
   /* read contents of in_p */
   status = mcc_ilv_get_param_begin(...)

   /* find id_code */
   status = mcc_ilv_fnd_id(...)

   /* create descriptor for attribute */
   status = mcc_desframe_create_descriptor(...)

   /* get attribute with found id_code from in_p */
   status = mcc_ilv_get(...)

   /* create descriptor for private instance repository name */
   ....  /* see .0 */

   /* check if private instance repository exists */
   status = mcc_mir_get_repository_id(...)   /* see .0 */

   /* create repository if repository doesn't exist */
   if(status == MCC_S_NOREPOSEXIST)
      {
         /* create repository */
      }

   /* check if instance is in existing private instance repository */
   else
      {
         /* check for instance */
      }

printf("status = %d\n",status);

    /* instance doesn't exist */
    if(instance_exists == FALSE)
      {
	 /* create instance and generate success reply */
      }
     else
      {
         /* generate duplicate entry reply */
      }
}

This code with the printf() works just fine, but if I remove the (unnecessary)
printf() it generates an ACCVIO:

> %SYSTEM-F-ACCVIO, access violation, reason mask=01, virtual address=973C200E, PC
> =000E8AEC, PSL=03C00008
> %TRACE-F-TRACEBACK, symbolic stack dump follows
> module name     routine name                     line       rel PC    abs PC
> 
>                                                            000E8AEC  000E8AEC
>                 /* number of lines deleted */
>                                                            001C4584  001C4584
>                                                            000C6E9A  000C6E9A
> MCC_MAIN        main                             8258      00000208  00001E3C
>                                                            000056F7  000056F7
> MCC_KERNEL_INIT MCC_KERNEL_INITIALIZE             163      00000027  0000572B
>                                                            000056D2  000056D2

If I go into the debugger everything goes fine until I reach the mcc system 
routine mcc_mir_get_repository_id() then the debugger responds with the message:

> %DEBUG-I-DYNIMGSET,
 setting image MCC_KERNEL_SHR
> %DEBUG-I-DYNMODSET, setting module MIR_COMMON
> %SYSTEM-F-ACCVIO, access violation, reason mask=01, 
> virtual address=97200002, PC=000E8AEC, PSL=03C0000
> break on unhandled exception at MIR_COMMON\mir_desc_mcc_copy\%LINE 8725+8
>
> %DEBUG-W-SRCLINNOT, source lines not available for module MIR_COMMON

What does this all mean ?
For the other mcc system routines it displays the following messages:

> stepped to MCC_PABX__CREATE\do_directive\%LINE 9764
>   9764:      if(status == MCC_S_NORMAL)
> stepped to MCC_PABX__CREATE\do_directive\%LINE 9765
>   9765:           status = mcc_ilv_get(&ctx, char_attr_dsc, &MCC_K_NULL_PTR);
    and continue with next step !!!!

Can somebody help me ?? I'm just getting a little confused !

Regards, Paul Goes.








2253.4Try examining the descriptor before calling the routine which ACCVIOsTOOK::GUERTINDon't fight fire with flamesWed Feb 05 1992 09:104
    Are you sure ALL the fields in the descriptor are initialized
    correctly?
    
    -Matt.
2253.5No I'm not sure about the correctness of the descriptor fieldsUTES09::GOESPaul Goes - T&amp;N Digital UtrechtWed Feb 05 1992 10:1528
Before you placed reply .4 I found out that the descriptor did not contain
right values for all fields. This was caused by the way I created the
descriptor.

I declared the descriptor variable:

MCC_T_Descriptor              pabx_inst_rep_name_dsc;

and created the descriptor:

pabx_inst_rep_name_dsc.mcc_a_pointer = pointer_to_name_string;
pabx_inst_rep_name_dsc.mcc_w_curlen = strlen(pointer_to_name_string);

This does not initialize all fields in the right way, but in the 
SRM (still for DECmcc v1.1) it is stated that for the argument 
repository_name for the routine mcc_mir_get_repository_id( ) only
the mcc_w_curlen field and the mcc_a_pointer field are checked in
the descriptor. This is correct for v1.1 but not for t1.2.4 anymore.

Now I create the descriptor using the mcc_desframe_create_descriptor() routine.

It works fine now !!!

I hope it stays fine !?!

Thanks for your replies Matt !

Regards, Paul Goes
2253.6MIR example code in the Toolkit Example FM (v1.2)MOLAR::ROBERTSKeith Roberts - DECmcc Toolkit TeamWed Feb 05 1992 11:0045
  fwiw ...

  If you take a look at the Example FM (included with the DECmcc toolkit
  v1.2) -- there is a set of MIR routines which do all the 'dirty work'
  for you.

  The files to look at are:

	'mcc_example_fm_library.c'
  and	'mcc_example.h'.

  Examples for the use of these routines are throughout the rest of the 
  Example FM Source code.

  The routines have a simpler interface to the MIR and take care of the
  problems you have been describing regarding 'is the MIR already created'.

  Also, these routine perform all the ILV encoding and decoding for you
  transparently...providing you use the simple MCC datatypes.

  Please take a look at these - and use them if you like.  We would appreciate
  any feedback you may have.

  Keith Roberts
  DECmcc Toolkit Team


                    Example FM Library MIR routines

 *  exlib_mir_open                - Opens a connection to a MIR         *
 *  exlib_mir_create_instance     - Creates a MIR Instance              *
 *  exlib_mir_select_instance     - Selects an existing MIR Instance    *
 *  exlib_mir_put_attribute       - Puts an attribute in the MIR        *
 *  exlib_mir_get_attribute       - Gets an attribute from the MIR      *
 *  exlib_mir_set_attributes      - Process In-P & Update MIR Attrs     *
 *  exlib_mir_close               - Close the connection to the MIR     *
 *  exlib_mir_cancel              - Cancel the connection to the MIR    *
 *  exlib_mir_set_time_stamp   +  - Set Time Stamp for Write Attr data  *
 *  exlib_mir_set_time_range   +  - Set Time Range for Read Attr data   *
 *  exlib_mir_get_time_stamp   +  - Get the Attr record Time Stamp      *
 *  exlib_mir_next_time        +  - Get next Attr record for Time Range *
 *  exlib_mir_next_instance    +  - Get next Wildcarded Instance        *

                               +  These routines are only stubbed in 
2253.7Invalid MCC descriptorsMAVIC::D_MOOREThu Feb 13 1992 12:1525
  While it was not the intent, the SRM does imply in the description of the
  mcc_mir_get_repository_id routine that it is valid to send in a garbage
  descriptor with only the mcc_w_curlen and mcc_a_pointer fields set.  The
  intent was that only those two fields were validated by that routine.  In
  any case, the SRM will be QAR'ed on the basis that it implies that invalid
  descriptors are legal.

  It is ALWAYS illegal to pass an ill-formed MCC descriptor to a DECmcc routine.
  There are cases where fields are written by a kernel routine or where a field
  of the descriptor is completely irrelevant to a routine.  These cases should
  be documented in the description of that routine in the SRM.  As a general
  rule, all fields of a descriptor must be initialized.  A descriptor where the
  maxstrlen field is garbage and the curlen field is set will be valid only
  when the random data in the maxstrlen field is greater than or equal to the
  curlen field.  The maxstrlen field indicates how much memory is allocated for
  the buffer pointer to by the mcc_a_pointer field.  The curlen field tells
  how much data is currently in that buffer.  The curlen field alone does not
  provide enough information.

  In the case cited earlier, it is likely that a bogus mcc_l_dt field caused
  the problems.  The mcc_mir_get_repository_id routine uses (but does not
  validate) the mcc_l_dt field.

  								- Dave