Re: possible bug?
- From: Michael Meeks <michael ximian com>
- To: dou wen <orbkernel hotmail com>
- Cc: orbit <orbit-list gnome org>
- Subject: Re: possible bug?
- Date: 08 Mar 2002 22:44:49 +0000
Hi Dou,
On Fri, 2002-03-08 at 12:53, dou wen wrote:
> i notice that there is a possible bug about alignment when demarshal
> GIOP request or reply.
Yes this is the case, the thing to do is submit a patch for a g_assert
to ensure that we are at least 8 byte aligned when we malloc. This is a
built in assumption that isn't tested in the ORB which is a shame.
Sorry it took you a while to find that - I hit this before and it's a
pain.
> i suggest use a new function like this to replace marco ALIGN_ADDRESS:
> void
> giop_recv_buffer_align (GIOPRecvBuffer *buf, gulong boundary)
> {
> gulong align_amt, ms;
>
> ms = buf->cur - buf->message_body;
> align_amt = ALIGN_VALUE(ms, boundary) - ms;
> if(align_amt)
> buf->cur += align_amt;
> }
>
> it have nothing with absulate address.
The problem with this is that it's incredibly slower than a simple
ALIGN_VALUE. The best solution is (I think) to have a wrapper for your
malloc ( specific to the GIOP allocation code ) that ensures that the
memory is 8 byte aligned - but we do need that assertion, could you
knock up a simple patch (and comment) for that vs HEAD ORBit2 ?
Regards,
Michael.
--
mmeeks@gnu.org <><, Pseudo Engineer, itinerant idiot
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]