[zeromq-dev] Assertion failed end_chunk->next in yqueu.hpp 108

Nico Hochgeschwender nico.hochgeschwender at h-brs.de
Tue Feb 22 12:31:40 CET 2011


Hello all,

we would like to report an assertion failure in the following context:

1 publisher to 100 subscriber with a message of 5 million bytes. The
publisher runs in a periodic loop of 100Hz. The data is allocated
statically, so no external call for a memory deallocation. Both
publisher and subscriber are implemented in C linked agains 2.0.9
version of 0MQ.


Please find the code of the publisher below:

<code>
...

#define MSG_SIZE_IN_BYTES 5000000

struct message {
  struct timeval timestamp;
  char buffer[MSG_SIZE_IN_BYTES];
};


int main(int argc, char *argv[])
{

	void* context;
	void* publisher;

	context = zmq_init(1);
	publisher = zmq_socket(context, ZMQ_PUB);
	zmq_bind(publisher, "tcp://*:5556");

	int i = 0;
        struct message m;

	if (m.buffer == NULL) {
		printf("Buffer is NULL. Exit!\n");
	} else {
	  for (i = 0; i < MSG_SIZE_IN_BYTES; i++) {
			m.buffer[i] = rand()%26+'a';
		}
		m.buffer[i] = '\0';
	}
	

	while(1)
	{
      	
		zmq_msg_t msg;
		zmq_msg_init_size(&msg, sizeof(struct message));
		gettimeofday(&(m.timestamp), NULL);
		zmq_msg_init_data(&msg, &m,
				  sizeof(struct message),
				  NULL, NULL);
		
		zmq_send(publisher, &msg, 0);
		zmq_msg_close(&msg);
	       	usleep(HERTZ_30);
	}
	return 0;
}

</code>

Thank you in advance!

Nico




More information about the zeromq-dev mailing list