]> Cypherpunks.ru repositories - gostls13.git/commitdiff
[dev.fuzz] all: merge master (dd7ba3b) into dev.fuzz
authorKatie Hockman <katie@golang.org>
Wed, 2 Jun 2021 22:37:38 +0000 (18:37 -0400)
committerKatie Hockman <katie@golang.org>
Wed, 2 Jun 2021 22:39:15 +0000 (22:39 +0000)
Merge List:

+ 2021-06-02 dd7ba3ba2c net: don't rely on system hosts in TestCVE202133195
+ 2021-06-02 4f572d7076 io/fs: minor corrections to Sub docs
+ 2021-06-02 e11d14225c doc/go1.17: remove runtime section
+ 2021-06-02 6e189afd3e doc/go1.17: mention SYS_WAIT6/WEXITED on NetBSD
+ 2021-06-02 ff9f5fb859 cmd/link: recognize clang linker error in testCGOLTO
+ 2021-06-02 1c6a2ea2ea doc/go1.17: document time changes for Go1.17
+ 2021-06-02 d743e67e06 doc/go1.17: document flag changes for Go 1.17
+ 2021-06-02 dc8f87b749 runtime/internal/sys: generate //go:build lines in gengoos.go
+ 2021-06-02 84c0e5d47f cmd/link: move issue 43830 tests out of TestScript
+ 2021-06-02 cae68700cc runtime: fix formatting
+ 2021-06-01 567ee865f6 cmd/go: add declaration to cgo_lto_issue43830 test
+ 2021-06-01 24e9707cbf cmd/link, cmd/cgo: support -flto in CFLAGS
+ 2021-06-01 272552275f A+C: update name
+ 2021-06-01 2bec019fb5 doc/go1.17: add release notes for register ABI
+ 2021-06-01 2e59cc5fb4 cmd/go: add [-src] to documentation
+ 2021-06-01 0b80cf1136 cmd/go: make 'go get' save sums for incidentally updated modules
+ 2021-05-30 3b770f2ccb go/types: don't declare 'comparable' when typeparams are disabled
+ 2021-05-30 1607c28172 go/types: unexport the GoVersion configuration option for Go 1.17
+ 2021-05-29 79bda65041 doc/go1.17: mention time.Layout
+ 2021-05-29 f6cc392d1d doc/go1.17: document text/template/parse.SkipFuncCheck
+ 2021-05-28 1419ca7cea doc/go1.17: mention new definitions of MSG_CMSG_CLOEXEC
+ 2021-05-28 6624771c83 doc/go1.17: mention testing.[TB].Setenv methods
+ 2021-05-28 bbda923592 doc/go1.17: mention new Windows SysProcAttr fields
+ 2021-05-28 6f58088bd8 doc/go1.17: document new go/build/BuildContext.ToolTags field
+ 2021-05-28 c295107708 doc/go1.17: mention new encoding/csv/Reader.FieldPos method
+ 2021-05-28 ccd9784edf doc/go1.17: document new debug/elf constant
+ 2021-05-28 3de3440fb9 go/ast: remove FuncDecl.IsMethod for Go 1.17
+ 2021-05-27 639acdc833 doc/go1.17: clarify that compress/lzw Reader and Writer types are new
+ 2021-05-27 193d514131 net/http: correct Client.Do doc about context cancelation
+ 2021-05-27 ab2ef4aaa7 doc/go1.17: document reflect changes
+ 2021-05-27 0ece95a0fe cmd/go: don't let 'go mod download' save sums for inconsistent requirements
+ 2021-05-27 cdcd02842d net: verify results from Lookup* are valid domain names
+ 2021-05-27 8bf5bf5173 cmd/compile: improve debug locations for partially live in-params
+ 2021-05-27 56af34f875 cmd/compile: place reg spills after OpArg{Int,Float}Reg ops
+ 2021-05-27 db66e9e15d cmd/link: accept Windows line-ending in TestTrampolineCgo
+ 2021-05-27 6b8c94b6c5 go/types: guard against check==nil in newNamed
+ 2021-05-27 fca7b8f3e6 Revert "net: verify results from Lookup* are valid domain names"
+ 2021-05-27 950fa11c4c net/http/httputil: always remove hop-by-hop headers
+ 2021-05-27 9bc52686da cmd/go,cmd/link: do not check for staleness in most tests
+ 2021-05-27 6ff0ae2aa4 crypto/elliptic: fix typo in p521Point type name
+ 2021-05-26 3075ffc93e os: deflake TestFdReadRace
+ 2021-05-26 a62c08734f src/os: revert accidentally submitted change
+ 2021-05-26 1d5298d46a doc/go1.17: document net/... changes
+ 2021-05-26 0fbecece98 doc/go1.17: document syscall changes
+ 2021-05-26 02beecb397 mime: document use of the Shared MIME-Info Database
+ 2021-05-26 a92460fd2f doc/go1.17: add release notes for runtime/metrics package
+ 2021-05-26 55aefbb268 doc/go1.17: mention enabling frame pointer on all ARM64
+ 2021-05-26 39da9ae513 go/types: ensure that Named.check is nilled out once it is expanded
+ 2021-05-26 bfd7798a6c runtime,cmd/link/internal/ld: fix typos
+ 2021-05-26 e4615ad74d math/big: move division into natdiv.go
+ 2021-05-26 d050238bb6 doc/go1.17: fix formatting for time changes
+ 2021-05-25 74242baa41 archive/zip: only preallocate File slice if reasonably sized
+ 2021-05-25 f22ec51deb doc: add Go 1.17 release note about inlining functions with closures
+ 2021-05-25 8b462d7567 cmd/go: add a -compat flag to 'go mod tidy'
+ 2021-05-24 c89f1224a5 net: verify results from Lookup* are valid domain names
+ 2021-05-24 08a8fa9c47 misc/wasm: ensure correct stack pointer in catch clauses
+ 2021-05-24 32b73ae180 cmd/go: align checks of module path during initialization.
+ 2021-05-24 15d9d4a009 cmd/go: add tests illustrating what happens when Go 1.16 is used in a Go 1.17 main module
+ 2021-05-24 873401df5b cmd/compile: ensure equal functions don't do unaligned loads
+ 2021-05-24 b83610699a cmd/compile: record regabi status in DW_AT_producer
+ 2021-05-24 a22e317220 cmd/compile: always include underlying type for map types
+ 2021-05-24 4356e7e85f runtime: account for spill slots in Windows callback compilation
+ 2021-05-24 52d7033ff6 cmd/go/internal/modload: set the default GoVersion in a single location
+ 2021-05-24 05819bc104 cmd/go/internal/modcmd: factor out a type for flags whose arguments are Go versions
+ 2021-05-22 cca23a7373 cmd/compile: revert CL/316890
+ 2021-05-21 f87194cbd7 doc/go1.17: document changes to net/http package
+ 2021-05-21 217f5dd496 doc: document additional atomic.Value methods
+ 2021-05-21 3c656445f1 cmd/go: in TestScript/mod_replace, download an explicit module path
+ 2021-05-21 76b2d6afed os: document that StartProcess puts files into blocking mode
+ 2021-05-21 e4d7525c3e cmd/dist: display first class port status in json output
+ 2021-05-21 4fb10b2118 cmd/go: in 'go mod download' without args, don't save module zip sums
+ 2021-05-21 4fda54ce3f doc/go1.17: document database/sql changes for Go 1.17
+ 2021-05-21 8876b9bd6a doc/go1.17: document io/fs changes for Go 1.17
+ 2021-05-21 5fee772c87 doc/go1.17: document archive/zip changes for Go 1.17
+ 2021-05-21 3148694f60 cmd/go: remove warning from module deprecation notice printing
+ 2021-05-21 7e63c8b765 runtime: wait for Go runtime to initialize in Windows signal test
+ 2021-05-21 831573cd21 io/fs: added an example for io/fs.WalkDir
+ 2021-05-20 baa934d26d cmd: go get golang.org/x/tools/analysis@49064d23 && go mod vendor
+ 2021-05-20 7c692cc7ea doc/go1.17: document changes to os package
+ 2021-05-20 ce9a3b79d5 crypto/x509: add new FreeBSD 12.2+ trusted certificate folder
+ 2021-05-20 f8be906d74 test: re-enable test on riscv64 now that it supports external linking
+ 2021-05-20 def5360541 doc/go1.17: add release notes for OpenBSD ports
+ 2021-05-20 ef1f52cc38 doc/go1.17: add release note for windows/arm64 port
+ 2021-05-20 bb7495a46d doc/go1.17: document new math constants
+ 2021-05-20 f07e4dae3c syscall: document NewCallback and NewCallbackCDecl limitations
+ 2021-05-20 a8d85918b6 misc/cgo/testplugin: skip TestIssue25756pie on darwin/arm64 builder
+ 2021-05-19 6c1c055d1e cmd/internal/moddeps: use filepath.SkipDir only on directories
+ 2021-05-19 658b5e66ec net: return nil UDPAddr from ReadFromUDP
+ 2021-05-19 15a374d5c1 test: check portable error message on issue46234.go
+ 2021-05-18 eeadce2d87 go/build/constraint: fix parsing of "// +build" (with no args)
+ 2021-05-18 6d2ef2ef2a cmd/compile: don't emit inltree for closure within body of inlined func
+ 2021-05-18 048cb4ceee crypto/x509: remove duplicate import
+ 2021-05-18 690a8c3fb1 make.bash: fix misuse of continue
+ 2021-05-18 8b0901fd32 doc/go1.17: fix typo "avoding" -> "avoiding"
+ 2021-05-18 5e191f8f48 time: rewrite the documentation for layout strings
+ 2021-05-17 bfe3573d58 go/token: correct the interval notation used in some panic messages
+ 2021-05-17 a2c07a9a1a all: update golang.org/x/net to latest
+ 2021-05-17 b9b2bed893 syscall: some containers may fail syscall.TestSetuidEtc
+ 2021-05-17 b1aff42900 cmd/go: don't print 'go get' deprecation notices in the main module
+ 2021-05-17 bade680867 runtime/cgo: fix crosscall2 on ppc64x
+ 2021-05-15 ce92a2023c cmd/go: error out of 'go mod tidy' if the go version is newer than supported
+ 2021-05-14 02699f810a runtime: mark osyield nosplit on OpenBSD
+ 2021-05-14 3d324f127d net/http: prevent infinite wait during TestMissingStatusNoPanic
+ 2021-05-14 0eb38f2b16 cmd/go/internal/load: override Package.Root in module mode
+ 2021-05-14 a938e52986 cmd/go: fix a portability issue in the cd script command

