From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp53.i.mail.ru (smtp53.i.mail.ru [94.100.177.113]) (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 00D0B45C304 for ; Mon, 14 Dec 2020 12:41:16 +0300 (MSK) References: <20201210161832.729439-1-gorcunov@gmail.com> <20201210161832.729439-5-gorcunov@gmail.com> <738d0eec-6ce6-1f24-5d25-e143e96bdd68@tarantool.org> <20201212161947.GG544004@grain> <20201212170734.GH544004@grain> From: Serge Petrenko Message-ID: Date: Mon, 14 Dec 2020 12:41:12 +0300 MIME-Version: 1.0 In-Reply-To: <20201212170734.GH544004@grain> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: 8bit Content-Language: en-GB Subject: Re: [Tarantool-patches] [PATCH v4 4/4] crash: report crash data to the feedback server List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov Cc: Mons Anderson , tml , Vladislav Shpilevoy 12.12.2020 20:07, Cyrill Gorcunov пишет: > On Sat, Dec 12, 2020 at 07:19:47PM +0300, Cyrill Gorcunov wrote: >> On Fri, Dec 11, 2020 at 03:57:20PM +0300, Serge Petrenko wrote: >>>> + >>>> + /* >>>> + * On linux there is new_utsname structure which >>>> + * encodes each field to __NEW_UTS_LEN + 1 => 64 + 1 = 65. >>>> + * >>>> + * So lets just reserve more data in advance: 5 fields >>>> + * 128 bytes each => 640 bytes. >>>> + */ >>>> + static_assert(sizeof(struct utsname) <= 640, >>>> + "utsname is bigger than expected"); >>> >>> This static assert fails on my mac. >>> Looks like `struct utsname` is 1280 bytes in size there. >> Thanks, Serge! I'll force update the size. > Force pushed the update > --- > /* > * Lets reuse tail of the buffer as a temp space. > */ > struct utsname *uname_ptr = (void *)&tail[-sizeof(struct utsname)]; > if (p >= (char *)(void *)uname_ptr) > goto out; > > if (uname(uname_ptr) != 0) { > pr_syserr("uname call failed, ignore"); > memset(uname_ptr, 0, sizeof(struct utsname)); > } Thanks for the fix! LGTM. -- Serge Petrenko