LKML Archive on
help / color / mirror / Atom feed
* [BUG] perf report: segfault when annotate kernel module.
@ 2015-04-02  8:59 Wang Nan
  0 siblings, 0 replies; only message in thread
From: Wang Nan @ 2015-04-02  8:59 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Jiri Olsa, Namhyung Kim; +Cc: Li Zefan, linux-kernel

Hi folks,

I hit a segfault when try to analysis a generated in an aarch 64 board.
I tried execute perf report on x86 and arm64, both of them hit similar segfault:

 $ perf report -i ./buggy/ --objdump=/path/to/aarch64-oe-linux-objdump --kallsyms /path/to/kallsyms

perf: Segmentation fault
-------- backtrace --------

I did some debugging and found the problem is raised at dso__load_kcore:

static int dso__load_kcore(struct dso *dso, struct map *map,
                           const char *kallsyms_filename)
        struct map_groups *kmaps = map__kmap(map)->kmaps;    // kmap is NULL here
        struct machine *machine = kmaps->machine;            // segfault.

Then I realised that if a struct map is created by machine__new_module with map__new2,
the map__kmap(map) is never set. However, if I set

        map->map_ip = map->unmap_ip = identity__map_ip;
        kmap = map__kmap(map);
        kmap->kmaps = &machine->kmaps;

in machine__new_module like in __machine__create_kernel_maps, I hit another problem:

*** Error in `/home/user/perf': free(): invalid next size (normal): 0x0000000002411a60 ***
======= Backtrace: =========
======= Memory map: ========

Does anyone has any idea on it?

Thank you!

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-04-02  9:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-02  8:59 [BUG] perf report: segfault when annotate kernel module Wang Nan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).