lkml.org 
[lkml]   [2012]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] perf kvm: fix segfault with default guest arguments
On 6/28/12 8:44 AM, Arnaldo Carvalho de Melo wrote:
> Em Sun, Jun 24, 2012 at 10:41:26PM -0600, David Ahern escreveu:
>> File generated with:
>> $ perf kvm --host --guest --guestkallsyms=/tmp/guest-kallsyms
>> --guestmodules=/tmp/guest-modules record -a
>>
>> The report command:
>> $ perf kvm --host --guest --guestkallsyms=/tmp/guest-kallsyms
>> --guestmodules=/tmp/guest-modules report
>>
>> dies with a SEGFAULT:
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x000000000046dd7b in machine__mmap_name (self=0x0, bf=0x7fffffffbd20 "q\021", size=4096) at util/map.c:715
>> 715 snprintf(bf, size, "[%s.%d]", "guest.kernel.kallsyms", self->pid);
>>
>> (gdb) bt
>> 0 0x000000000046dd7b in machine__mmap_name (self=0x0, bf=0x7fffffffbd20 "q\021", size=4096) at util/map.c:715
>> 1 0x0000000000444161 in perf_event__process_kernel_mmap (tool=0x7fffffffdd80, event=0x7ffff7fb4120, machine=0x0) at util/event.c:562
>
> I think that this should be handled at perf_event__process_kernel_mmap,
> i.e. tools can conceivably handle this situation in their specific
> handlers.
>
>> @@ -976,6 +976,8 @@ static int perf_session_deliver_event(struct perf_session *session,
>> }
>> return tool->sample(tool, event, sample, evsel, machine);
>> case PERF_RECORD_MMAP:
>> + if (machine == NULL)
>> + return 0;
>> return tool->mmap(tool, event, sample, machine);
>>
> - Arnaldo
>

Ok. Doing it in perf_session_deliver_event makes it consistent with the
SAMPLE case.

David


\
 
 \ /
  Last update: 2012-06-28 17:41    [W:0.256 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site