From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id BBAAD45C304 for ; Sat, 12 Dec 2020 20:07:37 +0300 (MSK) Received: by mail-lf1-f68.google.com with SMTP id h19so19470173lfc.12 for ; Sat, 12 Dec 2020 09:07:37 -0800 (PST) Date: Sat, 12 Dec 2020 20:07:34 +0300 From: Cyrill Gorcunov Message-ID: <20201212170734.GH544004@grain> References: <20201210161832.729439-1-gorcunov@gmail.com> <20201210161832.729439-5-gorcunov@gmail.com> <738d0eec-6ce6-1f24-5d25-e143e96bdd68@tarantool.org> <20201212161947.GG544004@grain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201212161947.GG544004@grain> 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: Serge Petrenko Cc: Mons Anderson , tml , Vladislav Shpilevoy 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)); }