[omniORB] Sequence problem when upgrading omniORB

Anders Werholt anders at werholt.se
Fri May 12 10:45:38 BST 2006


Hi

I have some problems trying to upgrade an old omniOrb 2.7.1 project (VC++6) to omniORB 4.0.7 (VC++7).
Some functions are working, others are not.
Func1 below is working (returns a sequence of short).
Func2 below is not working as it did before (returns a sequence of a complex struct). The client gets the result, but at the same time the server crashes with the following error:
HEAP[xxx.exe]: Invalid Address specified to RtlValidateHeap( 003C0000, 0052BA30 )
Unhandled exception at 0x7c901230 in xxx.exe: User breakpoint.

The error occurs after my code has returned, somewhere in the Corba code.

The only difference as I see it is that the out parameter is more complex in the functions that not works.
All fields in the struct are initialized.
What am I missing? Any ideas?


tRetcode xxx_i::Func1(const tTransId & TransIDRequest, tProviderList_out provider)
{
 tProviderList *providerT = new tProviderList;

 providerT->provider.length(1);
 short *prov = &(providerT->provider.operator[](0));
 *prov = atoi(g_sTopLevelRegionId);

 provider = providerT;

 return API_OK;
}


tRetcode xxx_i::Func2(const tTransId & TransIDRequest, tTransitionList_out transitions)
{
 tTransitionList *transitionsT = new tTransitionList;
 //transitionsT->transition.length(0)
 
 char sTemp[20];
 long lAllTrans;

 lAllTrans = vTPEus.size();

 transitionsT->transition.length(lAllTrans);

 for (long i=0; i< lAllTrans; i++) {
  tTransition *trans= &(transitionsT->transition.operator[](i));

  trans->importance = 0; //
   
  trans->entry.key.key.providerCode = 0;
  trans->entry.key.key.key = CORBA::string_dup(_ltoa(vTPEus[i], sTemp,10));
  
  trans->entry.key.type = INPUT_STOP;

  trans->entry.key.name = CORBA::string_dup(vTPName[i].c_str());

  trans->entry.key.location.topLevelRegion = CORBA::string_dup("");
  trans->entry.key.location.topLevelRegionId = CORBA::string_dup("");
  trans->entry.key.location.type = 0;
  trans->entry.key.location.name = CORBA::string_dup("");
  trans->entry.key.location.region = CORBA::string_dup("");
  trans->entry.key.location.regionId = CORBA::string_dup("");
  trans->entry.key.location.zip = CORBA::string_dup("");
  trans->entry.key.location.houseno = CORBA::string_dup("");

  //coordinates
  long lXcoord = vTPXcoord[i];
  long lYcoord = vTPYcoord[i];
  trans->entry.key.location.coord.xcoord = lXcoord;
  trans->entry.key.location.coord.ycoord = lYcoord;
  trans->entry.key.location.coord.zcoord = 0;
  trans->entry.key.location.coord.precision = -1; //unknown

  trans->entry.key.side.length(0); //

  //duration, legs, wait
  trans->entry.duration = -1;
  trans->entry.legs = -1;
  trans->entry.wait = vTPComp[i];
 }

 transitions = transitionsT;
 
 return API_OK;
}


Best regards
Anders Werholt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20060512/5bbf10fe/attachment.htm


More information about the omniORB-list mailing list