Change-Id: I72e621368c4435396eb727d40287d1e318505308

1  2 
src/cmd/go/alldocs.go
src/cmd/go/internal/load/pkg.go
src/cmd/link/internal/ld/data.go

diff --combined src/cmd/go/alldocs.go
index 2a439bd904822022bcb4e6ac879f86c20b277d3c,ab61017c4eb5598acfd00af405267027a5de5f2f..0655153969ee0883d2722d89d5b1e359caa250d9
@@@ -53,7 -53,6 +53,7 @@@
  //    private         configuration for downloading non-public code
  //    testflag        testing flags
  //    testfunc        testing functions
 +//    fuzz            fuzzing
  //    vcs             controlling version control with GOVCS
  //
  // Use "go help <topic>" for more information about that topic.
  // download cache, including unpacked source code of versioned
  // dependencies.
  //
 +// The -fuzzcache flag causes clean to remove values used for fuzz testing.
 +//
  // For more about build flags, see 'go help build'.
  //
  // For more about specifying packages, see 'go help packages'.
  //
  // Usage:
  //
- //    go doc [-u] [-c] [package|[package.]symbol[.methodOrField]]
+ //    go doc [doc flags] [package|[package.]symbol[.methodOrField]]
  //
  // Doc prints the documentation comments associated with the item identified by its
  // arguments (a package, const, func, type, var, method, or struct field)
  //
  // Usage:
  //
