[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

162.0. "This looks like a BUG..." by SMAUG::BELANGER (Quality is not a mistake!) Fri Jun 29 1990 16:43

    
    	I have a prototype AM, which builds an OUT_P with 3 or 4 primitive
    MCC data types followed by a very long contructor data type (255 - 8
    byte Latin1Strings).  When building this OUT_P, I get returned, on a
    call to MCC$ILV_PUT, the error MCC$_ILVTOOBIG (No more room in buffer
    for additional values).  What I need to do is allocate a larger OUT_P.
    Following the SRM (page 307 - about 2/3 the way down the page):
    
    	If the buffer allocated by the client is of insufficient size
    	to contain the output data of the service provider, the service
    	provider must examine the class of the MCC DESCRIPTOR string
    	descriptor.  If the class is dynamic, the service provider will
    	return, to the heap, the buffer pointed to by the descriptor.
    	It will then allocate a new buffer, of adequate size, from the
    	dynamic heap, updating the descriptor to match.  It will then
    	use the new buffer to contain its output data.  If the class of
    	the descriptor is static, the service provider is unable to
    	correct the situation itself.  It will then return with an error
    	status of MCC$_INSUF_BUF, with the necessary buffer size in the
    	'w_curlen' field of the MCC DESCRIPTOR string descriptor.
    
    Looking under the description for MCC$_INSUF_BUF (page 312 of the SRM):
    
    	o MCC$_INSUF_BUF - Statically allocated OUT_P buffer too small
    
    	  Severity - Error.
    	  Source   - Service Provider or Information Manager.
    	  Reason   - The service provider needs a larger OUT_P buffer
    		to pass a reply back to the client.
    	  Action   - No output parameters are valid.  The client can
    		either allocate a larger buffer for the statically
    		allocated OUT_P parameter, or cancel the MCC$CALL
    		request.  It can only do this if the service provider
    		has set its HANDLE state to "MORE".
    	  Handle More - The service provider should set its HANDLE to
    		a state of "MORE" to permit the client to correct the
    		situation.  Otherwise, the MCC$CALL request is considered
    		completed by the service provider.
    
    When I detect that I need a larger buffer, I save my context, set
    'w_curlen' to 4096 (this is the larges buffer I should need - worst
    case), set my handle to MORE and return a CRV of MCC$_INSUF_BUF.  When
    I get called back, the buffer pointed to in OUT_P has changed but the
    'w_maxstrlen' has not.  Below is an extract of a dump of OUT_P at
    various stages:
    
    1) When my show entry is first called:
    
    	DBG> ex *out_p
    	*MCC$PROTO_AM_SVC_ENTRY\MCC__PROTO_AM_SHOW\out_p
    	    mcc$w_maxstrlen:    1024
    	    mcc$b_dtype:        14
    	    mcc$b_class:        1
    	    mcc$a_pointer:      1432864
    	    mcc$w_curlen:       0
    	    mcc$b_flags:        0
    	    mcc$b_ver:  1
    	    mcc$l_id:   0
    	    mcc$l_dt:   127
    	    mcc$a_link: 0
    
    2) Just before returning a CRV of MCC$_INSUF_BUF:
    
    	DBG> ex *out_p
    	*MCC$PROTO_AM_SVC_ENTRY\MCC__PROTO_AM_SHOW\out_p
    	    mcc$w_maxstrlen:    1024
    	    mcc$b_dtype:        14
    	    mcc$b_class:        1
    	    mcc$a_pointer:      1432864
    	    mcc$w_curlen:       4096
    	    mcc$b_flags:        0
    	    mcc$b_ver:  1
    	    mcc$l_id:   1
    	    mcc$l_dt:   127
    	    mcc$a_link: 0
    
    3) Just after being called back (with a handle of MORE):
    
    	DBG> ex *out_p
    	*MCC$PROTO_AM_SVC_ENTRY\MCC__PROTO_AM_SHOW\out_p
    	    mcc$w_maxstrlen:    1024
    	    mcc$b_dtype:        14
    	    mcc$b_class:        1
    	    mcc$a_pointer:      1436000
    	    mcc$w_curlen:       4096
    	    mcc$b_flags:        0
    	    mcc$b_ver:  1
    	    mcc$l_id:   1
    	    mcc$l_dt:   127
    	    mcc$a_link: 0
    
    4) At this point I still get returned a status of MCC$_ILVTOOBIG,  So I
       attempt to get a larger buffer (1024 larger than the previous
       request).  I think I get the status MCC_ILVTOOBIG because even
       though I got a pointer to a new (and supposedly a larger) buffer the
       'w_maxstrlen' field was not updated.  At this point I TRM seems to
       get a fatal error.
    
    	DBG> ex *out_p
	*MCC$PROTO_AM_SVC_ENTRY\MCC__PROTO_AM_SHOW\out_p
	    mcc$w_maxstrlen:    1024
	    mcc$b_dtype:        14
	    mcc$b_class:        1
	    mcc$a_pointer:      1436000
	    mcc$w_curlen:       5120
	    mcc$b_flags:        0
	    mcc$b_ver:  1
	    mcc$l_id:   1
	    mcc$l_dt:   127
	    mcc$a_link: 0
    
    	DBG> Go
	%MCC-E-ALLOC, C allocation error
	%MCC-F-TRM_FAILURE, Fatal MCC Error
	%DEBUG-I-EXITSTATUS, is '%MCC-F-TRM_FAILURE, Fatal MCC Error'
    
    After dumping all this information I have collect on you (the MCC
    development community), is this something wrong in MCC or is there
    something I should be doing (other than not building ILV constructions
    with so many elements)?  Your help would be greatly appricitated.
    
    Jon. Belanger
