[lkml]   [2010]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: perf per-symbol histogram causes memory corruption

    (Added Arnaldo to the Cc: - he's maintaining the symbol lookup bits of perf.)

    * David Miller <> wrote:

    > When builtin-annotate.c processes sample events via
    > process_sample_event() it uses 'sample_filter'
    > sample_filter() sizes the histogram object for a symbol based upon the
    > size, calculated as "sym->end - sym->start", to determine the number
    > of IP sample slots to allocate.
    > The problem is, the sym->end value is not stable at this point.
    > For example, dso__load_sym() first loads all of the symbols, then it
    > makes another pass over the symbols by calling symbols__fixup_end()
    > which will adjust the sym->end values of various symbols.
    > At this point, the histogram IP sample array allocated by
    > sample_filter() can become too small, and hits recorded can thus
    > access past the end of the array corrupting memory.
    > I get this very reliably on sparc64, and it took me a few days to root
    > cause this. :-)
    > I don't see an immediate way to fix this, any ideas?

     \ /
      Last update: 2010-02-25 12:15    [W:0.020 / U:10.984 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site