Prev: ext2: return -ENODATA for NULL i_file_acl in ext2_xattr_list
Next: kdb: ll command won't terminate
From: David Daney on 13 Jul 2010 14:50 From the MIPS kernel we get things like: print fmt: "page=%p pfn=%lu order=%d migratetype=%d", REC->page, ({ struct page *__pg = (REC->page); int __sec = page_to_section(__pg); (unsigned long)(__pg - __section_mem_map_addr(__nr_to_section(__sec))); }), REC->order, REC->migratetype This cannot be parsed, leading to a NULL struct event_format* being passed to pevent_get_common_field_val, which produces a SIGSEGV. It would be good to get a parsable format from the kernel, but to remediate the problem for legacy kernels, we can just return an error indicator in this case. This allows some output from trace-cmd report, although perhaps with some missing data. But this is better than crashing. Signed-off-by: David Daney <ddaney(a)caviumnetworks.com> --- parse-events.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/parse-events.c b/parse-events.c index 9d5a3fa..16fff12 100644 --- a/parse-events.c +++ b/parse-events.c @@ -4481,6 +4481,9 @@ int pevent_get_common_field_val(struct trace_seq *s, struct event_format *event, { struct format_field *field; + if (!event) + return -1; + field = pevent_find_common_field(event, name); return get_field_val(s, field, name, record, val, err); -- 1.6.6.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|
Pages: 1 Prev: ext2: return -ENODATA for NULL i_file_acl in ext2_xattr_list Next: kdb: ll command won't terminate |