From: Mathieu Desnoyers Date: Wed, 9 Nov 2011 16:09:39 +0000 (-0500) Subject: Fix ust consumer channel memory non-zeroed allocation X-Git-Tag: v2.0-pre15~140 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=276b26d1bad8b6ede22c70f786f52e467e658bf6 Fix ust consumer channel memory non-zeroed allocation The cpu count was expecting memory to be zeroed on allocation. Caused stream open errors and zero-sized metadata files (and unability to open channel files). Signed-off-by: Mathieu Desnoyers --- diff --git a/liblttng-consumer/lttng-consumer.c b/liblttng-consumer/lttng-consumer.c index 54338e800..c7c7b7a7e 100644 --- a/liblttng-consumer/lttng-consumer.c +++ b/liblttng-consumer/lttng-consumer.c @@ -305,7 +305,7 @@ struct lttng_consumer_channel *consumer_allocate_channel( struct lttng_consumer_channel *channel; int ret; - channel = malloc(sizeof(*channel)); + channel = zmalloc(sizeof(*channel)); if (channel == NULL) { perror("malloc struct lttng_consumer_channel"); goto end; diff --git a/liblttng-ustconsumer/lttng-ustconsumer.c b/liblttng-ustconsumer/lttng-ustconsumer.c index 806ebd3c0..ed4a27c9d 100644 --- a/liblttng-ustconsumer/lttng-ustconsumer.c +++ b/liblttng-ustconsumer/lttng-ustconsumer.c @@ -175,7 +175,6 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, msg.u.channel.mmap_len, msg.u.channel.max_sb_size); if (new_channel == NULL) { - fprintf(stderr, "AAAAA\n"); lttng_consumer_send_error(ctx, CONSUMERD_OUTFD_ERROR); goto end_nosignal; } @@ -218,7 +217,6 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx, msg.u.stream.output, msg.u.stream.path_name); if (new_stream == NULL) { - fprintf(stderr, "BBBBBB\n"); lttng_consumer_send_error(ctx, CONSUMERD_OUTFD_ERROR); goto end; }