[Tarantool-patches] [PATCH v4 4/4] crash: report crash data to the feedback server

Cyrill Gorcunov gorcunov at gmail.com
Sat Dec 12 20:07:34 MSK 2020


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));
	}



More information about the Tarantool-patches mailing list