Re: [PATCH 1/4] perf tools: unwind: ensure unwind hooks return negative errorno.

From: Wang Nan
Date: Wed Apr 01 2015 - 08:42:18 EST


On 2015/4/1 20:12, Jiri Olsa wrote:
> On Wed, Apr 01, 2015 at 10:33:12AM +0000, Wang Nan wrote:
>> According to man pages of libunwind, unwind hooks should return
>> 'negative value of one of the unw_error_t error-codes', they are
>> different from generic error code. In addition, access_dso_mem()
>> returns '!(size == sizeof(*data))', compiler never ensure it is
>> negative when failure, which causes libunwind get undesire value
>> when accessing //anon memory.
>>
>> This patch fixes this problem by force returning negative value when
>> error, instead of returning 'ret' itself when it is non-zero.
>
> hum, how about find_proc_info callback.. should it follow the same rules?
>

Yes, but it only returns -EINVAL and dwarf_search_unwind_table(....). The latter
one is part of libunwind so we can trust it returns negative when fail.

> thanks,
> jirka
>


--
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/