- //    go mod tidy [-e] [-v] [-go=version]
+ //    go mod tidy [-e] [-v] [-go=version] [-compat=version]
  //
  // Tidy makes sure go.mod matches the source code in the module.
  // It adds any missing modules necessary to build the current module's
  // (Go versions 1.17 and higher retain more requirements in order to
  // support lazy module loading.)
  //
+ // The -compat flag preserves any additional checksums needed for the
+ // 'go' command from the indicated major Go release to successfully load
+ // the module graph, and causes tidy to error out if that version of the
+ // 'go' command would load any imported package from a different module
+ // version. By default, tidy acts as if the -compat flag were set to the
+ // version prior to the one indicated by the 'go' directive in the go.mod
+ // file.
+ //
  // See https://golang.org/ref/mod#go-mod-tidy for more about 'go mod tidy'.
  //
  //
  //
  // 'Go test' recompiles each package along with any files with names matching
  // the file pattern "*_test.go".
 -// These additional files can contain test functions, benchmark functions, and
 -// example functions. See 'go help testfunc' for more.
 +// These additional files can contain test functions, benchmark functions, fuzz
 +// targets and example functions. See 'go help testfunc' for more.
  // Each listed package causes the execution of a separate test binary.
  // Files whose names begin with "_" (including "_test.go") or "." are ignored.
  //
  // so a successful package test result will be cached and reused
  // regardless of -timeout setting.
  //
 +// Run 'go help fuzz' for details around how the go command handles fuzz targets.
 +//
  // In addition to the build flags, the flags handled by 'go test' itself are:
  //
  //    -args
  //        (for example, -benchtime 100x).
  //
  //    -count n
 -//        Run each test and benchmark n times (default 1).
 +//        Run each test, benchmark, and fuzz targets' seed corpora n times
 +//        (default 1).
  //        If -cpu is set, run n times for each GOMAXPROCS value.
  //        Examples are always run once.
  //
  //        Sets -cover.
  //
  //    -cpu 1,2,4
 -//        Specify a list of GOMAXPROCS values for which the tests or
 -//        benchmarks should be executed. The default is the current value
 +//        Specify a list of GOMAXPROCS values for which the tests, benchmarks or
 +//        fuzz targets should be executed. The default is the current value
  //        of GOMAXPROCS.
  //
  //    -failfast
  //        Do not start new tests after the first test failure.
  //
 +//    -fuzz name
 +//        Run the fuzz target with the given regexp. Must match exactly one fuzz
 +//        target. This is an experimental feature.
 +//
 +//    -fuzztime t
 +//        Run enough iterations of the fuzz test to take t, specified as a
 +//        time.Duration (for example, -fuzztime 1h30s). The default is to run
 +//        forever.
 +//        The special syntax Nx means to run the fuzz test N times
 +//        (for example, -fuzztime 100x).
 +//
 +//    -keepfuzzing
 +//        Keep running the fuzz target if a crasher is found.
 +//
  //    -list regexp
 -//        List tests, benchmarks, or examples matching the regular expression.
 -//        No tests, benchmarks or examples will be run. This will only
 -//        list top-level tests. No subtest or subbenchmarks will be shown.
 +//        List tests, benchmarks, fuzz targets, or examples matching the regular
 +//        expression. No tests, benchmarks, fuzz targets, or examples will be run.
 +//        This will only list top-level tests. No subtest or subbenchmarks will be
 +//        shown.
  //
  //    -parallel n
 -//        Allow parallel execution of test functions that call t.Parallel.
 +//        Allow parallel execution of test functions that call t.Parallel, and
 +//        f.Fuzz functions that call t.Parallel when running the seed corpus.
  //        The value of this flag is the maximum number of tests to run
 -//        simultaneously; by default, it is set to the value of GOMAXPROCS.
 +//        simultaneously. While fuzzing, the value of this flag is the
 +//        maximum number of workers to run the fuzz function simultaneously,
 +//        regardless of whether t.Parallel has been called; by default, it is set
 +//        to the value of GOMAXPROCS.
  //        Note that -parallel only applies within a single test binary.
  //        The 'go test' command may run tests for different packages
  //        in parallel as well, according to the setting of the -p flag
  //        (see 'go help build').
  //
  //    -run regexp
 -//        Run only those tests and examples matching the regular expression.
 -//        For tests, the regular expression is split by unbracketed slash (/)
 -//        characters into a sequence of regular expressions, and each part
 -//        of a test's identifier must match the corresponding element in
 +//        Run only those tests, examples, and fuzz targets matching the regular
 +//        expression. For tests, the regular expression is split by unbracketed
 +//        slash (/) characters into a sequence of regular expressions, and each
 +//        part of a test's identifier must match the corresponding element in
  //        the sequence, if any. Note that possible parents of matches are
  //        run too, so that -run=X/Y matches and runs and reports the result
  //        of all tests matching X, even those without sub-tests matching Y,
  //
  //    func BenchmarkXxx(b *testing.B) { ... }
  //
 +// A fuzz target is one named FuzzXxx and should have the signature,
 +//
 +//    func FuzzXxx(f *testing.F) { ... }
 +//
  // An example function is similar to a test function but, instead of using
  // *testing.T to report success or failure, prints output to os.Stdout.
  // If the last comment in the function starts with "Output:" then the output
  //
  // The entire test file is presented as the example when it contains a single
  // example function, at least one other function, type, variable, or constant
 -// declaration, and no test or benchmark functions.
 +// declaration, and no fuzz targets or test or benchmark functions.
  //
  // See the documentation of the testing package for more information.
  //
  //
 +// Fuzzing
 +//
 +// By default, go test will build and run the fuzz targets using the target's seed
 +// corpus only. Any generated corpora in $GOCACHE that were previously written by
 +// the fuzzing engine will not be run by default.
 +//
 +// When -fuzz is set, the binary will be instrumented for coverage. After all
 +// tests, examples, benchmark functions, and the seed corpora for all fuzz targets
 +// have been run, go test will begin to fuzz the specified fuzz target.
 +// Note that this feature is experimental.
 +//
 +// -run can be used for testing a single seed corpus entry for a fuzz target. The
 +// regular expression value of -run can be in the form $target/$name, where $target
 +// is the name of the fuzz target, and $name is the name of the file (ignoring file
 +// extensions) to run. For example, -run=FuzzFoo/497b6f87.
 +//
 +// See https://golang.org/s/draft-fuzzing-design for more details.
 +//
 +//
  // Controlling version control with GOVCS
  //
  // The 'go get' command can run version control commands like git
