[Spread-users] To protect against SEGV in scatter.

Ed Holyat eholyat at olf.com
Fri Oct 26 14:38:26 EDT 2007

The screen shots didn't go through, here is the code change

Basically the msg->num_elements was 135 and the MAX_SCATTER_ELEMENTS
array is only 100


message_obj     *Message_copy_message(message_obj *msg)


        int i;


        message_obj *tmp_scat;

        tmp_scat = new( SCATTER );

        tmp_scat->num_elements = msg->num_elements;

      for( i=0; i < msg->num_elements; i++ )


         if( i >= MAX_SCATTER_ELEMENTS)


            Alarm(DEBUG, "Message_copy_message: num of elements %d >

             msg->num_elements, MAX_SCATTER_ELEMENTS);




            tmp_scat->elements[i].len = msg->elements[i].len;

            tmp_scat->elements[i].buf = (char *)new( PACKET_BODY );

                if (tmp_scat == NULL) {

                        Alarm(EXIT, "Message_copy_message: Failed to
allocate a new PACKET_BODY object\n");



            memcpy( tmp_scat->elements[i].buf, msg->elements[i].buf,
msg->elements[i].len );





Recreation of stack

*         Message_copy_message() 

*         Sess_write() -> The len_sent=76108 is < the

*         G_send_heavyweight_join()

*         G_send_heavyweight_memb()

*         G_compute_and_notify

*         G_handle_groups

*         Sess_deliver_message

*         Deliver_packet

*         Deliver_agreed_packets

*         Port_handle_bcast

*         E_handle_events

*         _run_main

*         main



-----Original Message-----
From: spread-users-bounces at lists.spread.org
[mailto:spread-users-bounces at lists.spread.org] On Behalf Of Ed Holyat
Sent: Friday, October 26, 2007 12:52 PM
To: Spread-users at lists.spread.org
Subject: [Spread-users] To protect against SEGV in scatter.


I have run into a case where the number of members combined with the
size of the private_name to a particular group has exceeded the vector
space available in a single scatter message.  

What are the effects of truncating this list and allowing the message to
propagate to the users?  Will the truncated members still receive these

If the last member name is truncated, will that crash the receiving
daemons or clients? Do we have to make sure that the last group contains
the entire member name?

Is this information needed by a client program (daemon to client) or by
the daemons (daemon to daemon)? 





The len_sent is < the total_to_send


Ed Holyat

Open Link Financial, Inc.

(516) 227-6600 x 231


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.spread.org/pipermail/spread-users/attachments/20071026/6e2c1e52/attachment.html 

More information about the Spread-users mailing list