From patchwork Fri Mar 30 22:43:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 149763 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 75698B6FA3 for ; Sat, 31 Mar 2012 09:43:42 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1333752222; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:From:To:Subject:Date:Message-ID:User-Agent: MIME-Version:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=h4p88qV2VRrkHpkzJyOcUGfkrKg=; b=LJ9f15TWS/ka2Yz yTyoCL0UWwOHqhIgENDqPGSn1V/r6ZXcO50eGw5uFoIeGlO440Chkfgyzxtiw3hE NXHxDG7ayhWv4mGYGJNyhRfuH8gJHwAAgKpi3Uh9qUQGGcr5hcDQfV7jJ1HcmBlV F7wIUy+kebotD0kFnbSZLTIJlLeY= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=h+vzFqJdtSI9KvsgEDtaMi/mFMnIKm8YmHWV2r8v3OqHWVrxDFF2/q4QpkX1f6 xcEHn0+7UHGsY7QW/p0EhgJzkkJFq5rXDcBGhYp2nYII+Sbdf++p2xVposLXdd8M WWxm1rWCTfFwtqvg0HC5YANheX14ViwBmtKvDGBnA5398=; Received: (qmail 3204 invoked by alias); 30 Mar 2012 22:43:35 -0000 Received: (qmail 3193 invoked by uid 22791); 30 Mar 2012 22:43:32 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_CV, TW_FL, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from mail-iy0-f175.google.com (HELO mail-iy0-f175.google.com) (209.85.210.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 30 Mar 2012 22:43:13 +0000 Received: by iaag37 with SMTP id g37so1706011iaa.20 for ; Fri, 30 Mar 2012 15:43:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-type:x-gm-message-state; bh=SIgmjjM4wnh7/dHJKGaXPDRBfJ0fbnpbEo3ErgCZTbA=; b=cLUVGfPekwKZxjbvht/xlReGgf7KOn0DmA8UaSQaOEL767UsqFQuxji5kk+O4Lxuti JCAscNCfJ0Dk3jocQJAQ0UTQbwAjKanSW46rFunYPpC5Q7E86w0XwzoJR74RO1HnoHyu JB3NdXAkDXdHIRZqweWo1kNi16X+Yc4Cwx3bAas57mx7B6zsyxk8fwqUyOvHqvtsFJXw tS4cZ2wPRfdLOtD08FSMuYru3nqdKX79w+4WZK/1S5rlyHRF2vTZk5m/5eY86N7VRMf0 27jlOjEqaVzRi3gg1nhAaZ7i5FqKAbuFa9HmoM/NSDTEd3W3nlv1hc7IU3lUXWEsTs3L RP2w== Received: by 10.50.153.132 with SMTP id vg4mr147207igb.2.1333147392515; Fri, 30 Mar 2012 15:43:12 -0700 (PDT) Received: by 10.50.153.132 with SMTP id vg4mr147200igb.2.1333147392414; Fri, 30 Mar 2012 15:43:12 -0700 (PDT) Received: from coign.google.com ([2620:0:1000:2301:f2de:f1ff:fe40:72a8]) by mx.google.com with ESMTPS id k8sm3524742igz.4.2012.03.30.15.43.11 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 30 Mar 2012 15:43:11 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: libgo patch committed: Update to weekly.2012-03-27 release Date: Fri, 30 Mar 2012 15:43:10 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmD0wCjK7dppCsBuqzvG6rDOP6uM+oGNflpNFgxeEV+toGWPL/eRC7G+RawwnBuKy69MqIOU0jjEzMHQg2SOUv3Pk3MbM7VwEqmjYlB3/x2UaxOBcyEh8sbcsbOjbN1WPo+YWEvVmTkE6Pra9f0MgP5ODTe7oijxOGKWn44hb0UsEP+v00= X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org I have committed a patch to libgo to update to the weekly.2012-03-27 release. This brings libgo up to the Go 1 standard release. This patch is small enough to include in this e-mail message in its entirety. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline and 4.7 branch. Ian diff -r b8be815d3dea libgo/MERGE --- a/libgo/MERGE Fri Mar 30 15:03:47 2012 -0700 +++ b/libgo/MERGE Fri Mar 30 15:24:14 2012 -0700 @@ -1,4 +1,4 @@ -bce220d03774 +dc5e410f0b4c The first line of this file holds the Mercurial revision number of the last merge done from the master library sources. diff -r b8be815d3dea libgo/go/crypto/tls/handshake_server.go --- a/libgo/go/crypto/tls/handshake_server.go Fri Mar 30 15:03:47 2012 -0700 +++ b/libgo/go/crypto/tls/handshake_server.go Fri Mar 30 15:24:14 2012 -0700 @@ -60,21 +60,23 @@ for _, id := range clientHello.cipherSuites { for _, supported := range config.cipherSuites() { if id == supported { - suite = nil + var candidate *cipherSuite + for _, s := range cipherSuites { if s.id == id { - suite = s + candidate = s break } } - if suite == nil { + if candidate == nil { continue } // Don't select a ciphersuite which we can't // support for this client. - if suite.elliptic && !ellipticOk { + if candidate.elliptic && !ellipticOk { continue } + suite = candidate break FindCipherSuite } } diff -r b8be815d3dea libgo/go/crypto/tls/key_agreement.go --- a/libgo/go/crypto/tls/key_agreement.go Fri Mar 30 15:03:47 2012 -0700 +++ b/libgo/go/crypto/tls/key_agreement.go Fri Mar 30 15:24:14 2012 -0700 @@ -130,6 +130,10 @@ } } + if curveid == 0 { + return nil, errors.New("tls: no supported elliptic curves offered") + } + var x, y *big.Int var err error ka.privateKey, x, y, err = elliptic.GenerateKey(ka.curve, config.rand()) diff -r b8be815d3dea libgo/go/exp/gotype/gotype.go --- a/libgo/go/exp/gotype/gotype.go Fri Mar 30 15:03:47 2012 -0700 +++ b/libgo/go/exp/gotype/gotype.go Fri Mar 30 15:24:14 2012 -0700 @@ -171,7 +171,7 @@ func processPackage(fset *token.FileSet, files map[string]*ast.File) { // make a package (resolve all identifiers) - pkg, err := ast.NewPackage(fset, files, types.GcImporter, types.Universe) + pkg, err := ast.NewPackage(fset, files, types.GcImport, types.Universe) if err != nil { report(err) return diff -r b8be815d3dea libgo/go/exp/types/check_test.go --- a/libgo/go/exp/types/check_test.go Fri Mar 30 15:03:47 2012 -0700 +++ b/libgo/go/exp/types/check_test.go Fri Mar 30 15:24:14 2012 -0700 @@ -184,7 +184,7 @@ eliminate(t, errors, err) // verify errors returned after resolving identifiers - pkg, err := ast.NewPackage(fset, files, GcImporter, Universe) + pkg, err := ast.NewPackage(fset, files, GcImport, Universe) eliminate(t, errors, err) // verify errors returned by the typechecker diff -r b8be815d3dea libgo/go/exp/types/exportdata.go --- a/libgo/go/exp/types/exportdata.go Fri Mar 30 15:03:47 2012 -0700 +++ b/libgo/go/exp/types/exportdata.go Fri Mar 30 15:24:14 2012 -0700 @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// This file implements ExportData. +// This file implements FindGcExportData. package types @@ -11,15 +11,14 @@ "errors" "fmt" "io" - "os" "strconv" "strings" ) -func readGopackHeader(buf *bufio.Reader) (name string, size int, err error) { +func readGopackHeader(r *bufio.Reader) (name string, size int, err error) { // See $GOROOT/include/ar.h. hdr := make([]byte, 16+12+6+6+8+10+2) - _, err = io.ReadFull(buf, hdr) + _, err = io.ReadFull(r, hdr) if err != nil { return } @@ -36,33 +35,14 @@ return } -type dataReader struct { - *bufio.Reader - io.Closer -} - -// ExportData returns a readCloser positioned at the beginning of the -// export data section of the given object/archive file, or an error. -// It is the caller's responsibility to close the readCloser. +// FindGcExportData positions the reader r at the beginning of the +// export data section of an underlying GC-created object/archive +// file by reading from it. The reader must be positioned at the +// start of the file before calling this function. // -func ExportData(filename string) (rc io.ReadCloser, err error) { - file, err := os.Open(filename) - if err != nil { - return - } - - defer func() { - if err != nil { - file.Close() - // Add file name to error. - err = fmt.Errorf("reading export data: %s: %v", filename, err) - } - }() - - buf := bufio.NewReader(file) - +func FindGcExportData(r *bufio.Reader) (err error) { // Read first line to make sure this is an object file. - line, err := buf.ReadSlice('\n') + line, err := r.ReadSlice('\n') if err != nil { return } @@ -74,7 +54,7 @@ // First entry should be __.SYMDEF. // Read and discard. - if name, size, err = readGopackHeader(buf); err != nil { + if name, size, err = readGopackHeader(r); err != nil { return } if name != "__.SYMDEF" { @@ -88,15 +68,14 @@ if n > block { n = block } - _, err = io.ReadFull(buf, tmp[:n]) - if err != nil { + if _, err = io.ReadFull(r, tmp[:n]); err != nil { return } size -= n } // Second entry should be __.PKGDEF. - if name, size, err = readGopackHeader(buf); err != nil { + if name, size, err = readGopackHeader(r); err != nil { return } if name != "__.PKGDEF" { @@ -106,8 +85,7 @@ // Read first line of __.PKGDEF data, so that line // is once again the first line of the input. - line, err = buf.ReadSlice('\n') - if err != nil { + if line, err = r.ReadSlice('\n'); err != nil { return } } @@ -122,12 +100,10 @@ // Skip over object header to export data. // Begins after first line with $$. for line[0] != '$' { - line, err = buf.ReadSlice('\n') - if err != nil { + if line, err = r.ReadSlice('\n'); err != nil { return } } - rc = &dataReader{buf, file} return } diff -r b8be815d3dea libgo/go/exp/types/gcimporter.go --- a/libgo/go/exp/types/gcimporter.go Fri Mar 30 15:03:47 2012 -0700 +++ b/libgo/go/exp/types/gcimporter.go Fri Mar 30 15:24:14 2012 -0700 @@ -2,12 +2,13 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// This file implements an ast.Importer for gc generated object files. +// This file implements an ast.Importer for gc-generated object files. // TODO(gri) Eventually move this into a separate package outside types. package types import ( + "bufio" "errors" "fmt" "go/ast" @@ -24,41 +25,40 @@ const trace = false // set to true for debugging -var ( - pkgExts = [...]string{".a", ".5", ".6", ".8"} -) +var pkgExts = [...]string{".a", ".5", ".6", ".8"} -// findPkg returns the filename and package id for an import path. +// FindPkg returns the filename and unique package id for an import +// path based on package information provided by build.Import (using +// the build.Default build.Context). // If no file was found, an empty filename is returned. -func findPkg(path string) (filename, id string) { +// +func FindPkg(path, srcDir string) (filename, id string) { if len(path) == 0 { return } id = path var noext string - switch path[0] { + switch { default: // "x" -> "$GOPATH/pkg/$GOOS_$GOARCH/x.ext", "x" - bp, _ := build.Import(path, "", build.FindOnly) + bp, _ := build.Import(path, srcDir, build.FindOnly) if bp.PkgObj == "" { return } noext = bp.PkgObj if strings.HasSuffix(noext, ".a") { - noext = noext[:len(noext)-2] + noext = noext[:len(noext)-len(".a")] } - case '.': + case build.IsLocalImport(path): // "./x" -> "/this/directory/x.ext", "/this/directory/x" - cwd, err := os.Getwd() - if err != nil { - return - } - noext = filepath.Join(cwd, path) + noext = filepath.Join(srcDir, path) id = noext - case '/': + case filepath.IsAbs(path): + // for completeness only - go/build.Import + // does not support absolute imports // "/x" -> "/x.ext", "/x" noext = path } @@ -75,6 +75,89 @@ return } +// GcImportData imports a package by reading the gc-generated export data, +// adds the corresponding package object to the imports map indexed by id, +// and returns the object. +// +// The imports map must contains all packages already imported, and no map +// entry with id as the key must be present. The data reader position must +// be the beginning of the export data section. The filename is only used +// in error messages. +// +func GcImportData(imports map[string]*ast.Object, filename, id string, data *bufio.Reader) (pkg *ast.Object, err error) { + if trace { + fmt.Printf("importing %s (%s)\n", id, filename) + } + + if imports[id] != nil { + panic(fmt.Sprintf("package %s already imported", id)) + } + + // support for gcParser error handling + defer func() { + if r := recover(); r != nil { + err = r.(importError) // will re-panic if r is not an importError + } + }() + + var p gcParser + p.init(filename, id, data, imports) + pkg = p.parseExport() + + return +} + +// GcImport imports a gc-generated package given its import path, adds the +// corresponding package object to the imports map, and returns the object. +// Local import paths are interpreted relative to the current working directory. +// The imports map must contains all packages already imported. +// GcImport satisfies the ast.Importer signature. +// +func GcImport(imports map[string]*ast.Object, path string) (pkg *ast.Object, err error) { + if path == "unsafe" { + return Unsafe, nil + } + + srcDir, err := os.Getwd() + if err != nil { + return + } + filename, id := FindPkg(path, srcDir) + if filename == "" { + err = errors.New("can't find import: " + id) + return + } + + if pkg = imports[id]; pkg != nil { + return // package was imported before + } + + // open file + f, err := os.Open(filename) + if err != nil { + return + } + defer func() { + f.Close() + if err != nil { + // Add file name to error. + err = fmt.Errorf("reading export data: %s: %v", filename, err) + } + }() + + buf := bufio.NewReader(f) + if err = FindGcExportData(buf); err != nil { + return + } + + pkg, err = GcImportData(imports, filename, id, buf) + + return +} + +// ---------------------------------------------------------------------------- +// gcParser + // gcParser parses the exports inside a gc compiler-produced // object/archive file and populates its scope with the results. type gcParser struct { @@ -109,47 +192,6 @@ } } -// GcImporter implements the ast.Importer signature. -func GcImporter(imports map[string]*ast.Object, path string) (pkg *ast.Object, err error) { - if path == "unsafe" { - return Unsafe, nil - } - - defer func() { - if r := recover(); r != nil { - err = r.(importError) // will re-panic if r is not an importError - if trace { - panic(err) // force a stack trace - } - } - }() - - filename, id := findPkg(path) - if filename == "" { - err = errors.New("can't find import: " + id) - return - } - - if pkg = imports[id]; pkg != nil { - return // package was imported before - } - - buf, err := ExportData(filename) - if err != nil { - return - } - defer buf.Close() - - if trace { - fmt.Printf("importing %s (%s)\n", id, filename) - } - - var p gcParser - p.init(filename, id, buf, imports) - pkg = p.parseExport() - return -} - // Declare inserts a named object of the given kind in scope. func (p *gcParser) declare(scope *ast.Scope, kind ast.ObjKind, name string) *ast.Object { // the object may have been imported before - if it exists @@ -707,7 +749,6 @@ p.next() typ = String.Underlying default: - println(p.tok) p.errorf("expected literal got %s", scanner.TokenString(p.tok)) } if obj.Type == nil { diff -r b8be815d3dea libgo/go/exp/types/gcimporter_test.go --- a/libgo/go/exp/types/gcimporter_test.go Fri Mar 30 15:03:47 2012 -0700 +++ b/libgo/go/exp/types/gcimporter_test.go Fri Mar 30 15:24:14 2012 -0700 @@ -17,23 +17,23 @@ "time" ) -var gcName, gcPath string // compiler name and path +var gcPath string // Go compiler path func init() { // determine compiler + var gc string switch runtime.GOARCH { case "386": - gcName = "8g" + gc = "8g" case "amd64": - gcName = "6g" + gc = "6g" case "arm": - gcName = "5g" + gc = "5g" default: - gcName = "unknown-GOARCH-compiler" - gcPath = gcName + gcPath = "unknown-GOARCH-compiler" return } - gcPath = filepath.Join(build.ToolDir, gcName) + gcPath = filepath.Join(build.ToolDir, gc) } func compile(t *testing.T, dirname, filename string) { @@ -41,7 +41,7 @@ cmd.Dir = dirname out, err := cmd.CombinedOutput() if err != nil { - t.Errorf("%s %s failed: %s", gcName, filename, err) + t.Errorf("%s %s failed: %s", gcPath, filename, err) return } t.Logf("%s", string(out)) @@ -52,7 +52,7 @@ var imports = make(map[string]*ast.Object) func testPath(t *testing.T, path string) bool { - _, err := GcImporter(imports, path) + _, err := GcImport(imports, path) if err != nil { t.Errorf("testPath(%s): %s", path, err) return false diff -r b8be815d3dea libgo/go/go/build/build.go --- a/libgo/go/go/build/build.go Fri Mar 30 15:03:47 2012 -0700 +++ b/libgo/go/go/build/build.go Fri Mar 30 15:24:14 2012 -0700 @@ -210,7 +210,6 @@ // if set, or else the compiled code's GOARCH, GOOS, and GOROOT. var Default Context = defaultContext() -// This list is also known to ../../../cmd/dist/build.c. var cgoEnabled = map[string]bool{ "darwin/386": true, "darwin/amd64": true, @@ -388,7 +387,7 @@ // but check that using it wouldn't find something // else first. if ctxt.GOROOT != "" { - if dir := ctxt.joinPath(ctxt.GOROOT, "src", sub); ctxt.isDir(dir) { + if dir := ctxt.joinPath(ctxt.GOROOT, "src", "pkg", sub); ctxt.isDir(dir) { goto Found } } diff -r b8be815d3dea libgo/go/image/image.go --- a/libgo/go/image/image.go Fri Mar 30 15:03:47 2012 -0700 +++ b/libgo/go/image/image.go Fri Mar 30 15:24:14 2012 -0700 @@ -18,7 +18,7 @@ // initialization side effects. // // See "The Go image package" for more details: -// http://blog.golang.org/2011/09/go-image-package.html +// http://golang.org/doc/articles/image_package.html package image import ( diff -r b8be815d3dea libgo/go/net/fd.go --- a/libgo/go/net/fd.go Fri Mar 30 15:03:47 2012 -0700 +++ b/libgo/go/net/fd.go Fri Mar 30 15:24:14 2012 -0700 @@ -623,6 +623,10 @@ continue } } + } else if err == syscall.ECONNABORTED { + // This means that a socket on the listen queue was closed + // before we Accept()ed it; it's a silly error, so try again. + continue } return nil, &OpError{"accept", fd.net, fd.laddr, err} } diff -r b8be815d3dea libgo/go/os/types.go --- a/libgo/go/os/types.go Fri Mar 30 15:03:47 2012 -0700 +++ b/libgo/go/os/types.go Fri Mar 30 15:24:14 2012 -0700 @@ -58,7 +58,7 @@ func (m FileMode) String() string { const str = "dalTLDpSugct" - var buf [20]byte + var buf [32]byte // Mode is uint32. w := 0 for i, c := range str { if m&(1< uint32(len(b)) { + b = make([]uint16, n) + n, err = syscall.GetShortPathName(&p[0], &b[0], uint32(len(b))) + if err != nil { + return "", err + } + } + return syscall.UTF16ToString(b), nil +} + +func toLong(path string) (string, error) { p := syscall.StringToUTF16(path) b := p // GetLongPathName says we can reuse buffer n, err := syscall.GetLongPathName(&p[0], &b[0], uint32(len(b))) @@ -23,5 +40,24 @@ } } b = b[:n] - return Clean(syscall.UTF16ToString(b)), nil + return syscall.UTF16ToString(b), nil } + +func evalSymlinks(path string) (string, error) { + p, err := toShort(path) + if err != nil { + return "", err + } + p, err = toLong(p) + if err != nil { + return "", err + } + // syscall.GetLongPathName does not change the case of the drive letter, + // but the result of EvalSymlinks must be unique, so we have + // EvalSymlinks(`c:\a`) == EvalSymlinks(`C:\a`). + // Make drive letter upper case. + if len(p) >= 2 && p[1] == ':' && 'a' <= p[0] && p[0] <= 'z' { + p = string(p[0]+'A'-'a') + p[1:] + } + return Clean(p), nil +} diff -r b8be815d3dea libgo/go/text/template/doc.go --- a/libgo/go/text/template/doc.go Fri Mar 30 15:03:47 2012 -0700 +++ b/libgo/go/text/template/doc.go Fri Mar 30 15:24:14 2012 -0700 @@ -244,7 +244,7 @@ During execution functions are found in two function maps: first in the template, then in the global function map. By default, no functions are defined -in the template but the Funcs methods can be used to add them. +in the template but the Funcs method can be used to add them. Predefined global functions are named as follows. diff -r b8be815d3dea libgo/runtime/proc.c --- a/libgo/runtime/proc.c Fri Mar 30 15:03:47 2012 -0700 +++ b/libgo/runtime/proc.c Fri Mar 30 15:24:14 2012 -0700 @@ -448,6 +448,11 @@ // roots. mstats.enablegc = 1; + // The deadlock detection has false negatives. + // Let scvg start up, to eliminate the false negative + // for the trivial program func main() { select{} }. + runtime_gosched(); + main_main(); runtime_exit(0); for(;;) @@ -795,6 +800,20 @@ } // Look for deadlock situation. + // There is a race with the scavenger that causes false negatives: + // if the scavenger is just starting, then we have + // scvg != nil && grunning == 0 && gwait == 0 + // and we do not detect a deadlock. It is possible that we should + // add that case to the if statement here, but it is too close to Go 1 + // to make such a subtle change. Instead, we work around the + // false negative in trivial programs by calling runtime.gosched + // from the main goroutine just before main.main. + // See runtime_main above. + // + // On a related note, it is also possible that the scvg == nil case is + // wrong and should include gwait, but that does not happen in + // standard Go programs, which all start the scavenger. + // if((scvg == nil && runtime_sched.grunning == 0) || (scvg != nil && runtime_sched.grunning == 1 && runtime_sched.gwait == 0 && (scvg->status == Grunning || scvg->status == Gsyscall))) {