T.RTitleUserPersonal
Name
DateLines
162.1known bug in FCL. QAR 995 in MCC_DEV database. will be fixed in EFT update kitTOOK::DITMARSPeteSat Jun 30 1990 18:3716
>    After dumping all this information I have collect on you (the MCC
>    development community), is this something wrong in MCC or is there
>    something I should be doing (other than not building ILV constructions
>    with so many elements)?  Your help would be greatly appricitated.
 
There is a bug in the FCL.  We're not setting the mcc$w_maxstrlen field
in the descriptor when calling you back after receiving the MCC_S_INSUF_BUF 
error.  

This will be fixed in the EFT update kit.

Thanks for the excellent problem report.

regards,

Pete
162.2The wall behind the wall behind the...SMAUG::BELANGERQuality is not a mistake!Mon Jul 02 1990 16:1313
    Thanks for you quick response.
    
    	I updated my code to set mcc$w_maxstrlen to the appropriate value
    and now I'm able to build the 255 member set and dump OUT_P using
    MCC$ILV_DUMP but I get the error:
    
    	%MCC-E-ILV_BADLISTTUPL, Bad list tuple
    
    from FCL (alias TRM).  My code does the same thing as the SRM
    recommends.  Is this my problem (if so, how can I track this down) or
    is it a problem with MCC (or FCL)?
    
    ~Jon.
162.3not much help... but remember that mcc$w_maxstrlen is read-onlyTOOK::DITMARSPeteMon Jul 02 1990 20:4812
I don't have the answer for your BADLISTTUPL question.  FCL doesn't generate
the error itself; it must be coming back from an ILV routine.  That makes me
suspect your building or our decoding of the list.  But I don't know which to
suspect more at this point.

As far as tracking it down further, start by turning on the ILV dump and making
sure that what FCL is seeing is what you're intending to build.  Then check
to make sure that what you're intending to build is valid stuff.

One thing I did want to make sure that we're clear on is that your setting of 
the mcc$w_maxstrlen field is a work-around, not a permanent fix.  That field 
should be read-only for you.
162.4A guess about the BAD LIST TUPLETOOK::KOHLSRuth KohlsThu Jul 05 1990 10:5622
re: .2

>    	%MCC-E-ILV_BADLISTTUPL, Bad list tuple
>    

Do you have the SRM update #1 (see note 166 or thereabouts) and are you
using ILV MODE according to those directions?  Check that you are using
MCC_K_ILV_LIST_VALUE mode correctly, and that your .MS matches your
encoding.  I suspect that you are encoding your constructor datatype
in MCC_K_ILV_NATIVE_VALUE mode and sending it back in a Response whose 
arguments are specifed as datatype ATTRIB_LIST in the dictionary 
(which is built from your .MS).  This could cause FCL (TRM), which is
using the dictionary to decode your buffer, to try to read the contents of 
the buffer in the wrong mode.


I can't guess more without seeing at least the .ms, and a dump of the encoding.
If I missed my guess above, please contact me by mail.


