[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

847.0. "QUERY: Size of MCC_A_AES / mcc_desframe_create_descriptor" by COOKIE::KITTELL (Richard - Architected Info Mgmt) Wed Mar 27 1991 13:21

MCC V1.1 SSB

The sizeof (MCC_A_AES) is 4 (its a unsigned long int *)

But when I call mcc_desframe_create_descriptor and give it a datatype of
MCC_K_DT_FULL_ENTITY and a size of 4, it creates a descriptor with
mcc_w_maxstrlen and mcc_w_curlen of 36.

I can't say for sure, but I think in previous versions it used the supplied
4 byte size. I don't remember mcc_desframe_create_descriptor ever allocating
a buffer of a different size than what I asked for.

What's up?
T.RTitleUserPersonal
Name
DateLines
847.1You've stumbled upon a well-known bug in ILV/AESTOOK::GUERTINI do this for a living -- reallyWed Mar 27 1991 14:5131
    RE:.0
    
    Yes, Richard it is a bug.  But it's an MCC bug not a mcc_desframe bug.
    Whenever you encode or decode an AES to/from ILV, it expects the
    mcc_a_pointer field in the descriptor to point to the actual Abstract
    Entity Specification structure itself, not an address of the AES
    (single pointer instead of double pointer).  This results in many
    "interesting" side-effects.  Since the only way to do anything with an
    AES is by calling the AES routines, and the AES routines *always* pass
    the AES's around as double pointers, the only way to use the
    descriptors is to pass in the address of the mcc_a_pointer field in the
    descriptor.  This means that the descriptor class wrong no matter what
    you place in it.  (If you put CLASS_D, its wrong because it was not
    allocated using the O.S. specific string allocation routines, if you
    put in CLASS_S, its wrong because it is not "your" static/stack
    memory). Also, the length of the buffer being pointed to by the
    mcc_a_pointer field is the length of something abstract (the length may
    change from one release to another).  This bug has caused us so many
    headaches that we even gave it its own name.  We call it the "AES
    double-pointer bug".  We have hard-coded "patches" to minimize the
    visibility of this bug (if dt = local/full entity then ignore
    descriptor class, etc.).  You really only notice it when you call
    mcc_ilv_get() and mcc_ilv_put() for a datatype of Local Entity and Full
    Entity.  Remember, whenever you call mcc_ilv_get for a Local/Full
    Entity you MUST call mcc_aes_delete( &your_descriptor->mcc_a_pointer ). 
    Otherwise, you have a memory leak.
    
    My opinion: mcc_desframe_create_descriptor is doing you a favor by
    hiding the actual length of the AES.
    
    -Matt.
847.2COOKIE::KITTELLRichard - Architected Info MgmtWed Mar 27 1991 15:079
RE: .1

Thanks Matt, that matches what I've been able to figure out about moving
AES values in and out of ILV. I've actually had that working for a while.

The change caused a bunch of "did I get what I asked for?" consistency
checks to fail. I'll skip them for AES types.