Re: some fixes in ORBit2



On Tue, 9 Jan 2001, Dmitry Yusupov wrote:

> I found some bugs during hacking.
> First one got marshaling problem and G_BREAKPOINT arose for
> all ORBit2/test examples for me. I'm not sure. May be this one wrong.
> But this work fine for me at least.
>
> Index: src/orb/GIOP/giop-recv-buffer.c
> ===================================================================
> RCS file: /cvs/gnome/ORBit2/src/orb/GIOP/giop-recv-buffer.c,v
> retrieving revision 1.15
> diff -u -r1.15 giop-recv-buffer.c
> --- src/orb/GIOP/giop-recv-buffer.c	2000/11/13 18:35:19	1.15
> +++ src/orb/GIOP/giop-recv-buffer.c	2001/01/09 07:25:58
> @@ -566,8 +566,8 @@
>    if(giop_msg_conversion_needed(buf))
>      len = GUINT32_SWAP_LE_BE(len);
>    buf->cur += 4;
> -  if((buf->cur + len) > buf->end
> -     || (buf->cur + len) < buf->cur)
> +  if(/*(buf->cur + len) > buf->end
> +     ||*/ (buf->cur + len) < buf->cur)
>      {
>        G_BREAKPOINT();
>        return NULL;

G_BREAKPOINT() was probably a debugging thing - I think that should just
be 'return NULL' for normal usage.

However, that case should definitely be kicking in - there is an error in
the incoming message or the code if this happens.

I will leave the G_BREAKPOINT() there for now, until we can figure out why
this error is happening...

> This one fix for CORBA_exception_free(CORBA_Environment *ev).
> There are another code which try free exception before using new one.
> I think following fix will be right.
>
> Index: src/orb/orb-core/corba-env.c
> ===================================================================
> RCS file: /cvs/gnome/ORBit2/src/orb/orb-core/corba-env.c,v
> retrieving revision 1.10
> diff -u -r1.10 corba-env.c
> --- src/orb/orb-core/corba-env.c	2000/11/17 01:15:45	1.10
> +++ src/orb/orb-core/corba-env.c	2001/01/09 07:26:14
> @@ -79,6 +79,7 @@
>      {
>        CORBA_free(ev->_id);
>        CORBA_any__freekids(&ev->_any, NULL);
> +	  ev->_major = CORBA_NO_EXCEPTION;
>        ev->_any._type = NULL;
>        ev->_any._value = NULL;
>        ev->_any._release = CORBA_FALSE;
>
> This is just wrapping from g_hash_table_lookup null pointer assertion.

I put this one in.

> Index: src/orb/poa/poa.c
> ===================================================================
> RCS file: /cvs/gnome/ORBit2/src/orb/poa/poa.c,v
> retrieving revision 1.16
> diff -u -r1.16 poa.c
> --- src/orb/poa/poa.c	2000/11/09 00:43:26	1.16
> +++ src/orb/poa/poa.c	2001/01/09 07:26:45
> @@ -64,10 +64,11 @@
>  			    const CORBA_boolean activate_it,
>  			    CORBA_Environment * ev)
>  {
> -  PortableServer_POA child_poa;
> +  PortableServer_POA child_poa = NULL;
>
>
> -  child_poa = g_hash_table_lookup(_obj->child_poas, adapter_name);
> +  if(_obj->child_poas)
> +    child_poa = g_hash_table_lookup (_obj->child_poas, adapter_name);
>
>    if(activate_it)
>      g_warning("Don't yet know how to activate POA named \"%s\"",

Done.

-- Elliot
Who me? I just wander from room to room.











[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]