2010-11-12 08:12:31

by Jan Kiszka

[permalink] [raw]
Subject: Re: [PATCH] trace-view: Handle unknown events more gracefully

Am 14.10.2010 21:23, Jan Kiszka wrote:
> Kernel 2.6.35.7 generates invalid trace files due to
> /sys/kernel/debug/tracing/events/scsi/scsi_dispatch_cmd_timeout/format
> returning "FORMAT TOO BIG" (seems to be fixed in 2.6.36). This makes
> pevent_data_event_from_type return NULL, and dereferencing of event
> crashes the viewer.
>
> Catch and report the error properly.

Ping...

Jan

>
> Signed-off-by: Jan Kiszka <[email protected]>
> ---
> trace-view-store.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/trace-view-store.c b/trace-view-store.c
> index 0834df7..34f8155 100644
> --- a/trace-view-store.c
> +++ b/trace-view-store.c
> @@ -507,12 +507,17 @@ trace_view_store_get_value (GtkTreeModel *tree_model,
> case TRACE_VIEW_STORE_COL_INFO:
> val = pevent_data_type(pevent, data);
> event = pevent_data_event_from_type(pevent, val);
> + if (!event) {
> + if (column == TRACE_VIEW_STORE_COL_EVENT)
> + g_value_set_string(value, "[UNKNOWN EVENT]");
> + break;
> + }
> +
> if (column == TRACE_VIEW_STORE_COL_EVENT) {
> g_value_set_string(value, event->name);
> break;
> }
>
> -
> trace_seq_init(&s);
> pevent_event_info(&s, event, data);
> g_value_set_string(value, s.buffer);



Attachments:
signature.asc (259.00 B)
OpenPGP digital signature

2010-11-12 11:55:30

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH] trace-view: Handle unknown events more gracefully

On Fri, 2010-11-12 at 09:04 +0100, Jan Kiszka wrote:
> Am 14.10.2010 21:23, Jan Kiszka wrote:
> > Kernel 2.6.35.7 generates invalid trace files due to
> > /sys/kernel/debug/tracing/events/scsi/scsi_dispatch_cmd_timeout/format
> > returning "FORMAT TOO BIG" (seems to be fixed in 2.6.36). This makes
> > pevent_data_event_from_type return NULL, and dereferencing of event
> > crashes the viewer.
> >
> > Catch and report the error properly.
>
> Ping...

Thanks! I just had 3 conferences in the last month and that put me way
behind in my email. I still have 1001 unread messages :-(

I'll pull this in today.

-- Steve