Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Egor Elchinov via Tarantool-patches
	<tarantool-patches@dev.tarantool.org>
Cc: Egor Elchinov <elchinov.es@gmail.com>
Subject: Re: [Tarantool-patches] [PATCH v2 4/4] fiber: refactor C backtrace and add changelog
Date: Mon, 12 Jul 2021 15:35:48 +0300	[thread overview]
Message-ID: <YOw3JJ6SVFAKW8hP@grain> (raw)
In-Reply-To: <fe6b73a52786c58fbe8151394c5662f8b67362d6.1625827535.git.elchinov.es@gmail.com>

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;

...

The rest looks ok to me, thanks!

  reply	other threads:[~2021-07-12 12:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-09 11:03 [Tarantool-patches] [PATCH v2 0/4] fiber: introduce creation backtrace Egor Elchinov via Tarantool-patches
2021-07-09 11:03 ` [Tarantool-patches] [PATCH v2 1/4] fiber: add PoC for fiber " Egor Elchinov via Tarantool-patches
2021-07-12 11:42   ` Cyrill Gorcunov via Tarantool-patches
2021-07-09 11:03 ` [Tarantool-patches] [PATCH v2 2/4] fiber: add option and PoC for Lua parent backtrace Egor Elchinov via Tarantool-patches
2021-07-12 12:09   ` Cyrill Gorcunov via Tarantool-patches
2021-07-14  9:29     ` Egor Elchinov via Tarantool-patches
2021-07-09 11:03 ` [Tarantool-patches] [PATCH v2 3/4] fiber: refactor lua backtrace routines Egor Elchinov via Tarantool-patches
2021-07-12 12:13   ` Cyrill Gorcunov via Tarantool-patches
2021-07-14  9:42     ` Egor Elchinov via Tarantool-patches
2021-07-09 11:03 ` [Tarantool-patches] [PATCH v2 4/4] fiber: refactor C backtrace and add changelog Egor Elchinov via Tarantool-patches
2021-07-12 12:35   ` Cyrill Gorcunov via Tarantool-patches [this message]
2021-07-14  9:42     ` Egor Elchinov via Tarantool-patches

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=YOw3JJ6SVFAKW8hP@grain \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=elchinov.es@gmail.com \
    --cc=gorcunov@gmail.com \
    --subject='Re: [Tarantool-patches] [PATCH v2 4/4] fiber: refactor C backtrace and add changelog' \
    /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