RE: "any within struct" ORBit decoding problem



Hi,

I haven't seen any followups to this alignment fix. Anyone interested?
I can put it in patch form if that would help.

Alex.
 
Pete Kingswell writes:
 > Hi,
 > building on Philip et al's discovery about the ordering of the struct's
 > contents, a colleague of mine delved into src/orb/orbit_typecode.c and found
 > that, in his words, "the bug was to do with alignment of the read pointer to
 > a 4 byte boundary
 > before reading the typecode information."
 > 
 > With the fix in place, our patched orbit orb was able to demarshal complex
 > nested structs with anys in that it had previously bombed out on.  The
 > commented line in the code extract below identifies the fix in
 > src/orb/orbit_typecode.c:
 > 
 > 
 > void ORBit_decode_CORBA_TypeCode(CORBA_TypeCode* t, GIOPRecvBuffer* buf)
 > {
 >         CDR_Codec codec_d;
 > 	CDR_Codec* codec = &codec_d;
 > 	TCDecodeContext ctx;
 > 	GSList* l;
 > 
 > 	CDR_codec_init_static(codec);
 > 
 > 	/* Need to realign to 4 byte boundary before attempting to decode the
 > typecode */
 >  	buf->cur = ALIGN_ADDRESS(buf->cur, 4);
 > 
 > 	codec->buffer=buf->cur;
 > 	codec->release_buffer=CORBA_FALSE;
 > 	codec->readonly=CORBA_TRUE;
 > 
 > 
 > This was tested on a setup that has ACE/TAO servers with perl clients.  I'm
 > using ORBit 0.5.7, perl 5.005_03, CORBA::ORBit 0.4.3 and TAO 1.1.10 on
 > RedHat Linux 2.2.14-6.1.1smp.
 > 
 > Thanks,
 > peter.
 > 
 > Pete Kingswell
 > Developer
 > Anvil Software
 > +44 207 7497943
 > 
 > 
 > -----Original Message-----
 > From: orbit-list-admin@gnome.org [mailto:orbit-list-admin@gnome.org]On
 > Behalf Of Philip Lijnzaad
 > Sent: 12 June 2001 17:54
 > To: lijnzaad@ebi.ac.uk
 > Cc: orbit-list@gnome.org; senger@ebi.ac.uk
 > Subject: Re: "any within struct" ORBit decoding problem
 > 
 > 
 > 
 > On Tue, 12 Jun 2001 11:35:07 +0100,
 > "me" == Philip Lijnzaad <lijnzaad@ebi.ac.uk> wrote:
 > 
 > me> This has been a while ago, so I include the whole mail. The question is,
 > has
 > me> anything changed in the mean time? We have a very similar setup, and are
 > me> trying to send a
 > 
 > me>     struct Property {
 > me> 	string property_name;
 > me> 	any property_value;
 > me>     };
 > 
 > me> to a Java server (using ORBacus 4.0.5). Plain anys (i.e. not as part of
 > a
 > me> struct) appear to work fine, both as clients/servers and
 > sending/receiving.
 > me> However anys as part of a struct just don't get marshalled (although we
 > don't
 > me> get a failed assertion).
 > 
 > me> I haven't seen a follow-up to this mail; has this (IMHO serious) problem
 > been
 > me> solved in the mean time? Should I get the latest ORBit snapshot from CVS
 > ?
 > 
 > me> 'any' help appreciated !-)
 > me>
 > Philip
 > 
 > OK, some more info. It turns out that it's more an interoperability problem.
 > To quote from a mail by my colleague Martin Senger, who investigated this in
 > some detail:
 > 
 >   1) All examples work fine when both server and client are orbit-perl. That
 >   means we have here an interoperability problem.
 > 
 >   2) Standalone Anys work also fine. For example, method:
 >      any get_any (in any my_any)
 > 
 >   3) The problems are when an Any is a member of a struct. Such Any is not
 >   passed throught the wire at all (in any combinantion of perl-orbit and
 >   java servers/clients). Or it is lost during un/marshalling - I do not know
 >   where.
 >      Interesting - especially for the orbit-perl developers - is that the
 >   Any in struct works if it is the first member of the struct. So, passing
 >   this:
 > 
 >     struct MyStructure {
 >       any    value;
 >       string name;
 >     };
 > 
 >   works, but passing this:
 > 
 >     struct MyStructure {
 >       string name;
 >       any    value;
 >     };
 > 
 >   does not work.
 > 
 >   4) When I am passing an array of Anys:
 >      - again it works for orbit-perl on both sides,
 >      - surprisingly itworks for the combinantion client-in-orbit-perl and
 >   server in java-orbacus (which gives me some chnaces to continue with the
 >   'novella' project, at least until the bug is fixed)
 >       - and it does not work for client-in-java and server-in-orbit-perl
 >   (actually it works only for the first element of the array but not for the
 >   rest - sic!).
 > 
 >   5) Sending/receiving array of structs with an Any as a member also does
 >   not work (and again it works for the first struct but not for the others).
 >   Just to be sure, I also checked sending/receiving array of structs without
 >   any Any as members - and it works fine. So the problem is with Anys not
 >   with sending arrays of structs.
 > 
 > I have tried to see if a plain C orbit-client could pass structs with
 > any-members to and from an ORBacus server, but I have failed so far (which
 > due to the scarcity of documentation on anys in C; see also my mail to
 > news:comp.object.corba).
 > 
 > The complete examples are available from
 > 
 >   ftp://ftp.ebi.ac.uk/pub/lijnzaad/novella-tests.tar.gz
 > 
 > PS: following plea still stands :-)
 > 
 > me> PS: I have so failed to find any examples on how to work with anys in
 > ORBit;
 > me>     any pointers (sorry about the pun again) would be very welcome.
 > 
 > 
 > --
 > If you have a procedure with 10 parameters, you probably missed some.
 > (Kraulis)
 > ----------------------------------------------------------------------------
 > -
 > Philip Lijnzaad, lijnzaad@ebi.ac.uk \ European Bioinformatics Institute,rm
 > A2-08
 > +44 (0)1223 49 4639                 / Wellcome Trust Genome Campus, Hinxton
 > +44 (0)1223 49 4468 (fax)           \ Cambridgeshire CB10 1SD,  GREAT
 > BRITAIN
 > 
 > 
 > _______________________________________________
 > orbit-list mailing list
 > orbit-list@gnome.org
 > http://mail.gnome.org/mailman/listinfo/orbit-list
 > 
 > 
 > _______________________________________________
 > orbit-list mailing list
 > orbit-list@gnome.org
 > http://mail.gnome.org/mailman/listinfo/orbit-list




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