[omniORB] extracting struct containing objref from any throws exception

CHRISTOPHER WOOD chrisw@cs.uwa.edu.au
Mon, 10 Aug 1998 11:41:18 +0800 (WST)


I'm having trouble transmitting a struct containing an any which contains
a further struct which contains an object reference. 

strangeley enough the error only occours once the containing structure is
transmitted over the network. If the struct is inserted into the any and
immediatley removed no exception is thrown.

unfortunatly i cannot trace the code further due to gdb being unable to
trace multithreaded code, although i've tried almost every exception type
listed in the CORBA documentation without 


the IDL:

  struct SearchData {
    any datSearchParms;
    any datPopParms;
  };

  interface CreateInfo {
    readonly attribute boolean aLocalLock;
    readonly attribute SearchMaster aMaster;
    readonly attribute Key aSearchType;
    readonly attribute SearchData aSearchData;
    MemberData GenMember(in any memberKey);
    void remove();
  };

in another module:

  struct LongRange {
    long min;
    long max;
    unsigned long gran;
  };

  struct PopParms {
    LongRange rngPopSize;

	... lots of other range members...

    CreateInfo pChildCreateInfo;
  };



the server side c++ code:

SearchData* SearchMaster::aSearchData() {
	SearchData* pSearchData = new SearchData;
	pSearchData->datSearchParms <<= sp;
	pSearchData->datPopParms <<= pp;

	// here pp and sp are preinitialized structures (not pointers to,
	// although changing them makes no difference)
	return pSearchData;
}

client side:
bool SearchGenetic_i<T>::CreateFrom(CreateInfo_ptr pCreateInfo) {
	SearchData_var pSearchData = pCreateInfo->aSearchData();
	SearchParms* lsp;
	if(pSearchData->datSearchParms >>= lsp)
		sp = *lsp;
	else
		DefaultInit(sp);
	// the above gets through fine but:
	PopParms* lpp;
	if(pSearchData->datSearchParms >>= lsp) // <-- system exception
						//     thrown here
		pp = *lpp;
	else
		DefaultInit(pp);

	...
}