From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 868176EC55; Wed, 14 Jul 2021 12:43:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 868176EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1626255783; bh=6hMmCF/+m72TuqZueUfyLA9ueqqRZTGdt1LKeSxa02I=; h=To:References:Cc:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=S1wbHxQk3kfbZPlnMtUbcxAIKe2BLzJLfmgxiQxxY+SLfUpfkSREYP5/j74zABpKP lVYpUEsrxlZjNaeDVXAvcGjM7ypnrJaq82NK8K1JfbXcLCVRYctuyLTZgux/o0kTIs EH5CMdEfR9TwrbHP6meDTMbYnJmGKJkXFKNyIa/A= Received: from smtp45.i.mail.ru (smtp45.i.mail.ru [94.100.177.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 755F16EC55 for ; Wed, 14 Jul 2021 12:43:01 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 755F16EC55 Received: by smtp45.i.mail.ru with esmtpa (envelope-from ) id 1m3bPx-0000Lg-35; Wed, 14 Jul 2021 12:43:01 +0300 To: Cyrill Gorcunov References: Cc: tarantool-patches@dev.tarantool.org Message-ID: <0b5a0f5b-5f0d-e8b7-35e7-b8a5894fad26@tarantool.org> Date: Wed, 14 Jul 2021 12:42:54 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD97BB0EF39AD2B33D52181556DE8CA6AFBAFE18027C1DA7DF9182A05F538085040CC72772246B2401389EF5C3AC4185343ED5AEF0CE90CBA5A3DE94C145A7BBC6A X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE789805A6418246A1AEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637BC4B0F5721B555078638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D805F00FD691E2620B99718B7AAD6CE104117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAA867293B0326636D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8BF1175FABE1C0F9B6A471835C12D1D977C4224003CC836476EB9C4185024447017B076A6E789B0E975F5C1EE8F4F765FC95A8BCFC1FD597433AA81AA40904B5D9CF19DD082D7633A078D18283394535A93AA81AA40904B5D98AA50765F7900637D91DA309466B49D6D81D268191BDAD3D698AB9A7B718F8C4D1B931868CE1C5781A620F70A64A45A98AA50765F79006372E808ACE2090B5E1725E5C173C3A84C3C5EA940A35A165FF2DBA43225CD8A89FF841BD135A60A3175E1C53F199C2BB95B5C8C57E37DE458BEDA766A37F9254B7 X-C1DE0DAB: 0D63561A33F958A561E79C945AAB2E6A7CB3E827174C89EC0CFAD98BCE4F6776D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA753753CEE10E4ED4A7410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D348CDF4129B2EA85608504F8EC09FD273B931E9FBE3821C3A5E63E4CFF15830BB3A2882AFB5A49D0A51D7E09C32AA3244C7F1085C93925F7F719CD9A6E92DF1B6005AB220A9D022EBC729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojDdSFIg49M1SRZjK09YiCFA== X-Mailru-Sender: EFA0F3A8419EF2166B053C73E674FFD5618371106E58573A0E48EC7BDA632202E2527C969975515C67F54F2D6EFFC80BC77752E0C033A69E17841C44D9B5D58765F2F89A5AFDB6F16C18EFA0BB12DBB0 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v2 4/4] fiber: refactor C backtrace and add changelog X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Egor Elchinov via Tarantool-patches Reply-To: Egor Elchinov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On 12.07.2021 15:35, Cyrill Gorcunov via Tarantool-patches wrote: > On Fri, Jul 09, 2021 at 02:03:53PM +0300, Egor Elchinov via Tarantool-patches wrote: >> + >> +int >> +backtrace_proc_cache_put(unw_word_t ip, const char *name, unw_word_t offset) >> +{ >> struct proc_cache_entry *entry; >> struct mh_i64ptr_node_t node; >> mh_int_t k; >> @@ -99,39 +108,51 @@ get_proc_name(unw_cursor_t *unw_cur, unw_word_t *offset, bool skip_cache) >> if (proc_cache == NULL) { >> region_create(&cache_region, &cord()->slabc); >> proc_cache = mh_i64ptr_new(); >> - if (proc_cache == NULL) { >> - unw_get_proc_name(unw_cur, proc_name, sizeof(proc_name), >> - offset); >> - goto error; >> - } >> + if (proc_cache == NULL) >> + return -1; >> + } >> + >> + size_t size; >> + entry = region_alloc_object(&cache_region, typeof(*entry), >> + &size); >> + if (entry == NULL) >> + return -1; >> + >> + node.key = ip; >> + node.val = entry; >> + entry->offset = offset; >> + snprintf(entry->name, BACKTRACE_NAME_MAX, "%s", name); > > Please add > > entry->name[BACKTRACE_NAME_MAX - 1] = 0; > Thanks, fixed. > ... > > The rest looks ok to me, thanks! >