Messages in this thread |  | | | Date | Tue, 6 Mar 2012 07:27:27 +0100 | | From | Ingo Molnar <> | | Subject | Re: [PATCH] perf report: auto-detect branch stack sampling mode |
| |
* Arnaldo Carvalho de Melo <acme@redhat.com> wrote:
> > Something like this seems to do it for me. > > > > offset = addr - sym->start; > > + len = sym->end - sym->start; > > + if (offset >= len) > > + return 0; > > + > > That is my fault, I should have added a BUG_ON() spitting out > a callchain in this case, as that function shouldn't be called > if the address is not within its range :-\
Btw., I'd suggest not doing a BUG_ON() but some less destructive warning: both symbol table errors and sample stream hickups are common and can lead to essentially arbitrary input data - we shouldn't crash on that.
Thanks,
Ingo
|  |