Re: Problems marshalling an any



Hi Michael,

> should be the right way to go. I try this and send a patch if it turns
> out to be correct.

Be careful. In my original message, I directly assigned a pointer to
any->_value :
  any->_value = (char *) malloc(20);

But, according to the the resolution of 2563 - "Note that this holds
true when the datum is itself implemented as a pointer, e.g. in the case
of a CORBA string, the _value member would be a pointer(CORBA_char**) to
string(CORBA_char*)." - I made a mistake doing it that way.
In my test program I changed it accordingly (unaware of this resolution
at that moment, just a guess from staring at the code) and everything
ran fine (after I fixed the ALIGNOF macro's for VMS)

So be sure to have good look at the orbit-ird and test-ird client before
you make the changes. You could compare them against the way any's are
allocated in the test-any server and client in the 'test' directory.

Good Luck.

Marc

Michael Rumpf wrote:
> 
> Hi Marc,
> 
> It seems that I just stumbled over the same problem.
> 
> The line
> >     case CORBA_tk_string :
> >         ulval = strlen(*(char **)*val) + 1;
> segfaults when using the orbit-ird and the test-ird client (together
> with a previous bug-fix in the CORBA_PrimitiveDef__create() method).
> 
> The Final Report of the C-Revision Task Force (ptc/2000-05-10) Issue
> 2563 addresses this problem:
> 
> http://cgi.omg.org/issues/c_mapping-rtf.html#Issue2563
> 
> When using gdb to analyze the problem it prints the following:
> 
> (gdb) p *(char**)val
> $5 0x80a58bc
> 
> (gdb) p *(char**)*val
> $5 0x0
> 
> The second case which is used in the code lets the strlen segfault. The
> first one shows an empty string (in my case). So I assume that this
> should be the right way to go. I try this and send a patch if it turns
> out to be correct.
> 
> Michael
> 
> "Verwerft, Marc" wrote:
> >
> > Hi Sebastian,
> >
> > No, I'm not using the ORBit event server. I noticed in the documentation
> > that it wasn't ready.
> > I am using the JavaORB event service to attach to as an (ORBit) client.
> >
> > The problems I'm having now are related to sending an 'any' value across.
> > I'm currently using the test-any-client/server to track down what's going on
> > and found what's happening.
> >
> > Snippet from ORBit_marshal_value() in corba_any.c :
> >          case CORBA_tk_string :
> >         ulval = strlen(*(char **)*val) + 1;
> >
> >         *val = ALIGN_ADDRESS(*val, ALIGNOF_CORBA_POINTER);
> >
> >         giop_send_buffer_append_mem_indirect_a(buf,
> >                                                &ulval,
> >                                                sizeof(CORBA_unsigned_long));
> >         giop_message_buffer_append_mem(GIOP_MESSAGE_BUFFER(buf), *(char
> > **)*val, ulval);
> >
> > For marshalling the data, the ALIGN_ADDRESS(addr,boundary) macro is used.
> > However in the config.h file I have a #define ALIGNOF_CORBA_POINTER 0 (All
> > other ALIGNOF_ defines are also 0). Using this I invariably get as result 0
> > and the program crashes when invoking giop_message_buffer_append_mem().
> >
> > So, I should probably alter these definitions. Since I cannot run the
> > configure script on OpenVMS, could you mail me your settings (and probably
> > CPU type) to use as a starting point ?
> >
> > Thanks for helping me out.
> >
> > Marc.
> >
> > I've got an enormous mind. Sometimes it takes me a whole week to make it up.
> >
> > > ----------
> > > From:         Sebastian Wilhelmi[SMTP:wilhelmi ira uka de]
> > > Reply To:     orbit-list gnome org
> > > Sent:         Wednesday 4 October 2000 12:18
> > > To:   orbit-list gnome org
> > > Subject:      Re: Problems marshalling an any
> > >
> > > Hi Marc,
> > >
> > > > I'm currently testing a client (in ORBit 0-5-3 stable but ported to VMS,
> > > > using C bindings) program that attaches to an eventchannel as a
> > > > pushsupplier. Everything seems to work, I get the channel from an ior,
> > > > invoke the for_suppliers() and obtain_push_consumer() methods. Things
> > > break
> > > > when I try to send something (any-thing ;-) ) and it appears to go wrong
> > > in
> > > > the ORBit_marshal_any() call. I invariably get an access violation (VMS
> > > > terms for telling me that I'm reading/writing outside of my memory
> > > space)
> > >
> > > Just one question: Are you using the event server from ORBit? It's not
> > > ready.
> > > Actually it is not even close to be ready, honestly, it should be removed
> > > from
> > > the surface of the earth to make it a better place. It's all my fault.
> > >
> > > Bye,
> > > Sebastian
> > > --
> > > Sebastian Wilhelmi                   |            här ovanför alla molnen
> > > mailto:wilhelmi ira uka de           |     är himmlen så förunderligt blå
> > > http://goethe.ira.uka.de/~wilhelmi   |
> > >
> > > _______________________________________________
> > > 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
> 
> _______________________________________________
> 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]