[omniORB] Event producer/consumer app crash

Sai-Lai Lo s.lo@uk.research.att.com
Wed, 30 May 2001 10:34:26 -0000


This is a multi-part message in MIME format.

------=_NextPart_000_005F_01C0E8F4.19521D50
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

----- Original Message -----
From: "Rowe, Simon" <srowe@adaptivebroadband.com>
To: <omniorb-list@uk.research.att.com>
Sent: Wednesday, May 30, 2001 7:23 AM
Subject: RE: [omniORB] Event producer/consumer app crash


> > There is one bug in the typecode implementation that is
> > related to alias
> > expansion,
> > it has an effect if the typecode is a sequence or struct or something
> > complex that
> > contains an object reference. I've backported the fix from omniORB 3
> > together
> > with another fix that is related to complex recursive typecodes.
> >
> > I am not sure any of these bugs is the cause of your problem.
> >  I suppose it
> > is worth
> > giving it a try. Otherwise, one may have to look into alias
> > expansion in
> > more detail.
>
> I took the latest snapshot and built it.
>
> Initially things looked promising but it fell over last night, again in
the
> typecode expansion. Is there some tracing I can turn on to help identify
> where the problem is?

This could be a race condition or simply a bug in alias expansion. Please
try this patch
and tell me the result. If it still crashes please keep the core file, I
need to know the stack trace and what is the typecode that is causing the
crash.

The patch simply creates the alias expanded typecode at the moment the
typecode is created, either through the stub global initialisers or the
typecode unmarshalling functions.
With this patch we know there is no concurrent threads trying to do alias
expansion on the same typecode at the same time.

Please apply the patch to <top>/src/lib/omniORB2/dynamic/typecode.cc



Sai-Lai





------=_NextPart_000_005F_01C0E8F4.19521D50
Content-Type: application/octet-stream;
	name="typecode.cc.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="typecode.cc.diff"

*** typecode.cc.old	Wed May 30 10:14:29 2001=0A=
--- typecode.cc	Wed May 30 10:33:09 2001=0A=
***************=0A=
*** 339,344 ****=0A=
--- 339,347 ----=0A=
    TypeCode_base* tc =3D TypeCode_marshaller::unmarshal(s, &otbl);=0A=
    TypeCode_collector::markLoopMembers(tc);=0A=
  =0A=
+   // XXX Make sure pd_aliasExpandedTc contains a valid expanded alias.=0A=
+   CORBA::TypeCode_var expandedtc =3D TypeCode_base::aliasExpand(tc);=0A=
+ =0A=
    return tc;=0A=
  }=0A=
  =0A=
***************=0A=
*** 360,365 ****=0A=
--- 363,371 ----=0A=
    TypeCode_base* tc =3D TypeCode_marshaller::unmarshal(s, &otbl);=0A=
    TypeCode_collector::markLoopMembers(tc);=0A=
  =0A=
+   // XXX Make sure pd_aliasExpandedTc contains a valid expanded alias.=0A=
+   CORBA::TypeCode_var expandedtc =3D TypeCode_base::aliasExpand(tc);=0A=
+ =0A=
    return tc;=0A=
  }=0A=
  =0A=
***************=0A=
*** 507,514 ****=0A=
      new_members[i].type =3D members[i].type;=0A=
    }=0A=
  =0A=
!   return new TypeCode_struct(CORBA::string_dup(id), =
CORBA::string_dup(name),=0A=
! 			     new_members, memberCount);=0A=
  }=0A=
  =0A=
  =0A=
--- 513,526 ----=0A=
      new_members[i].type =3D members[i].type;=0A=
    }=0A=
  =0A=
!   TypeCode_base* tc =3D  new TypeCode_struct(CORBA::string_dup(id),=0A=
! 					   CORBA::string_dup(name),=0A=
! 					   new_members, memberCount);=0A=
! =0A=
!   // XXX Make sure pd_aliasExpandedTc contains a valid expanded alias.=0A=
!   CORBA::TypeCode_var expandedtc =3D TypeCode_base::aliasExpand(tc);=0A=
! =0A=
!   return tc;=0A=
  }=0A=
  =0A=
  =0A=