index 9d7d32b5d1d41f35692bc9f1579701b698c9c1ef,738904865e245d0aea2ba0805024a3d817c51ce9..26115ff6a431911dba10d4358e0e4b5bf7162126
@@@ -849,7 -849,9 +849,9 @@@ func loadPackageData(ctx context.Contex
                                buildMode = build.ImportComment
                        }
                        data.p, data.err = cfg.BuildContext.ImportDir(r.dir, buildMode)
-                       if data.p.Root == "" && cfg.ModulesEnabled {
+                       if cfg.ModulesEnabled {
+                               // Override data.p.Root, since ImportDir sets it to $GOPATH, if
+                               // the module is inside $GOPATH/src.
                                if info := modload.PackageModuleInfo(ctx, path); info != nil {
                                        data.p.Root = info.Dir
                                }
@@@ -2627,20 -2629,10 +2629,20 @@@ func (e *mainPackageError) ImportPath(
  
  func setToolFlags(pkgs ...*Package) {
        for _, p := range PackageList(pkgs) {
 -              p.Internal.Asmflags = BuildAsmflags.For(p)
 -              p.Internal.Gcflags = BuildGcflags.For(p)
 -              p.Internal.Ldflags = BuildLdflags.For(p)
 -              p.Internal.Gccgoflags = BuildGccgoflags.For(p)
 +              appendFlags(p, &p.Internal.Asmflags, &BuildAsmflags)
 +              appendFlags(p, &p.Internal.Gcflags, &BuildGcflags)
 +              appendFlags(p, &p.Internal.Ldflags, &BuildLdflags)
 +              appendFlags(p, &p.Internal.Gccgoflags, &BuildGccgoflags)
 +      }
 +}
 +
 +func appendFlags(p *Package, flags *[]string, packageFlag *PerPackageFlag) {
 +      if !packageFlag.seenPackages[p] {
 +              if packageFlag.seenPackages == nil {
 +                      packageFlag.seenPackages = make(map[*Package]bool)
 +              }
 +              packageFlag.seenPackages[p] = true
 +              *flags = append(*flags, packageFlag.For(p)...)
        }
  }
  
index 82e3d3200466b8b7af991d19491389d2d202af1e,70fbb9dc4e24cf2d47c78c89b072684625735784..12ece3e233b0cceaaad67fdee1b95d310c1baded
@@@ -1550,7 -1550,7 +1550,7 @@@ func (ctxt *Link) dodata(symGroupType [
  
        if ctxt.HeadType == objabi.Haix && ctxt.LinkMode == LinkExternal {
                // These symbols must have the same alignment as their section.
-               // Otherwize, ld might change the layout of Go sections.
+               // Otherwise, ld might change the layout of Go sections.
                ldr.SetSymAlign(ldr.Lookup("runtime.data", 0), state.dataMaxAlign[sym.SDATA])
                ldr.SetSymAlign(ldr.Lookup("runtime.bss", 0), state.dataMaxAlign[sym.SBSS])
        }
@@@ -1789,9 -1789,7 +1789,9 @@@ func (state *dodataState) allocateDataS
  
        // Coverage instrumentation counters for libfuzzer.
        if len(state.data[sym.SLIBFUZZER_EXTRA_COUNTER]) > 0 {
 -              state.allocateNamedSectionAndAssignSyms(&Segdata, "__libfuzzer_extra_counters", sym.SLIBFUZZER_EXTRA_COUNTER, sym.Sxxx, 06)
 +              sect := state.allocateNamedSectionAndAssignSyms(&Segdata, "__libfuzzer_extra_counters", sym.SLIBFUZZER_EXTRA_COUNTER, sym.Sxxx, 06)
 +              ldr.SetSymSect(ldr.LookupOrCreateSym("internal/fuzz._counters", 0), sect)
 +              ldr.SetSymSect(ldr.LookupOrCreateSym("internal/fuzz._ecounters", 0), sect)
        }
  
        if len(state.data[sym.STLSBSS]) > 0 {
@@@ -2531,7 -2529,6 +2531,7 @@@ func (ctxt *Link) address() []*sym.Segm
        var noptr *sym.Section
        var bss *sym.Section
        var noptrbss *sym.Section
 +      var fuzzCounters *sym.Section
        for i, s := range Segdata.Sections {
                if (ctxt.IsELF || ctxt.HeadType == objabi.Haix) && s.Name == ".tbss" {
                        continue
                s.Vaddr = va
                va += uint64(vlen)
                Segdata.Length = va - Segdata.Vaddr
 -              if s.Name == ".data" {
 +              switch s.Name {
 +              case ".data":
                        data = s
 -              }
 -              if s.Name == ".noptrdata" {
 +              case ".noptrdata":
                        noptr = s
 -              }
 -              if s.Name == ".bss" {
 +              case ".bss":
                        bss = s
 -              }
 -              if s.Name == ".noptrbss" {
 +              case ".noptrbss":
                        noptrbss = s
 +              case "__libfuzzer_extra_counters":
 +                      fuzzCounters = s
                }
        }
  
        ctxt.xdefine("runtime.enoptrbss", sym.SNOPTRBSS, int64(noptrbss.Vaddr+noptrbss.Length))
        ctxt.xdefine("runtime.end", sym.SBSS, int64(Segdata.Vaddr+Segdata.Length))
  
 +      if fuzzCounters != nil {
 +              ctxt.xdefine("internal/fuzz._counters", sym.SLIBFUZZER_EXTRA_COUNTER, int64(fuzzCounters.Vaddr))
 +              ctxt.xdefine("internal/fuzz._ecounters", sym.SLIBFUZZER_EXTRA_COUNTER, int64(fuzzCounters.Vaddr+fuzzCounters.Length))
 +      }
 +
        if ctxt.IsSolaris() {
                // On Solaris, in the runtime it sets the external names of the
                // end symbols. Unset them and define separate symbols, so we