From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114190 invoked by alias); 7 Dec 2018 15:15:05 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 114089 invoked by uid 89); 7 Dec 2018 15:15:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.9 required=5.0 tests=BAYES_00,ENV_AND_HDR_SPF_MATCH,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,UNSUBSCRIBE_BODY,USER_IN_DEF_SPF_WL autolearn=no version=3.3.2 spammy=Groups, U*unsubscribe, lance, Lance X-HELO: mail-yb1-f179.google.com Received: from mail-yb1-f179.google.com (HELO mail-yb1-f179.google.com) (209.85.219.179) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Dec 2018 15:15:00 +0000 Received: by mail-yb1-f179.google.com with SMTP id f4so1893130ybq.4 for ; Fri, 07 Dec 2018 07:14:59 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "Cherry Zhang via gcc-patches" Reply-To: Cherry Zhang Date: Fri, 07 Dec 2018 15:15:00 -0000 Message-ID: Subject: Re: [gofrontend-dev] Re: libgo patch committed: Add precise stack scan support To: Ian Taylor Cc: ro@cebitec.uni-bielefeld.de, gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-12/txt/msg00467.txt.bz2 Sorry about the breakage. Thanks for the patch. On Fri, Dec 7, 2018 at 9:23 AM Ian Lance Taylor wrote: > On Fri, Dec 7, 2018 at 2:07 AM Rainer Orth > 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 > > -- > You received this message because you are subscribed to the Google Groups > "gofrontend-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to gofrontend-dev+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. >