***************=0A=
*** 520,527 ****=0A=
  {=0A=
    check_static_data_is_initialised();=0A=
  =0A=
!   return new TypeCode_union(id, name, ToTcBase(discriminator_type),=0A=
! 			    members, memberCount, deflt);=0A=
  }=0A=
  =0A=
  =0A=
--- 532,546 ----=0A=
  {=0A=
    check_static_data_is_initialised();=0A=
  =0A=
!   TypeCode_base* tc =3D  new TypeCode_union(id, name,=0A=
! 					  ToTcBase(discriminator_type),=0A=
! 					  members, memberCount, deflt);=0A=
! =0A=
!   // XXX Make sure pd_aliasExpandedTc contains a valid expanded alias.=0A=
!   CORBA::TypeCode_var expandedtc =3D TypeCode_base::aliasExpand(tc);=0A=
! =0A=
!   return tc;=0A=
! =0A=
  }=0A=
  =0A=
  =0A=
***************=0A=
*** 537,543 ****=0A=
    for( ULong i =3D 0; i < memberCount; i++ )=0A=
      memberSeq[i] =3D members[i];=0A=
  =0A=
!   return NP_enum_tc(id, name, memberSeq);=0A=
  }=0A=
  =0A=
  =0A=
--- 556,567 ----=0A=
    for( ULong i =3D 0; i < memberCount; i++ )=0A=
      memberSeq[i] =3D members[i];=0A=
  =0A=
!   TypeCode_base* tc =3D new TypeCode_enum(id, name, memberSeq);=0A=
! =0A=
!   // XXX Make sure pd_aliasExpandedTc contains a valid expanded alias.=0A=
!   CORBA::TypeCode_var expandedtc =3D TypeCode_base::aliasExpand(tc);=0A=
! =0A=
!   return tc;=0A=
  }=0A=
  =0A=
  =0A=
***************=0A=
*** 546,552 ****=0A=
  			     CORBA::TypeCode_ptr original_type)=0A=
  {=0A=
    check_static_data_is_initialised();=0A=
!   return new TypeCode_alias(id, name, ToTcBase(original_type));=0A=
  }=0A=
  =0A=
  =0A=
--- 570,582 ----=0A=
  			     CORBA::TypeCode_ptr original_type)=0A=
  {=0A=
    check_static_data_is_initialised();=0A=
! =0A=
!   TypeCode_base* tc =3D new TypeCode_alias(id, name, =
ToTcBase(original_type));=0A=
! =0A=
!   // XXX Make sure pd_aliasExpandedTc contains a valid expanded alias.=0A=
!   CORBA::TypeCode_var expandedtc =3D TypeCode_base::aliasExpand(tc);=0A=
! =0A=
!   return tc;=0A=
  }=0A=
  =0A=
  =0A=
***************=0A=
*** 566,573 ****=0A=
      new_members[i].type =3D members[i].type;=0A=
    }=0A=
  =0A=
!   return new TypeCode_except(CORBA::string_dup(id), =
CORBA::string_dup(name),=0A=
! 			     new_members, memberCount);=0A=
  }=0A=
  =0A=
  =0A=
--- 596,609 ----=0A=
      new_members[i].type =3D members[i].type;=0A=
    }=0A=
  =0A=
!   TypeCode_base* tc =3D new TypeCode_except(CORBA::string_dup(id),=0A=
! 					  CORBA::string_dup(name),=0A=
! 					  new_members, memberCount);=0A=
! =0A=
!   // XXX Make sure pd_aliasExpandedTc contains a valid expanded alias.=0A=
!   CORBA::TypeCode_var expandedtc =3D TypeCode_base::aliasExpand(tc);=0A=
! =0A=
!   return tc;=0A=
  }=0A=
  =0A=
  =0A=
***************=0A=
*** 575,581 ****=0A=
  CORBA::TypeCode::PR_interface_tc(const char* id, const char* name)=0A=
  {=0A=
    check_static_data_is_initialised();=0A=
!   return new TypeCode_objref(id, name);=0A=
  }=0A=
  =0A=
  =0A=
