Tarantool development patches archive
 help / color / mirror / Atom feed
From: Georgy Kirichenko <georgy@tarantool.org>
To: tarantool-patches@freelists.org
Cc: Georgy Kirichenko <georgy@tarantool.org>
Subject: [tarantool-patches] [PATCH 2/3] Proper unwind for currently executing fiber
Date: Fri, 21 Sep 2018 16:20:54 +0300	[thread overview]
Message-ID: <7b844650e2e0799813e82b32ea2d637982bc3395.1537535602.git.georgy@tarantool.org> (raw)
In-Reply-To: <cover.1537535602.git.georgy@tarantool.org>

A fiber's coro context stores execution state for a corresponding
already yielded fiber. If fiber is on the execution then it hasn't
valid stored coro state and might be backtraced without a special unwind
context builder.
---
 src/backtrace.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/backtrace.cc b/src/backtrace.cc
index 2512bc045..70ed913e0 100644
--- a/src/backtrace.cc
+++ b/src/backtrace.cc
@@ -368,7 +368,10 @@ backtrace_foreach(backtrace_cb cb, coro_context *coro_ctx, void *cb_ctx)
 {
 	unw_cursor_t unw_cur;
 	unw_context_t unw_ctx;
-	coro_unwcontext(&unw_ctx, coro_ctx);
+	if (coro_ctx != NULL)
+		coro_unwcontext(&unw_ctx, coro_ctx);
+	else
+		unw_getcontext(&unw_ctx);
 	unw_init_local(&unw_cur, &unw_ctx);
 	int frame_no = 0;
 	unw_word_t sp = 0, old_sp = 0, ip, offset;
-- 
2.19.0

  parent reply	other threads:[~2018-09-21 13:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-21 13:20 [tarantool-patches] [PATCH 0/3] Dump lua frames for a fiber traceback Georgy Kirichenko
2018-09-21 13:20 ` [tarantool-patches] [PATCH 1/3] Set a lua state for the main fiber too Georgy Kirichenko
2018-09-25 23:27   ` [tarantool-patches] " Konstantin Osipov
2018-10-05 15:04   ` [tarantool-patches] " Vladimir Davydov
2018-09-21 13:20 ` Georgy Kirichenko [this message]
2018-09-25 23:34   ` [tarantool-patches] Re: [PATCH 2/3] Proper unwind for currently executing fiber Konstantin Osipov
2018-09-26  6:57     ` Georgy Kirichenko
2018-09-26 17:36       ` Konstantin Osipov
2018-10-04  7:44         ` [tarantool-patches] " Georgy Kirichenko
2018-10-04 22:27           ` [tarantool-patches] " Konstantin Osipov
2018-10-05 15:09           ` [tarantool-patches] " Vladimir Davydov
2018-09-21 13:20 ` [tarantool-patches] [PATCH 3/3] Show names of Lua functions in backtraces Georgy Kirichenko
2018-09-25 23:38   ` [tarantool-patches] " Konstantin Osipov
2018-10-04  7:55     ` [tarantool-patches] " Georgy Kirichenko
2018-10-04 22:28       ` [tarantool-patches] " Konstantin Osipov
2018-10-05 17:49       ` [tarantool-patches] " Vladimir Davydov
2018-10-10 16:39 [tarantool-patches] [PATCH v2 0/3] Dump lua frames for a fiber traceback Georgy Kirichenko
2018-10-10 16:39 ` [tarantool-patches] [PATCH 2/3] Proper unwind for currently executing fiber Georgy Kirichenko

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=7b844650e2e0799813e82b32ea2d637982bc3395.1537535602.git.georgy@tarantool.org \
    --to=georgy@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH 2/3] Proper unwind for currently executing fiber' \
    /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