public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@golang.org>
To: Rainer Orth <ro@cebitec.uni-bielefeld.de>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>, gofrontend-dev@googlegroups.com
Subject: Re: libgo patch committed: Add precise stack scan support
Date: Fri, 07 Dec 2018 14:23:00 -0000	[thread overview]
Message-ID: <CAKOQZ8zOFYQEy66gDYxFhgKYpNh+Zy5K01+x6z=7QMNWzumGbA@mail.gmail.com> (raw)
In-Reply-To: <yddr2et7ira.fsf@CeBiTec.Uni-Bielefeld.DE>

On Fri, Dec 7, 2018 at 2:07 AM Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
>
> > This libgo patch by Cherry Zhang adds support for precise stack
> > scanning to the Go runtime.  This uses per-function stack maps stored
> > in the exception tables in the language-specific data area.  The
> > compiler needs to generate these stack maps; currently this is only
> > done by a version of LLVM, not by GCC.  Each safepoint in a function
> > is associated with a (real or dummy) landing pad, and its "type info"
> > in the exception table is a pointer to the stack map. When a stack is
> > scanned, the stack map is found by the stack unwinding code.
> >
> > For precise stack scan we need to unwind the stack. There are three cases:
> >
> > - If a goroutine is scanning its own stack, it can unwind the stack
> > and scan the frames.
> >
> > - If a goroutine is scanning another, stopped, goroutine, it cannot
> > directly unwind the target stack. We handle this by switching
> > (runtime.gogo) to the target g, letting it unwind and scan the stack,
> > and switch back.
> >
> > - If we are scanning a goroutine that is blocked in a syscall, we send
> > a signal to the target goroutine's thread, and let the signal handler
> > unwind and scan the stack. Extra care is needed as this races with
> > enter/exit syscall.
> >
> > Currently this is only implemented on GNU/Linux.
> >
> > Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  Committed
> > to mainline.
>
> this broke Solaris (and other non-Linux) bootstrap:
>
> /vol/gcc/src/hg/trunk/local/libgo/go/runtime/stubs_nonlinux.go:20:1: error: missing return at end of function
>    20 | }
>       | ^
>
> Fixed by returning 0 for now, the return value is ignored in
> go/runtime/proc.go (scang) anyway.

Thanks.  Committed to mainline.

Ian

  reply	other threads:[~2018-12-07 14:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-05 23:10 Ian Lance Taylor
2018-12-07 10:07 ` Rainer Orth
2018-12-07 14:23   ` Ian Lance Taylor [this message]
2018-12-07 15:15     ` [gofrontend-dev] " Cherry Zhang via gcc-patches
2018-12-10  6:41 ` Matthias Klose
2018-12-10 15:54   ` [gofrontend-dev] " Cherry Zhang via gcc-patches
2018-12-11 14:52     ` Matthias Klose
2018-12-11 20:51       ` Ian Lance Taylor
2018-12-11 21:02         ` Cherry Zhang via gcc-patches
2018-12-12  0:03           ` Matthias Klose
2018-12-12 16:10             ` Cherry Zhang via gcc-patches
2018-12-12 23:27               ` Ian Lance Taylor
2018-12-19  3:24                 ` Matthias Klose
2018-12-26 20:42                   ` Cherry Zhang via gcc-patches
2018-12-27  9:42                     ` Ian Lance Taylor

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='CAKOQZ8zOFYQEy66gDYxFhgKYpNh+Zy5K01+x6z=7QMNWzumGbA@mail.gmail.com' \
    --to=iant@golang.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gofrontend-dev@googlegroups.com \
    --cc=ro@cebitec.uni-bielefeld.de \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).