--- 611,622 ----=0A=
  CORBA::TypeCode::PR_interface_tc(const char* id, const char* name)=0A=
  {=0A=
    check_static_data_is_initialised();=0A=
!   TypeCode_base* tc =3D new TypeCode_objref(id, name);=0A=
! =0A=
!   // XXX Make sure pd_aliasExpandedTc contains a valid expanded alias.=0A=
!   CORBA::TypeCode_var expandedtc =3D TypeCode_base::aliasExpand(tc);=0A=
! =0A=
!   return tc;=0A=
  }=0A=
  =0A=
  =0A=
***************=0A=
*** 584,590 ****=0A=
  {=0A=
    if( bound =3D=3D 0 )  return PR_string_tc();=0A=
    check_static_data_is_initialised();=0A=
!   return new TypeCode_string(bound);=0A=
  }=0A=
  =0A=
  =0A=
--- 625,636 ----=0A=
  {=0A=
    if( bound =3D=3D 0 )  return PR_string_tc();=0A=
    check_static_data_is_initialised();=0A=
!   TypeCode_base* tc =3D  new TypeCode_string(bound);=0A=
! =0A=
!   // XXX Make sure pd_aliasExpandedTc contains a valid expanded alias.=0A=
!   CORBA::TypeCode_var expandedtc =3D TypeCode_base::aliasExpand(tc);=0A=
! =0A=
!   return tc;=0A=
  }=0A=
  =0A=
  =0A=
***************=0A=
*** 593,599 ****=0A=
  				CORBA::TypeCode_ptr element_type)=0A=
  {=0A=
    check_static_data_is_initialised();=0A=
!   return new TypeCode_sequence(bound, ToTcBase(element_type));=0A=
  }=0A=
  =0A=
  =0A=
--- 639,650 ----=0A=
  				CORBA::TypeCode_ptr element_type)=0A=
  {=0A=
    check_static_data_is_initialised();=0A=
!   TypeCode_base* tc =3D new TypeCode_sequence(bound, =
ToTcBase(element_type));=0A=
! =0A=
!   // XXX Make sure pd_aliasExpandedTc contains a valid expanded alias.=0A=
!   CORBA::TypeCode_var expandedtc =3D TypeCode_base::aliasExpand(tc);=0A=
! =0A=
!   return tc;=0A=
  }=0A=
  =0A=
  =0A=
***************=0A=
*** 602,608 ****=0A=
  		       CORBA::TypeCode_ptr element_type)=0A=
  {=0A=
    check_static_data_is_initialised();=0A=
!   return new TypeCode_array(length, ToTcBase(element_type));=0A=
  }=0A=
  =0A=
  =0A=
--- 653,664 ----=0A=
  		       CORBA::TypeCode_ptr element_type)=0A=
  {=0A=
    check_static_data_is_initialised();=0A=
!   TypeCode_base* tc =3D new TypeCode_array(length, =
ToTcBase(element_type));=0A=
! =0A=
!   // XXX Make sure pd_aliasExpandedTc contains a valid expanded alias.=0A=
!   CORBA::TypeCode_var expandedtc =3D TypeCode_base::aliasExpand(tc);=0A=
! =0A=
!   return tc;=0A=
  }=0A=
  =0A=
  =0A=
***************=0A=
*** 611,617 ****=0A=
  					  CORBA::ULong offset)=0A=
  {=0A=
    check_static_data_is_initialised();=0A=
!   return new TypeCode_sequence(bound, offset);=0A=
  }=0A=
  =0A=
  =0A=
--- 667,678 ----=0A=
  					  CORBA::ULong offset)=0A=
  {=0A=
    check_static_data_is_initialised();=0A=
!   TypeCode_base* tc =3D  new TypeCode_sequence(bound, offset);=0A=
! =0A=
!   // XXX Make sure pd_aliasExpandedTc contains a valid expanded alias.=0A=
!   CORBA::TypeCode_var expandedtc =3D TypeCode_base::aliasExpand(tc);=0A=
! =0A=
!   return tc;=0A=
  }=0A=
  =0A=
  =0A=

------=_NextPart_000_005F_01C0E8F4.19521D50--