Ruth Kohls
(TOOK::KOHLS)
162.5more infoSMAUG::BELANGERQuality is not a mistake!Fri Jul 06 1990 14:2722
    
    Hi Ruth,
    
    	I reran my AM with the logging enabled and output going to a file.
    When I look at the file I get the error:
    
    	%MCC-E-ILVSYNTAXERROR,  the ASN.1 value's data type conflicts
    				with supplied type
    
    This leads me to suspect you are correct.  I do have the update and
    programmed my code like the example in the book.  The AM I wrote is
    extremely similar to the SAMPLE AM.  It still uses ILV_PUT_LIST for
    most of the parameters and ILV_PUT for a SET OF LATIN1STRING
    construction.  Everything worked fine until I created the construction. 
    I'm not sure which data type is not liked.  Everything works fine when
    I ask to see any part of the data (ie: a specific attribute within the
    STATUS attribute group).  If I ask to see all of the STATUS attributes,
    I get errors.  I'm not sure what is expected or if mixing ILV_PUT_LIST
    with ILV_PUT is causing problems.  Any help would be grealy
    appreciated.
    
    ~Jon.
162.6ILV HINTS and KINKSTOOK::KOHLSRuth KohlsWed Jul 11 1990 12:3281
re: .-1

>    I get errors.  I'm not sure what is expected or if mixing ILV_PUT_LIST
>    with ILV_PUT is causing problems.  

Mixing ILV_LIST_PUT... encoding with ILV MODE decoding is the root of this 
problem.  In the future, tell me the version (from SHOW MCC  0 all char)
of the kernel you are having problems with.
(The rest of this reply will be appearing in several places.)


Ruth
			**** WARNING *****

in the EFT Update, UT1.0.1, ILV_LIST_... (except for ILV_LIST_GET_DATATYPE)
 ARE GONE.  You WILL see ACCVIOS if you still use these calls.

			***** WARNING 2 *****

in the EFT UPdate, the OLD ILV calls (without MODE) are NOT permitted, and
there IS NO ERROR MESSAGE.  (There is no truly portable way to count the
arguments passed to a C function.)  

USE THE ILV routines with MODE, as documented in the SRM UPdate or ECO #37.

			INTERPRETATION:

for the calls ILV_PUT_CONS_BEGIN( Context, IDcode, datatype, reason, mode)

	     ILV_PUT(Context, Valuedescriptor, reason)

		ILV_GET_CONS_BEGIN( Context, Reason, Mode)

	     ILV_GET(Context, Valuedescriptor, reason)


	 where you are currently in mode = MCC_K_ILV_NATIVE_VALUE, pass
unneeded parameters (datatype, reason) as 0 by value.  Since 0 is
a valid reasoncode (MCC_K_REASN_SUCC_OP) and a valid datatype code (null),
this convention allows ILV to do _some_ error checking.  

 a call to open a construction for encoding in LIST MODE when the current 
mode is NATIVE looks like:

nocode = 0;
	
status = mcc_ilv_put_cons_begin( &Ctx, &Id, nocode,
			nocode, &MCC_K_ILV_LIST_VALUE).

	    where you are currently in mode = MCC_K_ILV_LIST_VALUE, pass
all parameters by reference (this call would open a LIST mode 
construction inside a list mode construction):

status = mcc_ilv_put_cons_begin( &Ctx, &Id, &inputdatatype,
			&inputreasoncode, &MCC_K_ILV_LIST_VALUE).


		HINTS and SUGGESTIONS:

o PUT_PARAM_BEGIN puts you in NATIVE mode.

o Don't forget to Close constructions or use PUT_PARAM_END.

o Reads are non-destructive--you can always back up and start over.
o Get_Id always gets the next id, and may pop out of a construction.
o Fnd_ID always locates the first copy of an idcode at the current nesting 
  level.

o Make sure the descriptors are initialized!  
o ILV uses Static Descriptor conventions with "constructed" entity specs as 
  the only exception.
o the mcc_b_flags field of a Value Descriptor should be 0 except if you
  are encoding an IMPLEMENTATION DEFAULT.  
o The mcc_b_ver field Must be 1 for now (Use the symbol defined in 
  mcc_interface_def for descriptor version)

o Use the symbols for MCC_K_ILV_LIST_VALUE and MCC_K_ILV_NATIVE_VALUE,
  the reason codes and the datatype codes (look in ch9 of the SRM). 
  The value of these symbols, like any symbol, may change.