<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 17, 2015 at 7:53 PM, Mathieu Desnoyers <span dir="ltr"><<a href="mailto:mathieu.desnoyers@efficios.com" target="_blank">mathieu.desnoyers@efficios.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We can get metadata when still in the trace open functions, in which<br>
case the ctf trace is now allocated nor available yet. This fixes a<br></blockquote><div><br></div><div>Do you mean "is neither allocated nor available yet"?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
segmentation fault in stress-test.<br>
<br>
Signed-off-by: Mathieu Desnoyers <<a href="mailto:mathieu.desnoyers@efficios.com">mathieu.desnoyers@efficios.com</a>><br>
---<br>
formats/lttng-live/lttng-live-comm.c | 5 +++++<br>
1 file changed, 5 insertions(+)<br>
<br>
diff --git a/formats/lttng-live/lttng-live-comm.c b/formats/lttng-live/lttng-live-comm.c<br>
index 9b409bc..57586a1 100644<br>
--- a/formats/lttng-live/lttng-live-comm.c<br>
+++ b/formats/lttng-live/lttng-live-comm.c<br>
@@ -600,6 +600,11 @@ int append_metadata(struct lttng_live_ctx *ctx,<br>
struct lttng_live_viewer_stream *metadata;<br>
char *metadata_buf = NULL;<br>
<br>
+ if (!viewer_stream->ctf_trace->handle) {<br></blockquote><div><br></div><div>If the ctf_trace can be unallocated, shouldn't we check for:</div><div><br></div><div>if (!viewer_stream->ctf_trace) ?</div><div><br></div><div>Jérémie</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ printf_verbose("append_metadata: trace handle not ready yet.\n");<br>
+ return 0;<br>
+ }<br>
+<br>
printf_verbose("get_next_index: new metadata needed\n");<br>
ret = get_new_metadata(ctx, viewer_stream, &metadata_buf);<br>
if (ret < 0) {<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.1.4<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Jérémie Galarneau<br>EfficiOS Inc.<br><a href="http://www.efficios.com" target="_blank">http://www.efficios.com</a></div>
</div></div>