Re: [BUG] perf probe segfaulting when asked for variable it doesn't find

From: Masami Hiramatsu
Date: Thu May 29 2014 - 05:56:15 EST


(2014/05/29 6:44), Arnaldo Carvalho de Melo wrote:
> Masami-san,
>
> While trying:
>
> [root@zoo ~]# perf probe 'vfs_getname=getname_flags:65 pathname=result->name:string'
> Failed to find the location of result at this address.
> Perhaps, it has been optimized out.
> Failed to find 'result' in this function.
> Error: Failed to add events. (-2)
> [root@zoo ~]# perf probe 'vfs_getname=getname_flags:65 pathname=result->name:string'
> Added new event:
> Segmentation fault (core dumped)
>
> I got segfaulted while in the past I would get the much nicer:
>
> [root@zoo ~]# perf probe 'vfs_getname=getname_flags:65 pathname=result->name:string'
> Failed to find the location of result at this address.
> Perhaps, it has been optimized out.
> Failed to find 'result' in this function.
> Error: Failed to add events. (-2)
> [root@zoo ~]#

Oops, I got that. Bad SEGV was reproduced here too.
And I've found an error-handling miss in the convert_variable(),
I'll send a patch for fixing it.
Thank you very much for bisecting and finding my fault.

--
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@xxxxxxxxxxx


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/