From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753362AbbDAMmP (ORCPT ); Wed, 1 Apr 2015 08:42:15 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:13009 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751933AbbDAMmK (ORCPT ); Wed, 1 Apr 2015 08:42:10 -0400 Message-ID: <551BE78A.6070800@huawei.com> Date: Wed, 1 Apr 2015 20:41:46 +0800 From: Wang Nan User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 MIME-Version: 1.0 To: Jiri Olsa CC: , , , , , , Subject: Re: [PATCH 1/4] perf tools: unwind: ensure unwind hooks return negative errorno. References: <1427884395-241111-1-git-send-email-wangnan0@huawei.com> <1427884395-241111-2-git-send-email-wangnan0@huawei.com> <20150401121222.GA10820@krava.brq.redhat.com> In-Reply-To: <20150401121222.GA10820@krava.brq.redhat.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.111.69.129] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >