marshalling / demarshalling bug? (was: ALIGNOF_CORBA_* defines)



After reading the replies on my question of ALIGNOF_CORBA_* defines
I have the feeling that the generate code of the IDL compiler
contains a bug.
Please correct me if I am wrong.

Consider the following method:

	void testDouble (inout double num);

Observations:
	- Demarshalling aligns with respect to the
		absolute pointer value:
--------------------
            _ORBIT_curptr = ALIGN_ADDRESS(_ORBIT_curptr, 8);
            num = *((CORBA_double *) _ORBIT_curptr);
-------------------

	- Marshalling aligns with respect to the
		start of the GIOP message buffer
		(the correct way I think)
-----------------
	giop_message_buffer_do_alignment
		(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), 8);
	giop_message_buffer_append_mem
		(GIOP_MESSAGE_BUFFER(_ORBIT_send_buffer), &(num),
							 sizeof(num));
-----------------

Conclusion:
	If the system malloc / alloc and friends return memory
	aligned on 4 bytes boundaries this can lead to
	marshalling / demarshalling error.

	But perhaps this is taken care of when allocating
	the GIOP message buffers?
	But I see it fail on my computer, but that is compiled
	without ./configure so perhaps I got some autodected values
	wrong.

Wim Oudshoorn.




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