Skip to contentSkip to conversation

Fix: don't access missing ctf trace when getting metadata

PATCH Jérémie Galarneau 2 participants 2 messages Aug 18, 2015 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 3 lines · Mathieu Desnoyers

We can get metadata when still in the trace open functions, in which case the ctf trace is now allocated nor available yet. This fixes a

Do you mean "is neither allocated nor available yet"?

Quoted 13 lines

segmentation fault in stress-test.

---
 formats/lttng-live/lttng-live-comm.c | 5 +++++
 1 file changed, 5 insertions(+)
formats/lttng-live/lttng-live-comm.c +0 -0
index 9b409bc..57586a1 100644

formats/lttng-live/lttng-live-comm.c int append_metadata(struct lttng_live_ctx *ctx, · line 604

Quoted 5 lines
formats/lttng-live/lttng-live-comm.c +1 -0
@@ -600,6 +600,11 @@ int append_metadata(struct lttng_live_ctx *ctx,
        struct lttng_live_viewer_stream *metadata;
        char *metadata_buf = NULL;
 
+       if (!viewer_stream->ctf_trace->handle) {
 

If the ctf_trace can be unallocated, shouldn't we check for:

if (!viewer_stream->ctf_trace) ?

Jérémie

Quoted 12 lines
formats/lttng-live/lttng-live-comm.c +4 -0
+               printf_verbose("append_metadata: trace handle not ready
 yet.\n");
+               return 0;
+       }
+
        printf_verbose("get_next_index: new metadata needed\n");
        ret = get_new_metadata(ctx, viewer_stream, &metadata_buf);
        if (ret < 0) {

--
2.1.4

Signature · 3 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

A message that is not in the archive (sent off-list or not yet received): CA+jJMxsYMkE_fgBDs26Ox5xrKhsmZj60DcnmkDtksCMtqGx0kw@mail.gmail.com

#3 lore raw
Quoted 7 lines · Jeremie Galarneau
Quoted 2 lines · Mathieu Desnoyers

We can get metadata when still in the trace open functions, in which case the ctf trace is now allocated nor available yet. This fixes a

Do you mean "is neither allocated nor available yet"?

yes, sorry.

Thanks,

Mathieu

Quoted 38 lines
Quoted 13 lines

segmentation fault in stress-test.

---
formats/lttng-live/lttng-live-comm.c | 5 +++++

1 file changed, 5 insertions(+)
formats/lttng-live/lttng-live-comm.c +0 -0
index 9b409bc..57586a1 100644

formats/lttng-live/lttng-live-comm.c int append_metadata(struct lttng_live_ctx *ctx, · line 603

Quoted 4 lines
formats/lttng-live/lttng-live-comm.c +1 -0
@@ -600,6 +600,11 @@ int append_metadata(struct lttng_live_ctx *ctx,
 struct lttng_live_viewer_stream *metadata;
 char *metadata_buf = NULL;
 
+ if (!viewer_stream->ctf_trace->handle) {

If the ctf_trace can be unallocated, shouldn't we check for:

if (!viewer_stream->ctf_trace) ?

Jérémie

Quoted 9 lines
formats/lttng-live/lttng-live-comm.c +4 -1
+ printf_verbose("append_metadata: trace handle not ready yet.\n");
+ return 0;
+ }
+
 printf_verbose("get_next_index: new metadata needed\n");
 ret = get_new_metadata(ctx, viewer_stream, &metadata_buf);
 if (ret < 0) {
--

2.1.4

--
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com

Signature · 3 lines
Mathieu Desnoyers 
EfficiOS Inc. 
http://www.efficios.com 

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev