Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Sergey Kaplun <skaplun@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org,
	Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH] refactoring: drop excess 16Kb bss buffer
Date: Thu, 9 Jan 2020 23:18:57 +0300	[thread overview]
Message-ID: <20200109201857.GG2436@uranus> (raw)
In-Reply-To: <20200109201533.GF2436@uranus>

On Thu, Jan 09, 2020 at 11:15:33PM +0300, Cyrill Gorcunov wrote:
...
> > @@ -140,8 +139,9 @@ backtrace()
> >  	unw_getcontext(&unw_context);
> >  	unw_cursor_t unw_cur;
> >  	unw_init_local(&unw_cur, &unw_context);
> > +	char *backtrace_buf = (char *)static_alloc(SMALL_STATIC_SIZE);
> >  	char *p = backtrace_buf;
> > -	char *end = p + sizeof(backtrace_buf) - 1;
> > +	char *end = p + SMALL_STATIC_SIZE - 1;
> >  	int unw_status;
> >  	*p = '\0';
> >  	while ((unw_status = unw_step(&unw_cur)) > 0) {
> 
> static_alloc has all rights to return NULL, thus you better add
> a test at least.
> 
> NAK for a while

Surely it should not fail for this exact size such as SMALL_STATIC_SIZE,
still the situation may change at future, so as a minimum we need
some kind of assert(backtrace_buf != NULL);

  reply	other threads:[~2020-01-09 20:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-09 20:06 Sergey Kaplun
2020-01-09 20:15 ` Cyrill Gorcunov
2020-01-09 20:18   ` Cyrill Gorcunov [this message]
2020-01-13 22:00 ` Vladislav Shpilevoy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200109201857.GG2436@uranus \
    --to=gorcunov@gmail.com \
    --cc=skaplun@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] refactoring: drop excess 16Kb bss buffer' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox