aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/export_test.go
AgeCommit message (Collapse)Author
2026-01-30runtime: delete unused parameter of userForcedTony Tang
delete unused parameter userForced Change-Id: I71c26ab5e3fadc532b6b1f266212c6f620769efd GitHub-Last-Rev: 6a32c8ff6e63f8b149c0803e8b6636022bd9d066 GitHub-Pull-Request: golang/go#76732 Reviewed-on: https://go-review.googlesource.com/c/go/+/727680 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Tony Tang <jianfeng.tony@gmail.com>
2026-01-23runtime: speed up cheaprand and cheaprand64Gavin Lam
The current cheaprand performs 128-bit multiplication on 64-bit numbers and truncate the result to 32 bits, which is inefficient. A 32-bit specific implementation is more performant because it performs 64-bit multiplication on 32-bit numbers instead. The current cheaprand64 involves two cheaprand calls. Implementing it as 64-bit wyrand is significantly faster. Since cheaprand64 discards one bit, I have preserved this behavior. The underlying uint64 function is made available as cheaprandu64. │ old │ new │ │ sec/op │ sec/op vs base │ Cheaprand-8 1.358n ± 0% 1.218n ± 0% -10.31% (n=100) Cheaprand64-8 2.424n ± 0% 1.391n ± 0% -42.62% (n=100) Blocksampled-8 8.347n ± 0% 2.022n ± 0% -75.78% (n=100) Fixes #77149 Change-Id: Ib0b5da4a642cd34d0401b03c1d343041f8230d11 GitHub-Last-Rev: 549d8d407e2bbcaecdee0b52cbf3a513dda637fb GitHub-Pull-Request: golang/go#77150 Reviewed-on: https://go-review.googlesource.com/c/go/+/735480 Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-12-05runtime: skip TestArenaCollision if we run out of hintsMichael Anthony Knyszek
This seems failure mode seems to have become more common on Windows. I suspect the randomized heap base address has something to do with it, but I'm not 100% sure. What's definitely certain is that we're running out of hints, since we're seeing failures that mheap_.arenaHints is nil and GetNextArenaHint doesn't actually check that. At the very least we can check that and skip. We know that in this case there's not that much we can do. Fixes #76566. Change-Id: I8ccc8994806b6c95e3157eb296b09705637564b3 Reviewed-on: https://go-review.googlesource.com/c/go/+/726527 Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-11-24runtime: add GODEBUG=tracebacklabels=1 to include pprof labels in tracebacksDavid Finkel
Copy LabelSet to an internal package as label.Set, and include (escaped) labels within goroutine stack dumps. Labels are added to the goroutine header as quoted key:value pairs, so the line may get long if there are a lot of labels. To handle escaping, we add a printescaped function to the runtime and hook it up to the print function in the compiler with a new runtime.quoted type that's a sibling to runtime.hex. (in fact, we leverage some of the machinery from printhex to generate escape sequences). The escaping can be improved for printable runes outside basic ASCII (particularly for languages using non-latin stripts). Additionally, invalid UTF-8 can be improved. So we can experiment with the output format make this opt-in via a a new tracebacklabels GODEBUG var. Updates #23458 Updates #76349 Change-Id: I08e78a40c55839a809236fff593ef2090c13c036 Reviewed-on: https://go-review.googlesource.com/c/go/+/694119 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Alan Donovan <adonovan@google.com>
2025-11-20[dev.simd] all: merge master (ca37d24) into dev.simdCherry Mui
Conflicts: - src/cmd/compile/internal/typecheck/builtin.go Merge List: + 2025-11-20 ca37d24e0b net/http: drop unused "broken" field from persistConn + 2025-11-20 4b740af56a cmd/internal/obj/x86: handle global reference in From3 in dynlink mode + 2025-11-20 790384c6c2 spec: adjust rule for type parameter on RHS of alias declaration + 2025-11-20 a49b0302d0 net/http: correctly close fake net.Conns + 2025-11-20 32f5aadd2f cmd/compile: stack allocate backing stores during append + 2025-11-20 a18aff8057 runtime: select GC mark workers during start-the-world + 2025-11-20 829779f4fe runtime: split findRunnableGCWorker in two + 2025-11-20 ab59569099 go/version: use "custom" as an example of a version suffix + 2025-11-19 c4bb9653ba cmd/compile: Implement LoweredZeroLoop with LSX Instruction on loong64 + 2025-11-19 7f2ae21fb4 cmd/internal/obj/loong64: add MULW.D.W[U] instructions + 2025-11-19 a2946f2385 crypto: add Encapsulator and Decapsulator interfaces + 2025-11-19 6b83bd7146 crypto/ecdh: add KeyExchanger interface + 2025-11-19 4fef9f8b55 go/types, types2: fix object path for grouped declaration statements + 2025-11-19 33529db142 spec: escape double-ampersands + 2025-11-19 dc42565a20 cmd/compile: fix control flow for unsigned divisions proof relations + 2025-11-19 e64023dcbf cmd/compile: cleanup useless if statement in prove + 2025-11-19 2239520d1c test: go fmt prove.go tests + 2025-11-19 489d3dafb7 math: switch s390x math.Pow to generic implementation + 2025-11-18 8c41a482f9 runtime: add dlog.hexdump + 2025-11-18 e912618bd2 runtime: add hexdumper + 2025-11-18 2cf9d4b62f Revert "net/http: do not discard body content when closing it within request handlers" + 2025-11-18 4d0658bb08 cmd/compile: prefer fixed registers for values + 2025-11-18 ba634ca5c7 cmd/compile: fold boolean NOT into branches + 2025-11-18 8806d53c10 cmd/link: align sections, not symbols after DWARF compress + 2025-11-18 c93766007d runtime: do not print recovered when double panic with the same value + 2025-11-18 9859b43643 cmd/asm,cmd/compile,cmd/internal/obj/riscv: use compressed instructions on riscv64 + 2025-11-17 b9ef0633f6 cmd/internal/sys,internal/goarch,runtime: enable the use of compressed instructions on riscv64 + 2025-11-17 a087dea869 debug/elf: sync new loong64 relocation types up to LoongArch ELF psABI v20250521 + 2025-11-17 e1a12c781f cmd/compile: use 32x32->64 multiplies on arm64 + 2025-11-17 6caab99026 runtime: relax TestMemoryLimit on darwin a bit more + 2025-11-17 eda2e8c683 runtime: clear frame pointer at thread entry points + 2025-11-17 6919858338 runtime: rename findrunnable references to findRunnable + 2025-11-17 8e734ec954 go/ast: fix BasicLit.End position for raw strings containing \r + 2025-11-17 592775ec7d crypto/mlkem: avoid a few unnecessary inverse NTT calls + 2025-11-17 590cf18daf crypto/mlkem/mlkemtest: add derandomized Encapsulate768/1024 + 2025-11-17 c12c337099 cmd/compile: teach prove about subtract idioms + 2025-11-17 bc15963813 cmd/compile: clean up prove pass + 2025-11-17 1297fae708 go/token: add (*File).End method + 2025-11-17 65c09eafdf runtime: hoist invariant code out of heapBitsSmallForAddrInline + 2025-11-17 594129b80c internal/runtime/maps: update doc for table.Clear + 2025-11-15 c58d075e9a crypto/rsa: deprecate PKCS#1 v1.5 encryption + 2025-11-14 d55ecea9e5 runtime: usleep before stealing runnext only if not in syscall + 2025-11-14 410ef44f00 cmd: update x/tools to 59ff18c + 2025-11-14 50128a2154 runtime: support runtime.freegc in size-specialized mallocs for noscan objects + 2025-11-14 c3708350a4 cmd/go: tests: rename git-min-vers->git-sha256 + 2025-11-14 aea881230d std: fix printf("%q", int) mistakes + 2025-11-14 120f1874ef runtime: add more precise test of assist credit handling for runtime.freegc + 2025-11-14 fecfcaa4f6 runtime: add runtime.freegc to reduce GC work + 2025-11-14 5a347b775e runtime: set GOEXPERIMENT=runtimefreegc to disabled by default + 2025-11-14 1a03d0db3f runtime: skip tests for GOEXPERIMENT=arenas that do not handle clobberfree=1 + 2025-11-14 cb0d9980f5 net/http: do not discard body content when closing it within request handlers + 2025-11-14 03ed43988f cmd/compile: allow multi-field structs to be stored directly in interfaces + 2025-11-14 1bb1f2bf0c runtime: put AddCleanup cleanup arguments in their own allocation + 2025-11-14 9fd2e44439 runtime: add AddCleanup benchmark + 2025-11-14 80c91eedbb runtime: ensure weak handles end up in their own allocation + 2025-11-14 7a8d0b5d53 runtime: add debug mode to extend _Grunning-without-P windows + 2025-11-14 710abf74da internal/runtime/cgobench: add Go function call benchmark for comparison + 2025-11-14 b24aec598b doc, cmd/internal/obj/riscv: document the riscv64 assembler + 2025-11-14 a0e738c657 cmd/compile/internal: remove incorrect riscv64 SLTI rule + 2025-11-14 2cdcc4150b cmd/compile: fold negation into multiplication + 2025-11-14 b57962b7c7 bytes: fix panic in bytes.Buffer.Peek + 2025-11-14 0a569528ea cmd/compile: optimize comparisons with single bit difference + 2025-11-14 1e5e6663e9 cmd/compile: remove unnecessary casts and types from riscv64 rules + 2025-11-14 ddd8558e61 go/types, types2: swap object.color for Checker.objPathIdx + 2025-11-14 9daaab305c cmd/link/internal/ld: make runtime.buildVersion with experiments valid + 2025-11-13 d50a571ddf test: fix tests to work with sizespecializedmalloc turned off + 2025-11-13 704f841eab cmd/trace: annotation proc start/stop with thread and proc always + 2025-11-13 17a02b9106 net/http: remove unused isLitOrSingle and isNotToken + 2025-11-13 ff61991aed cmd/go: fix flaky TestScript/mod_get_direct + 2025-11-13 129d0cb543 net/http/cgi: accept INCLUDED as protocol for server side includes + 2025-11-13 77c5130100 go/types: minor simplification + 2025-11-13 7601cd3880 go/types: generate cycles.go + 2025-11-13 7a372affd9 go/types, types2: rename definedType to declaredType and clarify docs Change-Id: Ibaa9bdb982364892f80e511c1bb12661fcd5fb86
2025-11-18runtime: add hexdumperAustin Clements
Currently, we have a simple hexdumpWords facility for debugging. It's useful but pretty limited. This CL adds a much more configurable and capable "hexdumper". It can be configured for any word size (including bytes), handles unaligned data, includes an ASCII dump, and accepts data in multiple slices. It also has a much nicer "mark" facility for annotating the hexdump that isn't limited to a single character per word. We use this to improve our existing hexdumps, particularly the new mark facility. The next CL will integrate hexdumps into debuglog, which will make use of several other new capabilities. Also this adds an actual test. The output looks like: 7 6 5 4 3 2 1 0 f e d c b a 9 8 0123456789abcdef 000000c00006ef70: 03000000 00000000 ........ 000000c00006ef80: 00000000 0053da80 000000c0 000bc380 ..S............. ^ <testing.tRunner.func2+0x0> 000000c00006ef90: 00000000 0053dac0 000000c0 000bc380 ..S............. ^ <testing.tRunner.func1+0x0> 000000c00006efa0: 000000c0 0006ef90 000000c0 0006ef80 ................ 000000c00006efb0: 000000c0 0006efd0 00000000 0053eb65 ........e.S..... ^ <testing.(*T).Run.gowrap1+0x25> 000000c00006efc0: 000000c0 000bc380 00000000 009aaae8 ................ 000000c00006efd0: 00000000 00000000 00000000 00496b01 .........kI..... ^ <runtime.goexit+0x1> 000000c00006efe0: 00000000 00000000 00000000 00000000 ................ 000000c00006eff0: 00000000 00000000 ........ The header gives column labels, indicating the order of bytes within the following words. The addresses on the left are always 16-byte aligned so it's easy to combine that address with the column header to determine the full address of a byte. Annotations are no longer interleaved with the data, so the data stays in nicely aligned columns. The annotations are also now much more flexible, including support for multiple annotations on the same word (not shown). Change-Id: I27e83800a1f6a7bdd3cc2c59614661a810a57d4d Reviewed-on: https://go-review.googlesource.com/c/go/+/681375 Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Austin Clements <austin@google.com>
2025-11-14runtime: add more precise test of assist credit handling for runtime.freegcthepudds
This CL is part of a set of CLs that attempt to reduce how much work the GC must do. See the design in https://go.dev/design/74299-runtime-freegc This CL adds a better test of assist credit handling when heap objects are being reused after a runtime.freegc call. The main approach is bracketing alloc/free pairs with measurements of the assist credit before and after, and hoping to see a net zero change in the assist credit. However, validating the desired behavior is perhaps a bit subtle. To help stabilize the measurements, we do acquirem in the test code to avoid being preempted during the measurements to reduce other code's ability to adjust the assist credit while we are measuring, and we also reduce GOMAXPROCS to 1. This test currently does fail if we deliberately introduce bugs in the runtime.freegc implementation such as if we: - never adjust the assist credit when reusing an object, or - always adjust the assist credit when reusing an object, or - deliberately mishandle internal fragmentation. The two main cases of current interest for testing runtime.freegc are when over the course of our bracketed measurements gcBlackenEnable is either true or false. The test attempts to exercise both of those case by running the GC continually in the background (which we can see seems effective based on logging and by how our deliberate bugs fail). This passes ~10K test executions locally via stress. A small note to the future: a previous incarnation of this test (circa patchset 11 of this CL) did not do acquirem but had an approach of ignoring certain measurements, which also was able to pass ~10K runs via stress. The current version in this CL is simpler, but recording the existence of the prior version here in case it is useful in the future. (Hopefully not.) Updates #74299 Change-Id: I46c7e0295d125f5884fee0cc3d3d31aedc7e5ff4 Reviewed-on: https://go-review.googlesource.com/c/go/+/717520 Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Junyang Shao <shaojunyang@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-11-14runtime: add runtime.freegc to reduce GC workthepudds
This CL is part of a set of CLs that attempt to reduce how much work the GC must do. See the design in https://go.dev/design/74299-runtime-freegc This CL adds runtime.freegc: func freegc(ptr unsafe.Pointer, uintptr size, noscan bool) Memory freed via runtime.freegc is made immediately reusable for the next allocation in the same size class, without waiting for a GC cycle, and hence can dramatically reduce pressure on the GC. A sample microbenchmark included below shows strings.Builder operating roughly 2x faster. An experimental modification to reflect to use runtime.freegc and then using that reflect with json/v2 gave reported memory allocation reductions of -43.7%, -32.9%, -21.9%, -22.0%, -1.0% for the 5 official real-world unmarshalling benchmarks from go-json-experiment/jsonbench by the authors of json/v2, covering the CanadaGeometry through TwitterStatus datasets. Note: there is no intent to modify the standard library to have explicit calls to runtime.freegc, and of course such an ability would never be exposed to end-user code. Later CLs in this stack teach the compiler how to automatically insert runtime.freegc calls when it can prove it is safe to do so. (The reflect modification and other experimental changes to the standard library were just that -- experiments. It was very helpful while initially developing runtime.freegc to see more complex uses and closer-to-real-world benchmark results prior to updating the compiler.) This CL only addresses noscan span classes (heap objects without pointers), such as the backing memory for a []byte or string. A follow-on CL adds support for heap objects with pointers. If we update strings.Builder to explicitly call runtime.freegc on its internal buf after a resize operation (but without freeing the usually final incarnation of buf that will be returned to the user as a string), we can see some nice benchmark results on the existing strings benchmarks that call Builder.Write N times and then call Builder.String. Here, the (uncommon) case of a single Builder.Write is not helped (given it never resizes after first alloc if there is only one Write), but the impact grows such that it is up to ~2x faster as there are more resize operations due to more strings.Builder.Write calls: │ disabled.out │ new-free-20.txt │ │ sec/op │ sec/op vs base │ BuildString_Builder/1Write_36Bytes_NoGrow-4 55.82n ± 2% 55.86n ± 2% ~ (p=0.794 n=20) BuildString_Builder/2Write_36Bytes_NoGrow-4 125.2n ± 2% 115.4n ± 1% -7.86% (p=0.000 n=20) BuildString_Builder/3Write_36Bytes_NoGrow-4 224.0n ± 1% 188.2n ± 2% -16.00% (p=0.000 n=20) BuildString_Builder/5Write_36Bytes_NoGrow-4 239.1n ± 9% 205.1n ± 1% -14.20% (p=0.000 n=20) BuildString_Builder/8Write_36Bytes_NoGrow-4 422.8n ± 3% 325.4n ± 1% -23.04% (p=0.000 n=20) BuildString_Builder/10Write_36Bytes_NoGrow-4 436.9n ± 2% 342.3n ± 1% -21.64% (p=0.000 n=20) BuildString_Builder/100Write_36Bytes_NoGrow-4 4.403µ ± 1% 2.381µ ± 2% -45.91% (p=0.000 n=20) BuildString_Builder/1000Write_36Bytes_NoGrow-4 48.28µ ± 2% 21.38µ ± 2% -55.71% (p=0.000 n=20) See the design document for more discussion of the strings.Builder case. For testing, we add tests that attempt to exercise different aspects of the underlying freegc and mallocgc behavior on the reuse path. Validating the assist credit manipulations turned out to be subtle, so a test for that is added in the next CL. There are also invariant checks added, controlled by consts (primarily the doubleCheckReusable const currently). This CL also adds support in runtime.freegc for GODEBUG=clobberfree=1 to immediately overwrite freed memory with 0xdeadbeef, which can help a higher-level test fail faster in the event of a bug, and also the GC specifically looks for that pattern and throws a fatal error if it unexpectedly finds it. A later CL (currently experimental) adds GODEBUG=clobberfree=2, which uses mprotect (or VirtualProtect on Windows) to set freed memory to fault if read or written, until the runtime later unprotects the memory on the mallocgc reuse path. For the cases where a normal allocation is happening without any reuse, some initial microbenchmarks suggest the impact of these changes could be small to negligible (at least with GOAMD64=v3): goos: linux goarch: amd64 pkg: runtime cpu: AMD EPYC 7B13 │ base-512M-v3.bench │ ps16-512M-goamd64-v3.bench │ │ sec/op │ sec/op vs base │ Malloc8-16 11.01n ± 1% 10.94n ± 1% -0.68% (p=0.038 n=20) Malloc16-16 17.15n ± 1% 17.05n ± 0% -0.55% (p=0.007 n=20) Malloc32-16 18.65n ± 1% 18.42n ± 0% -1.26% (p=0.000 n=20) MallocTypeInfo8-16 18.63n ± 0% 18.36n ± 0% -1.45% (p=0.000 n=20) MallocTypeInfo16-16 22.32n ± 0% 22.65n ± 0% +1.50% (p=0.000 n=20) MallocTypeInfo32-16 23.37n ± 0% 23.89n ± 0% +2.23% (p=0.000 n=20) geomean 18.02n 18.01n -0.05% These last benchmark results include the runtime updates to support span classes with pointers (which was originally part of this CL, but later split out for ease of review). Updates #74299 Change-Id: Icceaa0f79f85c70cd1a718f9a4e7f0cf3d77803c Reviewed-on: https://go-review.googlesource.com/c/go/+/673695 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Junyang Shao <shaojunyang@google.com>
2025-11-14runtime: skip tests for GOEXPERIMENT=arenas that do not handle clobberfree=1thepudds
When run with GODEBUG=clobberfree=1, three out of seven of the top-level tests in runtime/arena_test.go fail with a SIGSEGV inside the clobberfree function where it is overwriting freed memory with 0xdeadbeef. This is not a new problem. For example, this crashes in Go 1.20: GODEBUG=clobberfree=1 go test runtime -run=TestUserArena It would be nice for all.bash to pass with GODEBUG=clobberfree=1, including it is useful for testing the automatic reclaiming of dead memory via runtime.freegc in #74299. Given the GOEXPERIMENT=arenas in #51317 is not planned to move forward (and is hopefully slated to be replace by regions before too long), for now we just skip those three tests in order to get all.bash passing with GODEBUG=clobberfree=1. Updates #74299 Change-Id: I384d96791157b30c73457d582a45dd74c5607ee0 Reviewed-on: https://go-review.googlesource.com/c/go/+/715080 Reviewed-by: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Junyang Shao <shaojunyang@google.com>
2025-11-13[dev.simd] all: merge master (57362e9) into dev.simdCherry Mui
Conflicts: - src/cmd/compile/internal/ir/symtab.go - src/cmd/compile/internal/ssa/prove.go - src/cmd/compile/internal/ssa/rewriteAMD64.go - src/cmd/compile/internal/ssagen/intrinsics.go - src/cmd/compile/internal/typecheck/builtin.go - src/internal/buildcfg/exp.go - src/internal/strconv/ftoa.go - test/codegen/stack.go Manually resolved some conflicts: - Use internal/strconv for simd.String, remove internal/ftoa - prove.go is just copied from the one on the main branch. We have cherry-picked the changes to prove.go to main branch, so our copy is identical to an old version of the one on the main branch. There are CLs landed after our cherry-picks. Just copy it over to adopt the new code. Merge List: + 2025-11-13 57362e9814 go/types, types2: check for direct cycles as a separate phase + 2025-11-13 099e0027bd cmd/go/internal/modfetch: consolidate global vars + 2025-11-13 028375323f cmd/go/internal/modfetch/codehost: fix flaky TestReadZip + 2025-11-13 4ebf295b0b runtime: prefer to restart Ps on the same M after STW + 2025-11-13 625d8e9b9c runtime/pprof: fix goroutine leak profile tests for noopt + 2025-11-13 4684a26c26 spec: remove cycle restriction for type parameters + 2025-11-13 0f9c8fb29d cmd/asm,cmd/internal/obj/riscv: add support for riscv compressed instructions + 2025-11-13 a15d036ce2 cmd/internal/obj/riscv: implement better bit pattern encoding + 2025-11-12 abb241a789 cmd/internal/obj/loong64: add {,X}VS{ADD,SUB}.{B/H/W/V}{,U} instructions support + 2025-11-12 0929d21978 cmd/go: keep objects alive while stopping cleanups + 2025-11-12 f03d06ec1a runtime: fix list test memory management for mayMoreStack + 2025-11-12 48127f656b crypto/internal/fips140/sha3: remove outdated TODO + 2025-11-12 c3d1d42764 sync/atomic: amend comments for Value.{Swap,CompareAndSwap} + 2025-11-12 e0807ba470 cmd/compile: don't clear ptrmask in fillptrmask + 2025-11-12 66318d2b4b internal/abi: correctly describe result in Name.Name doc comment + 2025-11-12 34aef89366 cmd/compile: use FCLASSD for subnormal checks on riscv64 + 2025-11-12 0c28789bd7 net/url: disallow raw IPv6 addresses in host + 2025-11-12 4e761b9a18 cmd/compile: optimize liveness in stackalloc + 2025-11-12 956909ff84 crypto/x509: move BetterTLS suite from crypto/tls + 2025-11-12 6525f46707 cmd/link: change shdr and phdr from arrays to slices + 2025-11-12 d3aeba1670 runtime: switch p.gcFractionalMarkTime to atomic.Int64 + 2025-11-12 8873e8bea2 runtime,runtime/pprof: clean up goroutine leak profile writing + 2025-11-12 b8b84b789e cmd/go: clarify the -o testflag is only for copying the binary + 2025-11-12 c761b26b56 mime: parse media types that contain braces + 2025-11-12 65858a146e os/exec: include Cmd.Start in the list of methods that run Cmd + 2025-11-11 4bfc3a9d14 std,cmd: go fix -any std cmd + 2025-11-11 2263d4aabd runtime: doubly-linked sched.midle list + 2025-11-11 046dce0e54 runtime: use new list type for spanSPMCs + 2025-11-11 5f11275457 runtime: reusable intrusive doubly-linked list + 2025-11-11 951cf0501b internal/trace/testtrace: fix flag name typos + 2025-11-11 2750f95291 cmd/go: implement accurate pseudo-versions for Mercurial + 2025-11-11 b709a3e8b4 cmd/go/internal/vcweb: cache hg servers + 2025-11-11 426ef30ecf cmd/go: implement -reuse for Mercurial repos + 2025-11-10 5241d114f5 spec: more precise prose for special case of append + 2025-11-10 cdf64106f6 go/types, types2: first argument to append must never be be nil + 2025-11-10 a0eb4548cf .gitignore: ignore go test artifacts + 2025-11-10 bf58e7845e internal/trace: add "command" to convert text traces to raw + 2025-11-10 052c192a4c runtime: fix lock rank for work.spanSPMCs.lock + 2025-11-10 bc5ffe5c79 internal/runtime/sys,math/bits: eliminate bounds checks on len8tab + 2025-11-10 32f8d6486f runtime: document that tracefpunwindoff applies to some profilers + 2025-11-10 1c1c1942ba cmd/go: remove redundant AVX regex in security flag checks + 2025-11-10 3b3d6b9e5d cmd/internal/obj/arm64: shorten constant integer loads + 2025-11-10 5f4b5f1a19 runtime/msan: use different msan routine for copying + 2025-11-10 0fe6c8e8c8 runtime: tweak wording for comment of mcache.flushGen + 2025-11-10 95a0e5adc1 sync: don't call Done when f() panics in WaitGroup.Go + 2025-11-08 e8ed85d6c2 cmd/go: update goSum if necessary + 2025-11-08 b76103c08e cmd/go: output missing GoDebug entries + 2025-11-07 47a63a331d cmd/go: rewrite hgrepo1 test repo to be deterministic + 2025-11-07 7995751d3a cmd/go: copy git reuse and support repos to hg + 2025-11-07 66c7ca7fb3 cmd/go: improve TestScript/reuse_git + 2025-11-07 de84ac55c6 cmd/link: clean up some comments to Go standards + 2025-11-07 5cd1b73772 runtime: correctly print panics before fatal-ing on defer + 2025-11-07 91ca80f970 runtime/cgo: improve error messages after pointer panic + 2025-11-07 d36e88f21f runtime: tweak wording for doc + 2025-11-06 ad3ccd92e4 cmd/link: move pclntab out of relro section + 2025-11-06 43b91e7abd iter: fix a tiny doc comment bug + 2025-11-06 48c7fa13c6 Revert "runtime: remove the pc field of _defer struct" + 2025-11-05 8111104a21 cmd/internal/obj/loong64: add {,X}VSHUF.{B/H/W/V} instructions support + 2025-11-05 2e2072561c cmd/internal/obj/loong64: add {,X}VEXTRINS.{B,H,W,V} instruction support + 2025-11-05 01c29d1f0b internal/chacha8rand: replace VORV with instruction VMOVQ on loong64 + 2025-11-05 f01a1841fd cmd/compile: fix error message on loong64 + 2025-11-05 8cf7a0b4c9 cmd/link: support weak binding on darwin + 2025-11-05 2dd7e94e16 cmd/go: use go.dev instead of golang.org in flag errors + 2025-11-05 28f1ad5782 cmd/go: fix TestScript/govcs + 2025-11-05 daa220a1c9 cmd/go: silence TLS handshake errors during test + 2025-11-05 3ae9e95002 cmd/go: fix TestCgoPkgConfig on darwin with pkg-config installed + 2025-11-05 a494a26bc2 cmd/go: fix TestScript/vet_flags + 2025-11-05 a8fb94969c cmd/go: fix TestScript/tool_build_as_needed + 2025-11-05 04f05219c4 cmd/cgo: skip escape checks if call site has no argument + 2025-11-04 9f3a108ee0 os: ignore O_TRUNC errors on named pipes and terminal devices on Windows + 2025-11-04 0e1bd8b5f1 cmd/link, runtime: don't store text start in pcHeader + 2025-11-04 7347b54727 cmd/link: don't generate .gosymtab section + 2025-11-04 6914dd11c0 cmd/link: add and use new SymKind SFirstUnallocated + 2025-11-04 f5f14262d0 cmd/link: remove misleading comment + 2025-11-04 61de3a9dae cmd/link: remove unused SFILEPATH symbol kind + 2025-11-04 8e2bd267b5 cmd/link: add comments for SymKind values + 2025-11-04 16705b962e cmd/compile: faster liveness analysis in regalloc + 2025-11-04 a5fe6791d7 internal/syscall/windows: fix ReOpenFile sentinel error value + 2025-11-04 a7d174ccaa cmd/compile/internal/ssa: simplify riscv64 FCLASSD rewrite rules + 2025-11-04 856238615d runtime: amend doc for setPinned + 2025-11-04 c7ccbddf22 cmd/compile/internal/ssa: more aggressive on dead auto elim + 2025-11-04 75b2bb1d1a cmd/cgo: drop pre-1.18 support + 2025-11-04 dd839f1d00 internal/strconv: handle %f with fixedFtoa when possible + 2025-11-04 6e165b4d17 cmd/compile: implement Avg64u, Hmul64, Hmul64u for wasm + 2025-11-04 9f6590f333 encoding/pem: don't reslice in failure modes + 2025-11-03 34fec512ce internal/strconv: extract fixed-precision ftoa from ftoaryu.go + 2025-11-03 162ba6cc40 internal/strconv: add tests and benchmarks for ftoaFixed + 2025-11-03 9795c7ba22 internal/strconv: fix pow10 off-by-one in exponent result + 2025-11-03 ad5e941a45 cmd/internal/obj/loong64: using {xv,v}slli.d to perform copying between vector registers + 2025-11-03 dadbac0c9e cmd/internal/obj/loong64: add VPERMI.W, XVPERMI.{W,V,Q} instruction support + 2025-11-03 e2c6a2024c runtime: avoid append in printint, printuint + 2025-11-03 c93cc603cd runtime: allow Stack to traceback goroutines in syscall _Grunning window + 2025-11-03 b5353fd90a runtime: don't panic in castogscanstatus + 2025-11-03 43491f8d52 cmd/cgo: use the export'ed file/line in error messages + 2025-11-03 aa94fdf0cc cmd/go: link to go.dev/doc/godebug for removed GODEBUG settings + 2025-11-03 4d2b03d2fc crypto/tls: add BetterTLS test coverage + 2025-11-03 0c4444e13d cmd/internal/obj: support arm64 FMOVQ large offset encoding + 2025-11-03 85bec791a0 cmd/go/testdata/script: loosen list_empty_importpath for freebsd + 2025-11-03 17b57078ab internal/runtime/cgobench: add cgo callback benchmark + 2025-11-03 5f8fdb720c cmd/go: move functions to methods + 2025-11-03 0a95856b95 cmd/go: eliminate additional global variable + 2025-11-03 f93186fb44 cmd/go/internal/telemetrystats: count cgo usage + 2025-11-03 eaf28a27fd runtime: update outdated comments for deferprocStack + 2025-11-03 e12d8a90bf all: remove extra space in the comments + 2025-11-03 c5559344ac internal/profile: optimize Parse allocs + 2025-11-03 5132158ac2 bytes: add Buffer.Peek + 2025-11-03 361d51a6b5 runtime: remove the pc field of _defer struct + 2025-11-03 00ee1860ce crypto/internal/constanttime: expose intrinsics to the FIPS 140-3 packages + 2025-11-02 388c41c412 cmd/go: skip git sha256 tests if git < 2.29 + 2025-11-01 385dc33250 runtime: prevent time.Timer.Reset(0) from deadlocking testing/synctest tests + 2025-10-31 99b724f454 cmd/go: document purego convention + 2025-10-31 27937289dc runtime: avoid zeroing scavenged memory + 2025-10-30 89dee70484 runtime: prioritize panic output over racefini + 2025-10-30 8683bb846d runtime: optimistically CAS atomicstatus directly in enter/exitsyscall + 2025-10-30 5b8e850340 runtime: don't track scheduling latency for _Grunning <-> _Gsyscall + 2025-10-30 251814e580 runtime: document tracer invariants explicitly + 2025-10-30 7244e9221f runtime: eliminate _Psyscall + 2025-10-30 5ef19c0d0c strconv: delete divmod1e9 + 2025-10-30 d32b1f02c3 runtime: delete timediv + 2025-10-30 cbbd385cb8 strconv: remove arch-specific decision in formatBase10 + 2025-10-30 6aca04a73a reflect: correct internal docs for uncommonType + 2025-10-30 235b4e729d cmd/compile/internal/ssa: model right shift more precisely + 2025-10-30 d44db293f9 go/token: fix a typo in a comment + 2025-10-30 cdc6b559ca strconv: remove hand-written divide on 32-bit systems + 2025-10-30 1e5bb416d8 cmd/compile: implement bits.Mul64 on 32-bit systems + 2025-10-30 38317c44e7 crypto/internal/fips140/aes: fix CTR generator + 2025-10-29 3be9a0e014 go/types, types: proceed with correct (invalid) type in case of a selector error + 2025-10-29 d2c5fa0814 strconv: remove &0xFF trick in formatBase10 + 2025-10-29 9bbda7c99d cmd/compile: make prove understand div, mod better + 2025-10-29 915c1839fe test/codegen: simplify asmcheck pattern matching + 2025-10-29 32ee3f3f73 runtime: tweak example code for gorecover + 2025-10-29 da3fb90b23 crypto/internal/fips140/bigmod: fix extendedGCD comment + 2025-10-29 9035f7aea5 runtime: use internal/strconv + 2025-10-29 49c1da474d internal/itoa, internal/runtime/strconv: delete + 2025-10-29 b2a346bbd1 strconv: move all but Quote to internal/strconv + 2025-10-28 041f564b3e internal/runtime/gc/scan: avoid memory destination on VPCOMPRESSQ + 2025-10-28 81afd3a59b cmd/compile: extend ppc64 MADDLD to match const ADDconst & MULLDconst + 2025-10-28 ea50d61b66 cmd/compile: name change isDirect -> isDirectAndComparable + 2025-10-28 bd4dc413cd cmd/compile: don't optimize away a panicing interface comparison + 2025-10-28 30c047d0d0 cmd/compile: extend loong MOV*idx rules to match ADDshiftLLV + 2025-10-28 46e5e2b09a runtime: define PanicBounds in funcdata.h + 2025-10-28 3da0356685 crypto/internal/fips140test: collect 300M entropy samples for ESV + 2025-10-28 d5953185d5 runtime: amend comments a bit + 2025-10-28 12c8d14d94 errors: document that the target of Is must be comparable + 2025-10-28 1f4d14e493 go/types, types2: pull up package-level object sort to a separate phase + 2025-10-28 b8aa1ee442 go/types, types2: reduce locks held at once in resolveUnderlying + 2025-10-28 24af441437 cmd/compile: rewrite proved multiplies by 0 or 1 into CondSelect + 2025-10-28 2d33a456c6 cmd/compile: move branchelim supported arches to Config + 2025-10-27 2c91c33e88 crypto/subtle,cmd/compile: add intrinsics for ConstantTimeSelect and *Eq + 2025-10-27 73d7635fae cmd/compile: add generic rules to remove bool → int → bool roundtrips + 2025-10-27 1662d55247 cmd/compile: do not Zext bools to 64bits in amd64 CMOV generation rules + 2025-10-27 b8468d8c4e cmd/compile: introduce bytesizeToConst to cleanup switches in prove + 2025-10-27 9e25c2f6de cmd/link: internal linking support for windows/arm64 + 2025-10-27 ff2ebf69c4 internal/runtime/gc/scan: correct size class size check + 2025-10-27 9a77aa4f08 cmd/compile: add position info to sccp debug messages + 2025-10-27 77dc138030 cmd/compile: teach prove about unsigned rounding-up divide + 2025-10-27 a0f33b2887 cmd/compile: change !l.nonzero() into l.maybezero() + 2025-10-27 5453b788fd cmd/compile: optimize Add64carry with unused carries into plain Add64 + 2025-10-27 2ce5aab79e cmd/compile: remove 68857 ModU flowLimit workaround in prove + 2025-10-27 a50de4bda7 cmd/compile: remove 68857 min & max flowLimit workaround in prove + 2025-10-27 53be78630a cmd/compile: use topo-sort in prove to correctly learn facts while walking once + 2025-10-27 dec2b4c83d runtime: avoid bound check in freebsd binuptime + 2025-10-27 916e682d51 cmd/internal/obj, cmd/asm: reclassify the offset of memory access operations on loong64 + 2025-10-27 2835b994fb cmd/go: remove global loader state variable + 2025-10-27 139f89226f cmd/go: use local state for telemetry + 2025-10-27 8239156571 cmd/go: use tagged switch + 2025-10-27 d741483a1f cmd/go: increase stmt threshold on amd64 + 2025-10-27 a6929cf4a7 cmd/go: removed unused code in toolchain.Exec + 2025-10-27 180c07e2c1 go/types, types2: clarify docs for resolveUnderlying + 2025-10-27 d8a32f3d4b go/types, types2: wrap Named.fromRHS into Named.rhs + 2025-10-27 b2af92270f go/types, types2: verify stateMask transitions in debug mode + 2025-10-27 92decdcbaa net/url: further speed up escape and unescape + 2025-10-27 5f4ec3541f runtime: remove unused cgoCheckUsingType function + 2025-10-27 189f2c08cc time: rewrite IsZero method to use wall and ext fields + 2025-10-27 f619b4a00d cmd/go: reorder parameters so that context is first + 2025-10-27 f527994c61 sync: update comments for Once.done + 2025-10-26 5dcaf9a01b runtime: add GOEXPERIMENT=runtimefree + 2025-10-26 d7a52f9369 cmd/compile: use MOV(D|F) with const for Const(64|32)F on riscv64 + 2025-10-26 6f04a92be3 internal/chacha8rand: provide vector implementation for riscv64 + 2025-10-26 54e3adc533 cmd/go: use local loader state in test + 2025-10-26 ca379b1c56 cmd/go: remove loaderstate dependency + 2025-10-26 83a44bde64 cmd/go: remove unused loader state + 2025-10-26 7e7cd9de68 cmd/go: remove temporary rf cleanup script + 2025-10-26 53ad68de4b cmd/compile: allow unaligned load/store on Wasm + 2025-10-25 12ec09f434 cmd/go: use local state object in work.runBuild and work.runInstall + 2025-10-24 643f80a11f runtime: add ppc and s390 to 32 build constraints for gccgo + 2025-10-24 0afbeb5102 runtime: add ppc and s390 to linux 32 bits syscall build constraints for gccgo + 2025-10-24 7b506d106f cmd/go: use local state object in `generate.runGenerate` + 2025-10-24 26a8a21d7f cmd/go: use local state object in `env.runEnv` + 2025-10-24 f2dd3d7e31 cmd/go: use local state object in `vet.runVet` + 2025-10-24 784700439a cmd/go: use local state object in pkg `workcmd` + 2025-10-24 69673e9be2 cmd/go: use local state object in `tool.runTool` + 2025-10-24 2e12c5db11 cmd/go: use local state object in `test.runTest` + 2025-10-24 fe345ff2ae cmd/go: use local state object in `modget.runGet` + 2025-10-24 d312e27e8b cmd/go: use local state object in pkg `modcmd` + 2025-10-24 ea9cf26aa1 cmd/go: use local state object in `list.runList` + 2025-10-24 9926e1124e cmd/go: use local state object in `bug.runBug` + 2025-10-24 2c4fd7b2cd cmd/go: use local state object in `run.runRun` + 2025-10-24 ade9f33e1f cmd/go: add loaderstate as field on `mvsReqs` + 2025-10-24 ccf4192a31 cmd/go: make ImportMissingError work with local state + 2025-10-24 f5403f15f0 debug/pe: check for zdebug_gdb_scripts section in testDWARF + 2025-10-24 a26f860fa4 runtime: use 32-bit hash for maps on Wasm + 2025-10-24 747fe2efed encoding/json/v2: fix typo in documentation about errors.AsType + 2025-10-24 94f47fc03f cmd/link: remove pointless assignment in SetSymAlign + 2025-10-24 e6cff69051 crypto/x509: move constraint checking after chain building + 2025-10-24 f5f69a3de9 encoding/json/jsontext: avoid pinning application data in pools + 2025-10-24 a6a59f0762 encoding/json/v2: use slices.Sort directly + 2025-10-24 0d3dab9b1d crypto/x509: simplify candidate chain filtering + 2025-10-24 29046398bb cmd/go: refactor injection of modload.LoaderState + 2025-10-24 c18fa69e52 cmd/go: make ErrNoModRoot work with local state + 2025-10-24 296ecc918d cmd/go: add modload.State parameter to AllowedFunc + 2025-10-24 c445a61e52 cmd/go: add loaderstate as field on `QueryMatchesMainModulesError` + 2025-10-24 6ac40051d3 cmd/go: remove module loader state from ccompile + 2025-10-24 6a5a452528 cmd/go: inject vendor dir into builder struct + 2025-10-23 dfac972233 crypto/pbkdf2: add missing error return value in example + 2025-10-23 47bf8f073e unique: fix inconsistent panic prefix in canonmap cleanup path + 2025-10-23 03bd43e8bb go/types, types2: rename Named.resolve to unpack + 2025-10-23 9fcdc814b2 go/types, types2: rename loaded namedState to lazyLoaded + 2025-10-23 8401512a9b go/types, types2: rename complete namedState to hasMethods + 2025-10-23 cf826bfcb4 go/types, types2: set t.underlying exactly once in resolveUnderlying + 2025-10-23 c4e910895b net/url: speed up escape and unescape + 2025-10-23 3f6ac3a10f go/build: use slices.Equal + 2025-10-23 839da71f89 encoding/pem: properly calculate end indexes + 2025-10-23 39ed968832 cmd: update golang.org/x/arch for riscv64 disassembler + 2025-10-23 ca448191c9 all: replace Split in loops with more efficient SplitSeq + 2025-10-23 107fcb70de internal/goroot: replace HasPrefix+TrimPrefix with CutPrefix + 2025-10-23 8378276d66 strconv: optimize int-to-decimal and use consistently + 2025-10-23 e5688d0bdd cmd/internal/obj/riscv: simplify validation and encoding of raw instructions + 2025-10-22 77fc27972a doc/next: improve new(expr) release note + 2025-10-22 d94a8c56ad runtime: cleanup pagetrace + 2025-10-22 02728a2846 crypto/internal/fips140test: add entropy SHA2-384 testing + 2025-10-22 f92e01c117 runtime/cgo: fix cgoCheckArg description + 2025-10-22 50586182ab runtime: use backoff and ISB instruction to reduce contention in (*lfstack).pop and (*spanSet).pop on arm64 + 2025-10-22 1ff59f3dd3 strconv: clean up powers-of-10 table, tests + 2025-10-22 7c9fa4d5e9 cmd/go: check if build output should overwrite files with renames + 2025-10-22 557b4d6e0f comment: change slice to string in function comment/help + 2025-10-22 d09a8c8ef4 go/types, types2: simplify locking in Named.resolveUnderlying + 2025-10-22 5a42af7f6c go/types, types2: in resolveUnderlying, only compute path when needed + 2025-10-22 4bdb55b5b8 go/types, types2: rename Named.under to Named.resolveUnderlying + 2025-10-21 29d43df8ab go/build, cmd/go: use ast.ParseDirective for go:embed + 2025-10-21 4e695dd634 go/ast: add ParseDirective for parsing directive comments + 2025-10-21 06e57e60a7 go/types, types2: only report version errors if new(expr) is ok otherwise + 2025-10-21 6c3d0d259f path/filepath: reword documentation for Rel + 2025-10-21 39fd61ddb0 go/types, types2: guard Named.underlying with Named.mu + 2025-10-21 4a0115c886 runtime,syscall: implement and use syscalln on darwin + 2025-10-21 261c561f5a all: gofmt -w + 2025-10-21 c9c78c06ef strconv: embed testdata in test + 2025-10-21 8f74f9daf4 sync: re-enable race even when panicking + 2025-10-21 8a6c64f4fe syscall: use rawSyscall6 to call ptrace in forkAndExecInChild + 2025-10-21 4620db72d2 runtime: use timer_settime64 on 32-bit Linux + 2025-10-21 b31dc77cea os: support deleting read-only files in RemoveAll on older Windows versions + 2025-10-21 46cc532900 cmd/compile/internal/ssa: fix typo in comment + 2025-10-21 2163a58021 crypto/internal/fips140/entropy: increase AllocsPerRun iterations + 2025-10-21 306eacbc11 cmd/go/testdata/script: disable list_empty_importpath test on Windows + 2025-10-21 a5a249d6a6 all: eliminate unnecessary type conversions + 2025-10-21 694182d77b cmd/internal/obj/ppc64: improve large prologue generation + 2025-10-21 b0dcb95542 cmd/compile: leave the horses alone + 2025-10-21 9a5a1202f4 runtime: clean dead architectures from go:build constraint + 2025-10-21 8539691d0c crypto/internal/fips140/entropy: move to crypto/internal/entropy/v1.0.0 + 2025-10-20 99cf4d671c runtime: save lasx and lsx registers in loong64 async preemption + 2025-10-20 79ae97fe9b runtime: make procyieldAsm no longer loop infinitely if passed 0 + 2025-10-20 f838faffe2 runtime: wrap procyield assembly and check for 0 + 2025-10-20 ee4d2c312d runtime/trace: dump test traces on validation failure + 2025-10-20 7b81a1e107 net/url: reduce allocs in Encode + 2025-10-20 e425176843 cmd/asm: fix typo in comment + 2025-10-20 dc9a3e2a65 runtime: fix generation skew with trace reentrancy + 2025-10-20 df33c17091 runtime: add _Gdeadextra status + 2025-10-20 7503856d40 cmd/go: inject loaderstate into matcher function + 2025-10-20 d57c3fd743 cmd/go: inject State parameter into `work.runInstall` + 2025-10-20 e94a5008f6 cmd/go: inject State parameter into `work.runBuild` + 2025-10-20 d9e6f95450 cmd/go: inject State parameter into `workcmd.runSync` + 2025-10-20 9769a61e64 cmd/go: inject State parameter into `modget.runGet` + 2025-10-20 f859799ccf cmd/go: inject State parameter into `modcmd.runVerify` + 2025-10-20 0f820aca29 cmd/go: inject State parameter into `modcmd.runVendor` + 2025-10-20 92aa3e9e98 cmd/go: inject State parameter into `modcmd.runInit` + 2025-10-20 e176dff41c cmd/go: inject State parameter into `modcmd.runDownload` + 2025-10-20 e7c66a58d5 cmd/go: inject State parameter into `toolchain.Select` + 2025-10-20 4dc3dd9a86 cmd/go: add loaderstate to Switcher + 2025-10-20 bcf7da1595 cmd/go: convert functions to methods + 2025-10-20 0d3044f965 cmd/go: make Reset work with any State instance + 2025-10-20 386d81151d cmd/go: make setState work with any State instance + 2025-10-20 a420aa221e cmd/go: inject State parameter into `tool.runTool` + 2025-10-20 441e7194a4 cmd/go: inject State parameter into `test.runTest` + 2025-10-20 35e8309be2 cmd/go: inject State parameter into `list.runList` + 2025-10-20 29a81624f7 cmd/go: inject state parameter into `fmtcmd.runFmt` + 2025-10-20 f7eaea02fd cmd/go: inject state parameter into `clean.runClean` + 2025-10-20 58a8fdb6cf cmd/go: inject State parameter into `bug.runBug` + 2025-10-20 8d0bef7ffe runtime: add linkname documentation and guidance + 2025-10-20 3e43f48cb6 encoding/asn1: use reflect.TypeAssert to improve performance + 2025-10-20 4ad5585c2c runtime: fix _rt0_ppc64x_lib on aix + 2025-10-17 a5f55a441e cmd/fix: add modernize and inline analyzers + 2025-10-17 80876f4b42 cmd/go/internal/vet: tweak help doc + 2025-10-17 b5aefe07e5 all: remove unnecessary loop variable copies in tests + 2025-10-17 5137c473b6 go/types, types2: remove references to under function in comments + 2025-10-17 dbbb1bfc91 all: correct name for comments + 2025-10-17 0983090171 encoding/pem: properly decode strange PEM data + 2025-10-17 36863d6194 runtime: unify riscv64 library entry point + 2025-10-16 0c14000f87 go/types, types2: remove under(Type) in favor of Type.Underlying() + 2025-10-16 1099436f1b go/types, types2: change and enforce lifecycle of Named.fromRHS and Named.underlying fields + 2025-10-16 41f5659347 go/types, types2: remove superfluous unalias call (minor cleanup) + 2025-10-16 e7351c03c8 runtime: use DC ZVA instead of its encoding in WORD in arm64 memclr + 2025-10-16 6cbe0920c4 cmd: update to x/tools@7d9453cc + 2025-10-15 45eee553e2 cmd/internal/obj: move ARM64RegisterExtension from cmd/asm/internal/arch + 2025-10-15 27f9a6705c runtime: increase repeat count for alloc test + 2025-10-15 b68cebd809 net/http/httptest: record failed ResponseWriter writes + 2025-10-15 f1fed742eb cmd: fix three printf problems reported by newest vet + 2025-10-15 0984dcd757 cmd/compile: fix an error in comments + 2025-10-15 31f82877e8 go/types, types2: fix misleading internal comment + 2025-10-15 6346349f56 cmd/compile: replace angle brackets with square + 2025-10-15 284379cdfc cmd/compile: remove rematerializable values from live set across calls + 2025-10-15 519ae514ab cmd/compile: eliminate bound check for slices of the same length + 2025-10-15 b5a29cca48 cmd/distpack: add fix tool to inventory + 2025-10-15 bb5eb51715 runtime/pprof: fix errors in pprof_test + 2025-10-15 5c9a26c7f8 cmd/compile: use arm64 neon in LoweredMemmove/LoweredMemmoveLoop + 2025-10-15 61d1ff61ad cmd/compile: use block starting position for phi line number + 2025-10-15 5b29875c8e cmd/go: inject State parameter into `run.runRun` + 2025-10-15 5113496805 runtime/pprof: skip flaky test TestProfilerStackDepth/heap for now + 2025-10-15 36086e85f8 cmd/go: create temporary cleanup script + 2025-10-14 7056c71d32 cmd/compile: disable use of new saturating float-to-int conversions + 2025-10-14 6d5b13793f Revert "cmd/compile: make 386 float-to-int conversions match amd64" + 2025-10-14 bb2a14252b Revert "runtime: adjust softfloat corner cases to match amd64/arm64" + 2025-10-14 3bc9d9fa83 Revert "cmd/compile: make wasm match other platforms for FP->int32/64 conversions" + 2025-10-14 ee5af46172 encoding/json: avoid misleading errors under goexperiment.jsonv2 + 2025-10-14 11d3d2f77d cmd/internal/obj/arm64: add support for PAC instructions + 2025-10-14 4dbf1a5a4c cmd/compile/internal/devirtualize: do not track assignments to non-PAUTO + 2025-10-14 0ddb5ed465 cmd/compile/internal/devirtualize: use FatalfAt instead of Fatalf where possible + 2025-10-14 0a239bcc99 Revert "net/url: disallow raw IPv6 addresses in host" + 2025-10-14 5a9ef44bc0 cmd/compile/internal/devirtualize: fix OCONVNOP assertion + 2025-10-14 3765758b96 go/types, types2: minor cleanup (remove TODO) + 2025-10-14 f6b9d56aff crypto/internal/fips140/entropy: fix benign race + 2025-10-14 60f6d2f623 crypto/internal/fips140/entropy: support SHA-384 sizes for ACVP tests + 2025-10-13 6fd8e88d07 encoding/json/v2: restrict presence of default options + 2025-10-13 1abc6b0204 go/types, types2: permit type cycles through type parameter lists + 2025-10-13 9fdd6904da strconv: add tests that Java once mishandled + 2025-10-13 9b8742f2e7 cmd/compile: don't depend on arch-dependent conversions in the compiler + 2025-10-13 0e64ee1286 encoding/json/v2: report EOF for top-level values in UnmarshalDecode + 2025-10-13 6bcd97d9f4 all: replace calls to errors.As with errors.AsType + 2025-10-11 1cd71689f2 crypto/x509: rework fix for CVE-2025-58187 + 2025-10-11 8aa1efa223 cmd/link: in TestFallocate, only check number of blocks on Darwin + 2025-10-10 b497a29d25 encoding/json: fix regression in quoted numbers under goexperiment.jsonv2 + 2025-10-10 48bb7a6114 cmd/compile: repair bisection behavior for float-to-unsigned conversion + 2025-10-10 e8a53538b4 runtime: fail TestGoroutineLeakProfile on data race + 2025-10-10 e3be2d1b2b net/url: disallow raw IPv6 addresses in host + 2025-10-10 aced4c79a2 net/http: strip request body headers on POST to GET redirects + 2025-10-10 584a89fe74 all: omit unnecessary reassignment + 2025-10-10 69e8279632 net/http: set cookie host to Request.Host when available + 2025-10-10 6f4c63ba63 cmd/go: unify "go fix" and "go vet" + 2025-10-10 955a5a0dc5 runtime: support arm64 Neon in async preemption + 2025-10-10 5368e77429 net/http: run TestRequestWriteTransport with fake time to avoid flakes + 2025-10-09 c53cb642de internal/buildcfg: enable greenteagc experiment for loong64 + 2025-10-09 954fdcc51a cmd/compile: declare no output register for loong64 LoweredAtomic{And,Or}32 ops + 2025-10-09 19a30ea3f2 cmd/compile: call generated size-specialized malloc functions directly + 2025-10-09 80f3bb5516 reflect: remove timeout in TestChanOfGC + 2025-10-09 9db7e30bb4 net/url: allow IP-literals with IPv4-mapped IPv6 addresses + 2025-10-09 8d810286b3 cmd/compile: make wasm match other platforms for FP->int32/64 conversions + 2025-10-09 b9f3accdcf runtime: adjust softfloat corner cases to match amd64/arm64 + 2025-10-09 78d75b3799 cmd/compile: make 386 float-to-int conversions match amd64 + 2025-10-09 0e466a8d1d cmd/compile: modify float-to-[u]int so that amd64 and arm64 match + 2025-10-08 4837fbe414 net/http/httptest: check whether response bodies are allowed + 2025-10-08 ee163197a8 path/filepath: return cleaned path from Rel + 2025-10-08 de9da0de30 cmd/compile/internal/devirtualize: improve concrete type analysis + 2025-10-08 ae094a1397 crypto/internal/fips140test: make entropy file pair names match + 2025-10-08 941e5917c1 runtime: cleanup comments from asm_ppc64x.s improvements + 2025-10-08 d945600d06 cmd/gofmt: change -d to exit 1 if diffs exist + 2025-10-08 d4830c6130 cmd/internal/obj: fix Link.Diag printf errors + 2025-10-08 e1ca1de123 net/http: format pprof.go + 2025-10-08 e5d004c7a8 net/http: update HTTP/2 documentation to reference new config features + 2025-10-08 97fd6bdecc cmd/compile: fuse NaN checks with other comparisons + 2025-10-07 78b43037dc cmd/go: refactor usage of `workFilePath` + 2025-10-07 bb1ca7ae81 cmd/go, testing: add TB.ArtifactDir and -artifacts flag + 2025-10-07 1623927730 cmd/go: refactor usage of `requirements` + 2025-10-07 a1661e776f Revert "crypto/internal/fips140/subtle: add assembly implementation of xorBytes for mips64x" + 2025-10-07 cb81270113 Revert "crypto/internal/fips140/subtle: add assembly implementation of xorBytes for mipsx" + 2025-10-07 f2d0d05d28 cmd/go: refactor usage of `MainModules` + 2025-10-07 f7a68d3804 archive/tar: set a limit on the size of GNU sparse file 1.0 regions + 2025-10-07 463165699d net/mail: avoid quadratic behavior in mail address parsing + 2025-10-07 5ede095649 net/textproto: avoid quadratic complexity in Reader.ReadResponse + 2025-10-07 5ce8cd16f3 encoding/pem: make Decode complexity linear + 2025-10-07 f6f4e8b3ef net/url: enforce stricter parsing of bracketed IPv6 hostnames + 2025-10-07 7dd54e1fd7 runtime: make work.spanSPMCs.all doubly-linked + 2025-10-07 3ee761739b runtime: free spanQueue on P destroy + 2025-10-07 8709a41d5e encoding/asn1: prevent memory exhaustion when parsing using internal/saferio + 2025-10-07 9b9d02c5a0 net/http: add httpcookiemaxnum GODEBUG option to limit number of cookies parsed + 2025-10-07 3fc4c79fdb crypto/x509: improve domain name verification + 2025-10-07 6e4007e8cf crypto/x509: mitigate DoS vector when intermediate certificate contains DSA public key + 2025-10-07 6f7926589d cmd/go: refactor usage of `modRoots` + 2025-10-07 11d5484190 runtime: fix self-deadlock on sbrk platforms + 2025-10-07 2e52060084 cmd/go: refactor usage of `RootMode` + 2025-10-07 f86ddb54b5 cmd/go: refactor usage of `ForceUseModules` + 2025-10-07 c938051dd0 Revert "cmd/compile: redo arm64 LR/FP save and restore" + 2025-10-07 6469954203 runtime: assert p.destroy runs with GC not running + 2025-10-06 4c0fd3a2b4 internal/goexperiment: remove the synctest GOEXPERIMENT + 2025-10-06 c1e6e49d5d fmt: reduce Errorf("x") allocations to match errors.New("x") + 2025-10-06 7fbf54bfeb internal/buildcfg: enable greenteagc experiment by default + 2025-10-06 7bfeb43509 cmd/go: refactor usage of `initialized` + 2025-10-06 1d62e92567 test/codegen: make sure assignment results are used. + 2025-10-06 4fca79833f runtime: delete redundant code in the page allocator + 2025-10-06 719dfcf8a8 cmd/compile: redo arm64 LR/FP save and restore + 2025-10-06 f3312124c2 runtime: remove batching from spanSPMC free + 2025-10-06 24416458c2 cmd/go: export type State + 2025-10-06 c2fb15164b testing/synctest: remove Run + 2025-10-06 ac2ec82172 runtime: bump thread count slack for TestReadMetricsSched + 2025-10-06 e74b224b7c crypto/tls: streamline BoGo testing w/ -bogo-local-dir + 2025-10-06 3a05e7b032 spec: close tag + 2025-10-03 2a71af11fc net/url: improve URL docs + 2025-10-03 ee5369b003 cmd/link: add LIBRARY statement only with -buildmode=cshared + 2025-10-03 1bca4c1673 cmd/compile: improve slicemask removal + 2025-10-03 38b26f29f1 cmd/compile: remove stores to unread parameters + 2025-10-03 003b5ce1bc cmd/compile: fix SIMD const rematerialization condition + 2025-10-03 d91148c7a8 cmd/compile: enhance prove to infer bounds in slice len/cap calculations + 2025-10-03 20c9377e47 cmd/compile: enhance the chunked indexing case to include reslicing + 2025-10-03 ad3db2562e cmd/compile: handle rematerialized op for incompatible reg constraint + 2025-10-03 18cd4a1fc7 cmd/compile: use the right type for spill slot + 2025-10-03 1caa95acfa cmd/compile: enhance prove to deal with double-offset IsInBounds checks + 2025-10-03 ec70d19023 cmd/compile: rewrite to elide Slicemask from len==c>0 slicing + 2025-10-03 10e7968849 cmd/compile: accounts rematerialize ops's output reginfo + 2025-10-03 ab043953cb cmd/compile: minor tweak for race detector + 2025-10-03 ebb72bef44 cmd/compile: don't treat devel compiler as a released compiler + 2025-10-03 c54dc1418b runtime: support valgrind (but not asan) in specialized malloc functions + 2025-10-03 a7917eed70 internal/buildcfg: enable specializedmalloc experiment + 2025-10-03 630799c6c9 crypto/tls: add flag to render HTML BoGo report Change-Id: I6bf904c523a77ee7d3dea9c8ae72292f8a5f2ba5
2025-11-11runtime: reusable intrusive doubly-linked listMichael Pratt
Unfortunately we have two nearly identical types. One for standard types and one for sys.NotInHeap types or cases that must avoid write barriers. The latter must use uintptr fields, as assignment to unsafe.Pointer fields generates a write barrier. Change-Id: I6a6a636c62d83fa93b991033c7108d3b934412ac Reviewed-on: https://go-review.googlesource.com/c/go/+/714020 Reviewed-by: Michael Knyszek <mknyszek@google.com> Commit-Queue: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Michael Pratt <mpratt@google.com>
2025-10-30runtime: delete timedivRuss Cox
Now that the compiler handles constant 64-bit divisions without function calls on 32-bit systems, we no longer need to maintain and test a bad custom implementation of 64-bit division. Change-Id: If28807ad4f86507267ae69bc8f0b09ec18e98b66 Reviewed-on: https://go-review.googlesource.com/c/go/+/716463 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com>
2025-10-14Revert "runtime: adjust softfloat corner cases to match amd64/arm64"David Chase
This reverts commit b9f3accdcf973ca41069e22e6859b9436801aae5. Reason for revert: we need to do this more carefully, at minimum gated by a module version (This should follow the WASM FP conversion revert) Change-Id: Ib98ce7d243348f69c9944db8537397b225c2cc33 Reviewed-on: https://go-review.googlesource.com/c/go/+/711841 Reviewed-by: Keith Randall <khr@golang.org> TryBot-Bypass: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@google.com>
2025-10-09runtime: adjust softfloat corner cases to match amd64/arm64David Chase
This chooses saturating behavior for over/underflow. Change-Id: I96a33ef73feacdafe8310f893de445060bc1a536 Reviewed-on: https://go-review.googlesource.com/c/go/+/709595 Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com>
2025-10-03[dev.simd] all: merge master (adce7f1) into dev.simdCherry Mui
Conflicts: - src/internal/goexperiment/flags.go - src/runtime/export_test.go Merge List: + 2025-10-03 adce7f196e cmd/link: support .def file with MSVC clang toolchain + 2025-10-03 d5b950399d cmd/cgo: fix unaligned arguments typedmemmove crash on iOS + 2025-10-02 53845004d6 net/http/httputil: deprecate ReverseProxy.Director + 2025-10-02 bbdff9e8e1 net/http: update bundled x/net/http2 and delete obsolete http2inTests + 2025-10-02 4008e07080 io/fs: move path name documentation up to the package doc comment + 2025-10-02 0e4e2e6832 runtime: skip TestGoroutineLeakProfile under mayMoreStackPreempt + 2025-10-02 f03c392295 runtime: fix aix/ppc64 library initialization + 2025-10-02 707454b41f cmd/go: update `go help mod edit` with the tool and ignore sections + 2025-10-02 8c68a1c1ab runtime,net/http/pprof: goroutine leak detection by using the garbage collector + 2025-10-02 84db201ae1 cmd/compile: propagate len([]T{}) to make builtin to allow stack allocation + 2025-10-02 5799c139a7 crypto/tls: rm marshalEncryptedClientHelloConfigList dead code + 2025-10-01 633dd1d475 encoding/json: fix Decoder.InputOffset regression in goexperiment.jsonv2 + 2025-10-01 8ad27fb656 doc/go_spec.html: update date + 2025-10-01 3f451f2c54 testing/synctest: fix inverted test failure message in TestContextAfterFunc + 2025-10-01 be0fed8a5f cmd/go/testdata/script/test_fuzz_fuzztime.txt: disable + 2025-09-30 eb1c7f6e69 runtime: move loong64 library entry point to os-agnostic file + 2025-09-30 c9257151e5 runtime: unify ppc64/ppc64le library entry point + 2025-09-30 4ff8a457db test/codegen: codify handling of floating point constants on arm64 + 2025-09-30 fcb893fc4b cmd/compile/internal/ssa: remove redundant "type:" prefix check + 2025-09-30 19cc1022ba mime: reduce allocs incurred by ParseMediaType + 2025-09-30 08afc50bea mime: extend "builtinTypes" to include a more complete list of common types + 2025-09-30 97da068774 cmd/compile: eliminate nil checks on .dict arg + 2025-09-30 300d9d2714 runtime: initialise debug settings much earlier in startup process + 2025-09-30 a846bb0aa5 errors: add AsType + 2025-09-30 7c8166d02d cmd/link/internal/arm64: support Mach-O ARM64_RELOC_SUBTRACTOR in internal linking + 2025-09-30 6e95748335 cmd/link/internal/arm64: support Mach-O ARM64_RELOC_POINTER_TO_GOT in internal linking + 2025-09-30 742f92063e cmd/compile, runtime: always enable Wasm signext and satconv features + 2025-09-30 db10db6be3 internal/poll: remove operation fields from FD + 2025-09-29 75c87df58e internal/poll: pass the I/O mode instead of an overlapped object in execIO + 2025-09-29 fc88e18b4a crypto/internal/fips140/entropy: add CPU jitter-based entropy source + 2025-09-29 db4fade759 crypto/internal/fips140/mlkem: make CAST conditional + 2025-09-29 db3cb3fd9a runtime: correct reference to getStackMap in comment + 2025-09-29 690fc2fb05 internal/poll: remove buf field from operation + 2025-09-29 eaf2345256 cmd/link: use a .def file to mark exported symbols on Windows + 2025-09-29 4b77733565 internal/syscall/windows: regenerate GetFileSizeEx + 2025-09-29 4e9006a716 crypto/tls: quote protocols in ALPN error message + 2025-09-29 047c2ab841 cmd/link: don't pass -Wl,-S on Solaris + 2025-09-29 ae8eba071b cmd/link: use correct length for pcln.cutab + 2025-09-29 fe3ba74b9e cmd/link: skip TestFlagW on platforms without DWARF symbol table + 2025-09-29 d42d56b764 encoding/xml: make use of reflect.TypeAssert + 2025-09-29 6d51f93257 runtime: jump instead of branch in netbsd/arm64 entry point + 2025-09-28 5500cbf0e4 debug/elf: prevent offset overflow + 2025-09-27 34e67623a8 all: fix typos + 2025-09-27 af6999e60d cmd/compile: implement jump table on loong64 + 2025-09-26 63cd912083 os/user: simplify go:build + 2025-09-26 53009b26dd runtime: use a smaller arena size on Wasm + 2025-09-26 3a5df9d2b2 net/http: add HTTP2Config.StrictMaxConcurrentRequests + 2025-09-26 16be34df02 net/http: add more tests of transport connection pool + 2025-09-26 3e4540b49d os/user: use getgrouplist on illumos && cgo + 2025-09-26 15fbe3480b internal/poll: simplify WriteMsg and ReadMsg on Windows + 2025-09-26 16ae11a9e1 runtime: move TestReadMetricsSched to testprog + 2025-09-26 459f3a3adc cmd/link: don't pass -Wl,-S on AIX + 2025-09-26 4631a2d3c6 cmd/link: skip TestFlagW on AIX + 2025-09-26 0f31d742cd cmd/compile: fix ICE with new(<untyped expr>) + 2025-09-26 7d7cd6e07b internal/poll: don't call SetFilePointerEx in Seek for overlapped handles + 2025-09-26 41cba31e66 mime/multipart: percent-encode CR and LF in header values to avoid CRLF injection + 2025-09-26 dd1d597c3a Revert "cmd/internal/obj/loong64: use the MOVVP instruction to optimize prologue" + 2025-09-26 45d6bc76af runtime: unify arm64 entry point code + 2025-09-25 fdea7da3e6 runtime: use common library entry point on windows amd64/386 + 2025-09-25 e8a4f508d1 lib/fips140: re-seal v1.0.0 + 2025-09-25 9b7a328089 crypto/internal/fips140: remove key import PCTs, make keygen PCTs fatal + 2025-09-25 7f9ab7203f crypto/internal/fips140: update frozen module version to "v1.0.0" + 2025-09-25 fb5719cbda crypto/internal/fips140/ecdsa: make TestingOnlyNewDRBG generic + 2025-09-25 56067e31f2 std: remove unused declarations Change-Id: Iecb28fd62c69fbed59da557f46d31bae55889e2c
2025-09-30runtime: initialise debug settings much earlier in startup processSteve Muir
This is necessary specifically to set the value of `debug.decoratemappings` sufficiently early in the startup sequence that all memory ranges allocated can be named appropriately using the new Linux-specific naming API introduced in #71546. Example output (on ARM64): https://gist.github.com/9muir/3667654b9c3f52e8be92756219371672 Fixes: #75324 Change-Id: Ic0b16233f54a45adef1660c4d0df59af2f5af86a Reviewed-on: https://go-review.googlesource.com/c/go/+/703476 Auto-Submit: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2025-09-25[dev.simd] all: merge master (d70ad4e) into dev.simdCherry Mui
Conflicts: - src/cmd/compile/internal/types2/stdlib_test.go - src/go/types/stdlib_test.go Merge List: + 2025-09-25 d70ad4e740 sync/atomic: correct Uintptr.Or return doc + 2025-09-25 d7abfe4f0d runtime: acquire/release C TSAN lock when calling cgo symbolizer/tracebacker + 2025-09-25 393d91aea0 cmd/fix: remove all functionality + 2025-09-25 6dceff8bad cmd/link: handle -w flag in external linking mode + 2025-09-25 76d088eb74 cmd/internal/obj/riscv: remove ACFLWSP/ACFSWSP and ACFLW/ACFSW + 2025-09-25 5225e9dc49 doc/next: document new image/jpeg DCT in release notes + 2025-09-25 81a83bba21 cmd: update x/tools@4df13e3 + 2025-09-25 6b32c613ca go/types: make typeset return an iterator + 2025-09-25 fbba930271 image/jpeg: replace fdct.go and idct.go with new implementation in dct.go + 2025-09-25 92e093467f image/jpeg: correct and test reference slowFDCT and slowIDCT + 2025-09-25 27c7bbc51c image/jpeg: prepare for new FDCT/IDCT implementations + 2025-09-24 f15cd63ec4 cmd/compile: don't rely on loop info when there are irreducible loops + 2025-09-24 371c1d2fcb cmd/internal/obj/riscv: add support for vector unit-stride fault-only-first load instructions + 2025-09-23 411c250d64 runtime: add specialized malloc functions for sizes up to 512 bytes + 2025-09-23 d7a38adf4c runtime: eliminate global span queue [green tea] + 2025-09-23 7bc1935db5 cmd/compile/internal: support new(expr) + 2025-09-23 eb78f13c9f doc/go_spec.html: document new(expr) + 2025-09-23 74cc463f9e go/token: add TestRemovedFileFileReturnsNil test + 2025-09-23 902dc27ae9 go/token: clear cache after grabbing the mutex in RemoveFile + 2025-09-23 a13d085a5b cmd/cgo: don't hardcode section name in TestNumberOfExportedFunctions + 2025-09-23 61bf26a9ee cmd/link: fix Macho-O X86_64_RELOC_SUBTRACTOR in internal linking + 2025-09-23 4b787c8c2b reflect: remove stale comment in unpackEface + 2025-09-23 3df27cd21a cmd/compile: fix typo in comment + 2025-09-23 684e8d3363 reflect: allocate memory in TypeAssert[I] only when the assertion succeeds + 2025-09-23 a5866ebe40 cmd/compile: prevent shapifying of pointer shape type + 2025-09-23 a27261c42f go/types,types2: allow new(expr) + 2025-09-23 e93f439ac4 runtime/cgo: retry when CreateThread fails with ERROR_ACCESS_DENIED + 2025-09-23 69e74b0aac runtime: deduplicate pMask resize code + 2025-09-23 fde10c4ce7 runtime: split gcMarkWorkAvailable into two separate conditions + 2025-09-23 5d040df092 runtime: use scan kernels in scanSpan [green tea] + 2025-09-23 7e0251bf58 runtime: don't report non-blocked goroutines as "(durable)" in stacks + 2025-09-23 22ac328856 cmd/link: make -w behavior consistent on Windows Change-Id: Id76b5a30a3b6f6669437f97e3320c9bca65a1e96
2025-09-23runtime: eliminate global span queue [green tea]Michael Anthony Knyszek
This change removes the locked global span queue and replaces the fixed-size local span queue with a variable-sized local span queue. The variable-sized local span queue grows as needed to accomodate local work. With no global span queue either, GC workers balance work amongst themselves by stealing from each other. The new variable-sized local span queues are inspired by the P-local deque underlying sync.Pool. Unlike the sync.Pool deque, however, both the owning P and stealing Ps take spans from the tail, making this incarnation a strict queue, not a deque. This is intentional, since we want a queue-like order to encourage objects to accumulate on each span. These variable-sized local span queues are crucial to mark termination, just like the global span queue was. To avoid hitting the ragged barrier too often, we must check whether any Ps have any spans on their variable-sized local span queues. We maintain a per-P atomic bitmask (another pMask) that contains this state. We can also use this to speed up stealing by skipping Ps that don't have any local spans. The variable-sized local span queues are slower than the old fixed-size local span queues because of the additional indirection, so this change adds a non-atomic local fixed-size queue. This risks getting work stuck on it, so, similarly to how workbufs work, each worker will occasionally dump some spans onto its local variable-sized queue. This scales much more nicely than dumping to a global queue, but is still visible to all other Ps. For #73581. Change-Id: I814f54d9c3cc7fa7896167746e9823f50943ac22 Reviewed-on: https://go-review.googlesource.com/c/go/+/700496 Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-09-23[dev.simd] all: merge master (9b2d39b) into dev.simdCherry Mui
Conflicts: - src/internal/buildcfg/exp.go Merge List: + 2025-09-22 9b2d39b75b cmd/compile/internal/ssa: match style and formatting + 2025-09-22 e23edf5e55 runtime: don't re-read metrics before check in TestReadMetricsSched + 2025-09-22 177cd8d763 log/slog: use a pooled json encoder + 2025-09-22 2353c15785 cmd/cgo/internal/test: skip TestMultipleAssign when using UCRT on Windows + 2025-09-22 32dfd69282 cmd/dist: disable FIPS 140-3 mode when testing maphash with purego + 2025-09-19 7f6ff5ec3e cmd/compile: fix doc word + 2025-09-19 9693b94be0 runtime: include stderr when objdump fails + 2025-09-19 8616981ce6 log/slog: optimize slog Level.String() to avoid fmt.Sprintf + 2025-09-19 b8af744360 testing: fix example for unexported identifier + 2025-09-19 51dc5bfe6c Revert "cmd/go: disable cgo by default if CC unset and DefaultCC doesn't exist" + 2025-09-19 ee7bf06cb3 time: improve ParseDuration performance for invalid input + 2025-09-19 f9e61a9a32 cmd/compile: duplicate nil check to two branches of write barrier + 2025-09-18 3cf1aaf8b9 runtime: use futexes with 64-bit time on Linux + 2025-09-18 0ab038af62 cmd/compile/internal/abi: use clear built-in + 2025-09-18 00bf24fdca bytes: use clear in test + 2025-09-18 f9701d21d2 crypto: use clear built-in + 2025-09-18 a58afe44fa net: fix testHookCanceledDial race + 2025-09-18 3203a5da29 net/http: avoid connCount underflow race + 2025-09-18 8ca209ec39 context: don't return a non-nil from Err before Done is closed + 2025-09-18 3032894e04 runtime: make explicit nil check in heapSetTypeSmallHeader + 2025-09-17 ef05b66d61 cmd/internal/obj/riscv: add support for Zicond instructions + 2025-09-17 78ef487a6f cmd/compile: fix the issue of shift amount exceeding the valid range + 2025-09-17 77aac7bb75 runtime: don't enable heap randomization if MSAN or ASAN is enabled + 2025-09-17 465b85eb76 runtime: fix CheckScavengedBitsCleared with randomized heap base + 2025-09-17 909704b85e encoding/json/v2: fix typo in comment + 2025-09-17 3db5979e8c testing: use reflect.TypeAssert and reflect.TypeFor + 2025-09-17 6a8dbbecbf path/filepath: fix EvalSymlinks to return ENOTDIR on plan9 + 2025-09-17 bffe7ad9f1 go/parser: Add TestBothLineAndLeadComment + 2025-09-17 02a888e820 go/ast: document that (*ast.File).Comments is sorted by position + 2025-09-16 594deca981 cmd/link: simplify PE relocations mapping + 2025-09-16 9df1a289ac go/parser: simplify expectSemi + 2025-09-16 72ba117bda internal/buildcfg: enable randomizedHeapBase64 by default + 2025-09-16 796ea3bc2e os/user: align test file name and build tags + 2025-09-16 a69395eab2 runtime/_mkmalloc: add a copy of cloneNode + 2025-09-16 cbdad4fc3c cmd/go: check pattern for utf8 validity before call regexp.MustCompile + 2025-09-16 c2d85eb999 cmd/go: disable cgo by default if CC unset and DefaultCC doesn't exist + 2025-09-16 ac82fe68aa bytes,strings: remove reference to non-existent SplitFunc + 2025-09-16 0b26678db2 cmd/compile: fix mips zerorange implementation + 2025-09-16 e2cfc1eb3a cmd/internal/obj/riscv: improve handling of float point moves + 2025-09-16 281c632e6e crypto/x509/internal/macos: standardize package name + 2025-09-16 61dc7fe30d iter: document that calling yield after terminated range loop causes runtime panic Change-Id: Ic06019efc855913632003f41eb10c746b3410b0a
2025-09-17runtime: don't enable heap randomization if MSAN or ASAN is enabledRoland Shoemaker
MSAN and ASAN do confusing things to the memory layout, which are likely to conflict with heap base randomization, so if they are enabled, ignore randomizedHeapBase64. We already didn't turn it on when TSAN was enabled. Change-Id: I41e59dfc33d8bb059c208a9595442571fb31eea3 Reviewed-on: https://go-review.googlesource.com/c/go/+/704856 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Auto-Submit: Roland Shoemaker <roland@golang.org>
2025-09-17runtime: fix CheckScavengedBitsCleared with randomized heap baseRoland Shoemaker
We cannot easily determine the base address of the arena we added the random padding pages to, which can cause confusing TestScavengedBitsCleared failures when the arena we padded does not have the lowest address of all of the arenas. Instead of attempting to determine the correct arena to ignore when checking the scav and alloc bits, switch to just tolerating _one_ arena having mismatches, which is expected when randomizedHeapBase64 is enabled. Any other number of arenas having mismatches is likely a real error. Fixes #75502 Change-Id: Iacc445b2905824f9f71970c7abd33f187793cf39 Reviewed-on: https://go-review.googlesource.com/c/go/+/704855 Reviewed-by: Michael Knyszek <mknyszek@google.com> Auto-Submit: Roland Shoemaker <roland@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-09-02[dev.simd] internal/cpu: report AVX1 and 2 as supported on macOS 15 Rosetta 2Cherry Mui
Apparently, on macOS 15 or newer, Rosetta 2 supports AVX1 and 2. However, neither CPUID nor the Apple-recommended sysctl says it has AVX. If AVX is used without checking the CPU feature, it may run fine without SIGILL, but the runtime doesn't know AVX is available therefore save and restore its states. This may lead to value corruption. Check if we are running under Rosetta 2 on macOS 15 or newer. If so, report AVX1 and 2 as supported. Change-Id: Ib981379405b1ae28faa378f051096827d760a4cc Reviewed-on: https://go-review.googlesource.com/c/go/+/700055 Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Junyang Shao <shaojunyang@google.com>
2025-08-05runtime: save scalar registers off stack in amd64 async preemptionAustin Clements
Asynchronous preemption must save all registers that could be in use by Go code. Currently, it saves all of these to the goroutine stack. As a result, the stack frame requirements of asynchronous preemption can be rather high. On amd64, this requires 368 bytes of stack space, most of which is the XMM registers. Several RISC architectures are around 0.5 KiB. As we add support for SIMD instructions, this is going to become a problem. The AVX-512 register state is 2.5 KiB. This well exceeds the nosplit limit, and even if it didn't, could constrain when we can asynchronously preempt goroutines on small stacks. This CL fixes this by moving pure scalar state stored in non-GP registers off the stack and into an allocated "extended register state" object. To reduce space overhead, we only allocate these objects as needed. While in the theoretical limit, every G could need this register state, in practice very few do at a time. However, we can't allocate when we're in the middle of saving the register state during an asynchronous preemption, so we reserve scratch space on every P to temporarily store the register state, which can then be copied out to an allocated state object later by Go code. This commit only implements this for amd64, since that's where we're about to add much more vector state, but it lays the groundwork for doing this on any architecture that could benefit. This is a cherry-pick of CL 680898 plus bug fix CL 684836 from the dev.simd branch. Change-Id: I123a95e21c11d5c10942d70e27f84d2d99bbf735 Reviewed-on: https://go-review.googlesource.com/c/go/+/669195 Auto-Submit: Austin Clements <austin@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2025-08-04[dev.simd] all: merge master (7a1679d) into dev.simdCherry Mui
Conflicts: - src/cmd/compile/internal/amd64/ssa.go - src/cmd/compile/internal/ssa/rewriteAMD64.go - src/internal/buildcfg/exp.go - src/internal/cpu/cpu.go - src/internal/cpu/cpu_x86.go - src/internal/goexperiment/flags.go Merge List: + 2025-08-04 7a1679d7ae cmd/compile: move s390x over to new bounds check strategy + 2025-08-04 95693816a5 cmd/compile: move riscv64 over to new bounds check strategy + 2025-08-04 d7bd7773eb go/parser: remove safePos + 2025-08-04 4b6cbc377f cmd/cgo/internal/test: use (syntactic) constant for C array bound + 2025-08-03 b2960e3580 cmd/internal/obj/loong64: add {V,XV}{BITCLR/BITSET/BITREV}[I].{B/H/W/D} instructions support + 2025-08-03 abeeef1c08 cmd/compile/internal/test: fix typo in comments + 2025-08-03 d44749b65b cmd/internal/obj/loong64: add [X]VLDREPL.{B/H/W/D} instructions support + 2025-08-03 d6beda863e runtime: add reference to debugPinnerV1 + 2025-08-01 4ab1aec007 cmd/go: modload should use a read-write lock to improve concurrency + 2025-08-01 e666972a67 runtime: deduplicate Windows stdcall + 2025-08-01 ef40549786 runtime,syscall: move loadlibrary and getprocaddress to syscall + 2025-08-01 336931a4ca cmd/go: use os.Rename to move files on Windows + 2025-08-01 eef5f8d930 cmd/compile: enforce that locals are always accessed with SP base register + 2025-08-01 e071617222 cmd/compile: optimize multiplication rules on loong64 + 2025-07-31 eb7f515c4d cmd/compile: use generated loops instead of DUFFZERO on amd64 + 2025-07-31 c0ee2fd4e3 cmd/go: explicitly reject module paths "go" and "toolchain" + 2025-07-30 a4d99770c0 runtime/metrics: add cleanup and finalizer queue metrics + 2025-07-30 70a2ff7648 runtime: add cgo call benchmark + 2025-07-30 69338a335a cmd/go/internal/gover: fix ModIsPrerelease for toolchain versions + 2025-07-30 cedf63616a cmd/compile: add floating point min/max intrinsics on s390x + 2025-07-30 82a1921c3b all: remove redundant Swiss prefixes + 2025-07-30 2ae059ccaf all: remove GOEXPERIMENT=swissmap + 2025-07-30 cc571dab91 cmd/compile: deduplicate instructions when rewrite func results + 2025-07-30 2174a7936c crypto/tls: use standard chacha20-poly1305 cipher suite names + 2025-07-30 8330fb48a6 cmd/compile: move mips32 over to new bounds check strategy + 2025-07-30 9f9d7b50e8 cmd/compile: move mips64 over to new bounds check strategy + 2025-07-30 5216fd570e cmd/compile: move loong64 over to new bounds check strategy + 2025-07-30 89a0af86b8 cmd/compile: allow ops to specify clobbering input registers + 2025-07-30 5e94d72158 cmd/compile: simplify zerorange on arm64 + 2025-07-30 8cd85e602a cmd/compile: check domination of loop return in both controls + 2025-07-30 cefaed0de0 reflect: fix noswiss builder + 2025-07-30 3aa1b00081 regexp: fix compiling alternate patterns of different fold case literals + 2025-07-30 b1e933d955 cmd/compile: avoid extending when already sufficiently masked on loong64 + 2025-07-29 880ca333d7 cmd/compile: removing log2uint32 function + 2025-07-29 1513661dc3 cmd/compile: simplify logX implementations + 2025-07-29 bd94ae8903 cmd/compile: use unsigned power-of-two detector for unsigned mod + 2025-07-29 f3582fc80e cmd/compile: add unsigned power-of-two detector + 2025-07-29 f7d167fe71 internal/abi: move direct/indirect flag from Kind to TFlag + 2025-07-29 e0b07dc22e os/exec: fix incorrect expansion of "", "." and ".." in LookPath + 2025-07-29 25816d401c internal/goexperiment: delete RangeFunc goexperiment + 2025-07-29 7961bf71f8 internal/goexperiment: delete CacheProg goexperiment + 2025-07-29 e15a14c4dd sync: remove synchashtriemap GOEXPERIMENT + 2025-07-29 7dccd6395c cmd/compile: move arm32 over to new bounds check strategy + 2025-07-29 d79405a344 runtime: only deduct assist credit for arenas during GC + 2025-07-29 19a086f716 cmd/go/internal/telemetrystats: count goexperiments + 2025-07-29 aa95ab8215 image: fix formatting of godoc link + 2025-07-29 4c854b7a3e crypto/elliptic: change a variable name that have the same name as keywords + 2025-07-28 b10eb1d042 cmd/compile: simplify zerorange on amd64 + 2025-07-28 f8eae7a3c3 os/user: fix tests to pass on non-english Windows + 2025-07-28 0984264471 internal/poll: remove msg field from Windows' poll.operation + 2025-07-28 d7b4114346 internal/poll: remove rsan field from Windows' poll.operation + 2025-07-28 361b1ab41f internal/poll: remove sa field from Windows' poll.operation + 2025-07-28 9b6bd64e46 internal/poll: remove qty and flags fields from Windows' poll.operation + 2025-07-28 cd3655a824 internal/runtime/maps: fix spelling errors in comments + 2025-07-28 d5dc36af45 runtime: remove openbsd/mips64 related code + 2025-07-28 64ba72474d errors: omit redundant nil check in type assertion for Join + 2025-07-28 e151db3e06 all: omit unnecessary type conversions + 2025-07-28 4569255f8c cmd/compile: cleanup SelectN rules by indexing into args + 2025-07-28 94645d2413 cmd/compile: rewrite cmov(x, x, cond) into x + 2025-07-28 10c5cf68d4 net/http: add proper panic message + 2025-07-28 46b5839231 test/codegen: fix failing condmove wasm tests + 2025-07-28 98f301cf68 runtime,syscall: move SyscallX implementations from runtime to syscall + 2025-07-28 c7ed3a1c5a internal/runtime/syscall/windows: factor out code from runtime + 2025-07-28 e81eac19d3 hash/crc32: fix incorrect checksums with avx512+race + 2025-07-25 6fbad4be75 cmd/compile: remove no-longer-necessary call to calculateDepths + 2025-07-25 5045fdd8ff cmd/compile: fix containsUnavoidableCall computation + 2025-07-25 d28b27cd8e go/types, types2: use nil to represent incomplete explicit aliases + 2025-07-25 7b53d8d06e cmd/compile/internal/types2: add loaded state between loader calls and constraint expansion + 2025-07-25 374e3be2eb os/user: user random name for the test user account + 2025-07-25 1aa154621d runtime: rename scanobject to scanObject + 2025-07-25 41b429881a runtime: duplicate scanobject in greentea and non-greentea files + 2025-07-25 aeb256e98a cmd/compile: remove unused arg from gorecover + 2025-07-25 08376e1a9c runtime: iterate through inlinings when processing recover() + 2025-07-25 c76c3abc54 encoding/json: fix truncated Token error regression in goexperiment.jsonv2 + 2025-07-25 ebdbfccd98 encoding/json/jsontext: preserve buffer capacity in Encoder.Reset + 2025-07-25 91c4f0ccd5 reflect: avoid a bounds check in stack-constrained code + 2025-07-24 3636ced112 encoding/json: fix extra data regression under goexperiment.jsonv2 + 2025-07-24 a6eec8bdc7 encoding/json: reduce error text regressions under goexperiment.jsonv2 + 2025-07-24 0fa88dec1e time: remove redundant uint32 conversion in split + 2025-07-24 ada30b8248 internal/buildcfg: add ability to get GORISCV64 variable in GOGOARCH + 2025-07-24 6f6c6c5782 cmd/internal/obj: rip out argp adjustment for wrapper frames + 2025-07-24 7b50024330 runtime: detect successful recovers differently + 2025-07-24 7b9de668bd unicode/utf8: skip ahead during ascii runs in Valid/ValidString + 2025-07-24 076eae436e cmd/compile: move amd64 and 386 over to new bounds check strategy + 2025-07-24 f703dc5bef cmd/compile: add missing StringLen rule in prove + 2025-07-24 394d0bee8d cmd/compile: move arm64 over to new bounds check strategy + 2025-07-24 3024785b92 cmd/compile,runtime: remember idx+len for bounds check failure with less code + 2025-07-24 741a19ab41 runtime: move bounds check constants to internal/abi + 2025-07-24 ce05ad448f cmd/compile: rewrite condselects into doublings and halvings + 2025-07-24 fcd28070fe cmd/compile: add opt branchelim to rewrite some CondSelect into math + 2025-07-24 f32cf8e4b0 cmd/compile: learn transitive proofs for safe unsigned subs + 2025-07-24 d574856482 cmd/compile: learn transitive proofs for safe negative signed adds + 2025-07-24 1a72920f09 cmd/compile: learn transitive proofs for safe positive signed adds + 2025-07-24 e5f202bb60 cmd/compile: learn transitive proofs for safe unsigned adds + 2025-07-24 bd80f74bc1 cmd/compile: fold shift through AND for slice operations + 2025-07-24 5c45fe1385 internal/runtime/syscall: rename to internal/runtime/syscall/linux + 2025-07-24 592c2db868 cmd/compile: improve loopRotate to handle nested loops + 2025-07-24 dcb479c2f9 cmd/compile: optimize slice bounds checking with SUB/SUBconst comparisons + 2025-07-24 f11599b0b9 internal/poll: remove handle field from Windows' poll.operation + 2025-07-24 f7432e0230 internal/poll: remove fd field from Windows' poll.operation + 2025-07-24 e84ed38641 runtime: add benchmark for small-size memmory operation + 2025-07-24 18dbe5b941 hash/crc32: add AVX512 IEEE CRC32 calculation + 2025-07-24 c641900f72 cmd/compile: prefer base.Fatalf to panic in dwarfgen + 2025-07-24 d71d8aeafd cmd/internal/obj/s390x: add MVCLE instruction + 2025-07-24 b6cf1d94dc runtime: optimize memclr on mips64x + 2025-07-24 a8edd99479 runtime: improvement in memclr for s390x + 2025-07-24 bd04f65511 internal/runtime/exithook: fix a typo + 2025-07-24 5c8624a396 cmd/internal/goobj: make error output clear + 2025-07-24 44d73dfb4e cmd/go/internal/doc: clean up after merge with cmd/internal/doc + 2025-07-24 bd446662dd cmd/internal/doc: merge with cmd/go/internal/doc + 2025-07-24 da8b50c830 cmd/doc: delete + 2025-07-24 6669aa3b14 runtime: randomize heap base address + 2025-07-24 26338a7f69 cmd/compile: use better fatal message for staticValue1 + 2025-07-24 8587ba272e cmd/cgo: compare malloc return value to NULL instead of literal 0 + 2025-07-24 cae45167b7 go/types, types2: better error messages for certain type mismatches + 2025-07-24 2ddf542e4c cmd/compile: use ,ok return idiom for sparsemap.get + 2025-07-24 6505fcbd0a cmd/compile: use generics for sparse map + 2025-07-24 14f5eb7812 cmd/api: rerun updategolden + 2025-07-24 52b6d7f67a runtime: drop NetBSD kernel bug sysmon workaround fixed in NetBSD 9.2 + 2025-07-24 1ebebf1cc1 cmd/go: clean should respect workspaces + 2025-07-24 6536a93547 encoding/json/jsontext: preserve buffer capacity in Decoder.Reset + 2025-07-24 efc37e97c0 cmd/go: always return the cached path from go tool -n + 2025-07-23 98a031193b runtime: check TestUsingVDSO ExitError type assertion + 2025-07-23 6bb42997c8 doc/next: initialize + 2025-07-23 2696a11a97 internal/goversion: update Version to 1.26 + 2025-07-23 489868f776 cmd/link: scope test to linux & net.sendFile + 2025-07-22 71c2bf5513 cmd/compile: fix loclist for heap return vars without optimizations + 2025-07-22 c74399e7f5 net: correct comment for ListenConfig.ListenPacket + 2025-07-22 4ed9943b26 all: go fmt + 2025-07-22 1aaf7422f1 cmd/internal/objabi: remove redundant word in comment + 2025-07-21 d5ec0815e6 runtime: relax TestMemoryLimitNoGCPercent a bit + 2025-07-21 f7cc61e7d7 cmd/compile: for arm64 epilog, do SP increment with a single instruction + 2025-07-21 5dac42363b runtime: fix asan wrapper for riscv64 + 2025-07-21 e5502e0959 cmd/go: check subcommand properties + 2025-07-19 2363897932 cmd/internal/obj: enable got pcrel itype in fips140 for riscv64 + 2025-07-19 e32255fcc0 cmd/compile/internal/ssa: restrict architectures for TestDebugLines_74576 + 2025-07-18 0451816430 os: revert the use of AddCleanup to close files and roots + 2025-07-18 34b70684ba go/types: infer correct type for y in append(bytes, y...) + 2025-07-17 66536242fc cmd/compile/internal/escape: improve DWARF .debug_line numbering for literal rewriting optimizations + 2025-07-16 385000b004 runtime: fix idle time double-counting bug + 2025-07-16 f506ad2644 cmd/compile/internal/escape: speed up analyzing some functions with many closures + 2025-07-16 9c507e7942 cmd/link, runtime: on Wasm, put only function index in method table and func table + 2025-07-16 9782dcfd16 runtime: use 32-bit function index on Wasm + 2025-07-16 c876bf9346 cmd/internal/obj/wasm: use 64-bit instructions for indirect calls + 2025-07-15 b4309ece66 cmd/internal/doc: upgrade godoc pkgsite to 01b046e + 2025-07-15 75a19dbcd7 runtime: use memclrNoHeapPointers to clear inline mark bits + 2025-07-15 6d4a91c7a5 runtime: only clear inline mark bits on span alloc if necessary + 2025-07-15 0c6296ab12 runtime: have mergeInlineMarkBits also clear the inline mark bits + 2025-07-15 397d2117ec runtime: merge inline mark bits with gcmarkBits 8 bytes at a time + 2025-07-15 7dceabd3be runtime/maps: fix typo in group.go comment (instrinsified -> intrinsified) + 2025-07-15 d826bf4d74 os: remove useless error check + 2025-07-14 bb07e55aff runtime: expand GOMAXPROCS documentation + 2025-07-14 9159cd4ec6 encoding/json: decompose legacy options + 2025-07-14 c6556b8eb3 encoding/json/v2: add security section to doc + 2025-07-11 6ebb5f56d9 runtime: gofmt after CL 643897 and CL 662455 + 2025-07-11 1e48ca7020 encoding/json: remove legacy option to EscapeInvalidUTF8 + 2025-07-11 a0a99cb22b encoding/json/v2: report wrapped io.ErrUnexpectedEOF + 2025-07-11 9d04122d24 crypto/rsa: drop contradictory promise to keep PublicKey modulus secret + 2025-07-11 1ca23682dd crypto/rsa: fix documentation formatting + 2025-07-11 4bc3373c8e runtime: turn off large memmove tests under asan/msan Change-Id: I1e32d964eba770b85421efb86b305a2242f24466
2025-07-30all: remove GOEXPERIMENT=swissmapMichael Pratt
For #54766. Change-Id: I6a6a636c40b5fe2e8b0d4a5e23933492bc8bb76e Reviewed-on: https://go-review.googlesource.com/c/go/+/691595 Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org>
2025-07-29internal/abi: move direct/indirect flag from Kind to TFlagKeith Randall
This info makes more sense in the flags instead of as a high bit of the kind. This makes kind access simpler because we now don't need to mask anything. Cleaned up most direct field accesses to use methods instead. (reflect making new types is the only remaining direct accessor.) IfaceIndir -> !IsDirectIface everywhere. gocore has been updated to handle the new location. So has delve. TODO: any other tools need updating? Change-Id: I123f97a4d4bdd0bff1641ee7e276d1cc0bd7e8eb Reviewed-on: https://go-review.googlesource.com/c/go/+/681936 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-07-24runtime: randomize heap base addressRoland Shoemaker
During initialization, allow randomizing the heap base address by generating a random uint64 and using its bits to randomize various portions of the heap base address. We use the following method to randomize the base address: * We first generate a random heapArenaBytes aligned address that we use for generating the hints. * On the first call to mheap.grow, we then generate a random PallocChunkBytes aligned offset into the mmap'd heap region, which we use as the base for the heap region. * We then mark a random number of pages within the page allocator as allocated. Our final randomized "heap base address" becomes the first byte of the first available page returned by the page allocator. This results in an address with at least heapAddrBits-gc.PageShift-1 bits of entropy. Fixes #27583 Change-Id: Ideb4450a5ff747a132f702d563d2a516dec91a88 Reviewed-on: https://go-review.googlesource.com/c/go/+/674835 Reviewed-by: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-07-11[dev.simd] all: merge master (88cf0c5) into dev.simdCherry Mui
Merge List: + 2025-07-11 88cf0c5d55 cmd/link: do size fixups after symbol references are loaded + 2025-07-10 7a38975a48 os: trivial comment fix + 2025-07-10 aa5de9ebb5 synctest: fix comments for time.Now() in synctests + 2025-07-10 63ec70d4e1 crypto/cipher: Fix comment punctuation + 2025-07-09 8131635e5a runtime: run TestSignalDuringExec in its own process group + 2025-07-09 67c1704444 crypto/tls: empty server_name conf. ext. from server + 2025-07-08 54c9d77630 cmd/go: disable support for multiple vcs in one module + 2025-07-08 fca43a8436 internal: make struct comment match struct name + 2025-07-08 bb917bb030 cmd/compile: document that nosplit directive is unsafe + 2025-07-08 a5bda585d5 cmd/compile: run fmt on ssa + 2025-07-07 86b5ba7310 internal/trace: only test for sync preemption if async preemption is off + 2025-07-07 ef46e1b164 cmd/internal/doc: fix GOROOT skew and path joining bugs + 2025-07-07 75b43f9a97 runtime: make traceStack testable and add a benchmark + 2025-07-07 20978f46fd crypto/rsa: remove another forgotten note to future self + 2025-07-07 33fb4819f5 cmd/compile/internal/ssa: skip EndSequence entries in TestStmtLines + 2025-07-07 a995269a93 sort: clarify Less doc + 2025-07-03 6c3b5a2798 runtime: correct vdsoSP on S390X + 2025-07-03 dd687c3860 hash: document that Clone may only return ErrUnsupported or a nil error + 2025-07-02 b325151453 cmd/cgo/internal/testsanitizers: skip asan tests when FIPS140 mode is on + 2025-07-02 15d9fe43d6 testing/synctest: explicitly state Run will be removed in Go 1.26 + 2025-07-01 de646d94f7 cmd/go/internal/modindex: apply changes in CL 502615 to modindex package + 2025-07-01 2f653a5a9e crypto/tls: ensure the ECDSA curve matches the signature algorithm + 2025-07-01 6e95fd96cc crypto/ecdsa: fix crypto/x509 godoc links + 2025-07-01 7755a05209 Revert "crypto/internal/fips140/subtle: add assembly implementation of xorBytes for arm" + 2025-07-01 d168ad18e1 slices: update TestIssue68488 to avoid false positives + 2025-07-01 27ad1f5013 internal/abi: fix comment on NonEmptyInterface + 2025-06-30 86fca3dcb6 encoding/json/jsontext: use bytes.Buffer.AvailableBuffer + 2025-06-30 6bd9944c9a encoding/json/v2: avoid escaping jsonopts.Struct + 2025-06-30 e46d586edd cmd/compile/internal/escape: add debug hash for literal allocation optimizations + 2025-06-30 479b51ee1f cmd/compile/internal/escape: stop disabling literal allocation optimizations when coverage is enabled + 2025-06-30 8002d283e8 crypto/tls: update bogo version + 2025-06-30 fdd7713fe5 internal/goexperiment: fix godoc formatting Change-Id: I074e6c75778890930975925c016004aabca2b9d1
2025-07-07runtime: make traceStack testable and add a benchmarkMichael Anthony Knyszek
Change-Id: Ide4daa5eee3fd4f3007d6ef23aa84b8916562c39 Reviewed-on: https://go-review.googlesource.com/c/go/+/684457 Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-06-30[dev.simd] runtime: save scalar registers off stack in amd64 async preemptionAustin Clements
Asynchronous preemption must save all registers that could be in use by Go code. Currently, it saves all of these to the goroutine stack. As a result, the stack frame requirements of asynchronous preemption can be rather high. On amd64, this requires 368 bytes of stack space, most of which is the XMM registers. Several RISC architectures are around 0.5 KiB. As we add support for SIMD instructions, this is going to become a problem. The AVX-512 register state is 2.5 KiB. This well exceeds the nosplit limit, and even if it didn't, could constrain when we can asynchronously preempt goroutines on small stacks. This CL fixes this by moving pure scalar state stored in non-GP registers off the stack and into an allocated "extended register state" object. To reduce space overhead, we only allocate these objects as needed. While in the theoretical limit, every G could need this register state, in practice very few do at a time. However, we can't allocate when we're in the middle of saving the register state during an asynchronous preemption, so we reserve scratch space on every P to temporarily store the register state, which can then be copied out to an allocated state object later by Go code. This commit only implements this for amd64, since that's where we're about to add much more vector state, but it lays the groundwork for doing this on any architecture that could benefit. Change-Id: I123a95e21c11d5c10942d70e27f84d2d99bbf735 Reviewed-on: https://go-review.googlesource.com/c/go/+/680898 Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Austin Clements <austin@google.com>
2025-06-10testing/synctest, runtime: avoid panic when using linker-alloc WG from bubbleDamien Neil
We associate WaitGroups with synctest bubbles by attaching a special to the WaitGroup. It is not possible to attach a special to a linker-allocated value, such as: var wg sync.WaitGroup Avoid panicking when accessing a linker-allocated WaitGroup from a bubble. We have no way to associate these WaitGroups with a bubble, so just treat them as always unbubbled. This is probably fine, since the WaitGroup was always created outside the bubble in this case. Fixes #74005 Change-Id: Ic71514b0b8d0cecd62e45cc929ffcbeb16f54a55 Reviewed-on: https://go-review.googlesource.com/c/go/+/679695 Reviewed-by: Michael Knyszek <mknyszek@google.com> Auto-Submit: Damien Neil <dneil@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-05-19runtime: move atoi to internal/runtime/strconvMichael Pratt
Moving to a smaller package allows its use in other internal/runtime packages. This isn't internal/strconvlite since it can't be used directly by strconv. For #73193. Change-Id: I6a6a636c9c8b3f06b5fd6c07fe9dd5a7a37d1429 Reviewed-on: https://go-review.googlesource.com/c/go/+/672697 Reviewed-by: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Michael Pratt <mpratt@google.com>
2025-05-08runtime: schedule cleanups across multiple goroutinesMichael Anthony Knyszek
This change splits the finalizer and cleanup queues and implements a new lock-free blocking queue for cleanups. The basic design is as follows: The cleanup queue is organized in fixed-sized blocks. Individual cleanup functions are queued, but only whole blocks are dequeued. Enqueuing cleanups places them in P-local cleanup blocks. These are flushed to the full list as they get full. Cleanups can only be enqueued by an active sweeper. Dequeuing cleanups always dequeues entire blocks from the full list. Cleanup blocks can be dequeued and executed at any time. The very last active sweeper in the sweep phase is responsible for flushing all local cleanup blocks to the full list. It can do this without any synchronization because the next GC can't start yet, so we can be very certain that nobody else will be accessing the local blocks. Cleanup blocks are stored off-heap because the need to be allocated by the sweeper, which is called from heap allocation paths. As a result, the GC treats cleanup blocks as roots, just like finalizer blocks. Flushes to the full list signal to the scheduler that cleanup goroutines should be awoken. Every time the scheduler goes to wake up a cleanup goroutine and there were more signals than goroutines to wake, it then forwards this signal to runtime.AddCleanup, so that it creates another goroutine the next time it is called, up to gomaxprocs goroutines. The signals here are a little convoluted, but exist because the sweeper and the scheduler cannot safely create new goroutines. For #71772. For #71825. Change-Id: Ie839fde2b67e1b79ac1426be0ea29a8d923a62cc Reviewed-on: https://go-review.googlesource.com/c/go/+/650697 Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Michael Knyszek <mknyszek@google.com>
2025-05-07runtime: verify attribution of mutex delayRhys Hiltner
Have the test use the same clock (cputicks) as the profiler, and use the test's own measurements as hard bounds on the magnitude to expect in the profile. Compare the depiction of two users of the same lock: one where the critical section is fast, one where it is slow. Confirm that the profile shows the slow critical section as a large source of delay (with #66999 fixed), rather than showing the fast critical section as a large recipient of delay. Previously reviewed as https://go.dev/cl/586237. For #66999 Change-Id: Ic2d78cc29153d5322577d84abdc448e95ed8f594 Reviewed-on: https://go-review.googlesource.com/c/go/+/667616 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Rhys Hiltner <rhys.hiltner@gmail.com>
2025-05-02runtime: mark and scan small objects in whole spans [green tea]Michael Anthony Knyszek
Our current parallel mark algorithm suffers from frequent stalls on memory since its access pattern is essentially random. Small objects are the worst offenders, since each one forces pulling in at least one full cache line to access even when the amount to be scanned is far smaller than that. Each object also requires an independent access to per-object metadata. The purpose of this change is to improve garbage collector performance by scanning small objects in batches to obtain better cache locality than our current approach. The core idea behind this change is to defer marking and scanning small objects, and then scan them in batches localized to a span. This change adds scanned bits to each small object (<=512 bytes) span in addition to mark bits. The scanned bits indicate that the object has been scanned. (One way to think of them is "grey" bits and "black" bits in the tri-color mark-sweep abstraction.) Each of these spans is always 8 KiB and if they contain pointers, the pointer/scalar data is already packed together at the end of the span, allowing us to further optimize the mark algorithm for this specific case. When the GC encounters a pointer, it first checks if it points into a small object span. If so, it is first marked in the mark bits, and then the object is queued on a work-stealing P-local queue. This object represents the whole span, and we ensure that a span can only appear at most once in any queue by maintaining an atomic ownership bit for each span. Later, when the pointer is dequeued, we scan every object with a set mark that doesn't have a corresponding scanned bit. If it turns out that was the only object in the mark bits since the last time we scanned the span, we scan just that object directly, essentially falling back to the existing algorithm. noscan objects have no scan work, so they are never queued. Each span's mark and scanned bits are co-located together at the end of the span. Since the span is always 8 KiB in size, it can be found with simple pointer arithmetic. Next to the marks and scans we also store the size class, eliminating the need to access the span's mspan altogether. The work-stealing P-local queue is a new source of GC work. If this queue gets full, half of it is dumped to a global linked list of spans to scan. The regular scan queues are always prioritized over this queue to allow time for darts to accumulate. Stealing work from other Ps is a last resort. This change also adds a new debug mode under GODEBUG=gctrace=2 that dumps whole-span scanning statistics by size class on every GC cycle. A future extension to this CL is to use SIMD-accelerated scanning kernels for scanning spans with high mark bit density. For #19112. (Deadlock averted in GOEXPERIMENT.) For #73581. Change-Id: I4bbb4e36f376950a53e61aaaae157ce842c341bc Reviewed-on: https://go-review.googlesource.com/c/go/+/658036 Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-04-23runtime: align taggable pointers more so we can use low bits for tagKeith Randall
Currently we assume alignment to 8 bytes, so we can steal the low 3 bits. This CL assumes alignment to 512 bytes, so we can steal the low 9 bits. That's 6 extra bits! Aligning to 512 bytes wastes a bit of space but it is not egregious. Most of the objects that we make tagged pointers to are pretty big. Update #49405 Change-Id: I66fc7784ac1be5f12f285de1d7851d5a6871fb75 Reviewed-on: https://go-review.googlesource.com/c/go/+/665815 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Auto-Submit: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2025-04-23runtime: move sizeclass defs to new package internal/runtime/gcMichael Anthony Knyszek
We will want to reference these definitions from new generator programs, and this is a good opportunity to cleanup all these old C-style names. Change-Id: Ifb06f0afc381e2697e7877f038eca786610c96de Reviewed-on: https://go-review.googlesource.com/c/go/+/655275 Auto-Submit: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
2025-03-04runtime: decorate anonymous memory mappingsLénaïc Huard
Leverage the prctl(PR_SET_VMA, PR_SET_VMA_ANON_NAME, ...) API to name the anonymous memory areas. This API has been introduced in Linux 5.17 to decorate the anonymous memory areas shown in /proc/<pid>/maps. This is already used by glibc. See: * https://sourceware.org/git/?p=glibc.git;a=blob;f=malloc/malloc.c;h=27dfd1eb907f4615b70c70237c42c552bb4f26a8;hb=HEAD#l2434 * https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/setvmaname.c;h=ea93a5ffbebc9e5a7e32a297138f465724b4725f;hb=HEAD#l63 This can be useful when investigating the memory consumption of a multi-language program. On a 100% Go program, pprof profiler can be used to profile the memory consumption of the program. But pprof is only aware of what happens within the Go world. On a multi-language program, there could be a doubt about whether the suspicious extra-memory consumption comes from the Go part or the native part. With this change, the following Go program: package main import ( "fmt" "log" "os" ) /* #include <stdlib.h> void f(void) { (void)malloc(1024*1024*1024); } */ import "C" func main() { C.f() data, err := os.ReadFile("/proc/self/maps") if err != nil { log.Fatal(err) } fmt.Println(string(data)) } produces this output: $ GLIBC_TUNABLES=glibc.mem.decorate_maps=1 ~/doc/devel/open-source/go/bin/go run . 00400000-00402000 r--p 00000000 00:21 28451768 /home/lenaic/.cache/go-build/9f/9f25a17baed5a80d03eb080a2ce2a5ff49c17f9a56e28330f0474a2bb74a30a0-d/test_vma_name 00402000-004a4000 r-xp 00002000 00:21 28451768 /home/lenaic/.cache/go-build/9f/9f25a17baed5a80d03eb080a2ce2a5ff49c17f9a56e28330f0474a2bb74a30a0-d/test_vma_name 004a4000-00574000 r--p 000a4000 00:21 28451768 /home/lenaic/.cache/go-build/9f/9f25a17baed5a80d03eb080a2ce2a5ff49c17f9a56e28330f0474a2bb74a30a0-d/test_vma_name 00574000-00575000 r--p 00173000 00:21 28451768 /home/lenaic/.cache/go-build/9f/9f25a17baed5a80d03eb080a2ce2a5ff49c17f9a56e28330f0474a2bb74a30a0-d/test_vma_name 00575000-00580000 rw-p 00174000 00:21 28451768 /home/lenaic/.cache/go-build/9f/9f25a17baed5a80d03eb080a2ce2a5ff49c17f9a56e28330f0474a2bb74a30a0-d/test_vma_name 00580000-005a4000 rw-p 00000000 00:00 0 2e075000-2e096000 rw-p 00000000 00:00 0 [heap] c000000000-c000400000 rw-p 00000000 00:00 0 [anon: Go: heap] c000400000-c004000000 ---p 00000000 00:00 0 [anon: Go: heap reservation] 777f40000000-777f40021000 rw-p 00000000 00:00 0 [anon: glibc: malloc arena] 777f40021000-777f44000000 ---p 00000000 00:00 0 777f44000000-777f44021000 rw-p 00000000 00:00 0 [anon: glibc: malloc arena] 777f44021000-777f48000000 ---p 00000000 00:00 0 777f48000000-777f48021000 rw-p 00000000 00:00 0 [anon: glibc: malloc arena] 777f48021000-777f4c000000 ---p 00000000 00:00 0 777f4c000000-777f4c021000 rw-p 00000000 00:00 0 [anon: glibc: malloc arena] 777f4c021000-777f50000000 ---p 00000000 00:00 0 777f50000000-777f50021000 rw-p 00000000 00:00 0 [anon: glibc: malloc arena] 777f50021000-777f54000000 ---p 00000000 00:00 0 777f55afb000-777f55afc000 ---p 00000000 00:00 0 777f55afc000-777f562fc000 rw-p 00000000 00:00 0 [anon: glibc: pthread stack: 216378] 777f562fc000-777f562fd000 ---p 00000000 00:00 0 777f562fd000-777f56afd000 rw-p 00000000 00:00 0 [anon: glibc: pthread stack: 216377] 777f56afd000-777f56afe000 ---p 00000000 00:00 0 777f56afe000-777f572fe000 rw-p 00000000 00:00 0 [anon: glibc: pthread stack: 216376] 777f572fe000-777f572ff000 ---p 00000000 00:00 0 777f572ff000-777f57aff000 rw-p 00000000 00:00 0 [anon: glibc: pthread stack: 216375] 777f57aff000-777f57b00000 ---p 00000000 00:00 0 777f57b00000-777f58300000 rw-p 00000000 00:00 0 [anon: glibc: pthread stack: 216374] 777f58300000-777f58400000 rw-p 00000000 00:00 0 [anon: Go: page alloc index] 777f58400000-777f5a400000 rw-p 00000000 00:00 0 [anon: Go: heap index] 777f5a400000-777f6a580000 ---p 00000000 00:00 0 [anon: Go: scavenge index] 777f6a580000-777f6a581000 rw-p 00000000 00:00 0 [anon: Go: scavenge index] 777f6a581000-777f7a400000 ---p 00000000 00:00 0 [anon: Go: scavenge index] 777f7a400000-777f8a580000 ---p 00000000 00:00 0 [anon: Go: page summary] 777f8a580000-777f8a581000 rw-p 00000000 00:00 0 [anon: Go: page alloc] 777f8a581000-777f9c430000 ---p 00000000 00:00 0 [anon: Go: page summary] 777f9c430000-777f9c431000 rw-p 00000000 00:00 0 [anon: Go: page alloc] 777f9c431000-777f9e806000 ---p 00000000 00:00 0 [anon: Go: page summary] 777f9e806000-777f9e807000 rw-p 00000000 00:00 0 [anon: Go: page alloc] 777f9e807000-777f9ec00000 ---p 00000000 00:00 0 [anon: Go: page summary] 777f9ec36000-777f9ecb6000 rw-p 00000000 00:00 0 [anon: Go: immortal metadata] 777f9ecb6000-777f9ecc6000 rw-p 00000000 00:00 0 [anon: Go: gc bits] 777f9ecc6000-777f9ecd6000 rw-p 00000000 00:00 0 [anon: Go: allspans array] 777f9ecd6000-777f9ece7000 rw-p 00000000 00:00 0 [anon: Go: immortal metadata] 777f9ece7000-777f9ed67000 ---p 00000000 00:00 0 [anon: Go: page summary] 777f9ed67000-777f9ed68000 rw-p 00000000 00:00 0 [anon: Go: page alloc] 777f9ed68000-777f9ede7000 ---p 00000000 00:00 0 [anon: Go: page summary] 777f9ede7000-777f9ee07000 rw-p 00000000 00:00 0 [anon: Go: page alloc] 777f9ee07000-777f9ee0a000 rw-p 00000000 00:00 0 [anon: glibc: loader malloc] 777f9ee0a000-777f9ee2e000 r--p 00000000 00:21 48158213 /usr/lib/libc.so.6 777f9ee2e000-777f9ef9f000 r-xp 00024000 00:21 48158213 /usr/lib/libc.so.6 777f9ef9f000-777f9efee000 r--p 00195000 00:21 48158213 /usr/lib/libc.so.6 777f9efee000-777f9eff2000 r--p 001e3000 00:21 48158213 /usr/lib/libc.so.6 777f9eff2000-777f9eff4000 rw-p 001e7000 00:21 48158213 /usr/lib/libc.so.6 777f9eff4000-777f9effc000 rw-p 00000000 00:00 0 777f9effc000-777f9effe000 rw-p 00000000 00:00 0 [anon: glibc: loader malloc] 777f9f00a000-777f9f04a000 rw-p 00000000 00:00 0 [anon: Go: immortal metadata] 777f9f04a000-777f9f04c000 r--p 00000000 00:00 0 [vvar] 777f9f04c000-777f9f04e000 r--p 00000000 00:00 0 [vvar_vclock] 777f9f04e000-777f9f050000 r-xp 00000000 00:00 0 [vdso] 777f9f050000-777f9f051000 r--p 00000000 00:21 48158204 /usr/lib/ld-linux-x86-64.so.2 777f9f051000-777f9f07a000 r-xp 00001000 00:21 48158204 /usr/lib/ld-linux-x86-64.so.2 777f9f07a000-777f9f085000 r--p 0002a000 00:21 48158204 /usr/lib/ld-linux-x86-64.so.2 777f9f085000-777f9f087000 r--p 00034000 00:21 48158204 /usr/lib/ld-linux-x86-64.so.2 777f9f087000-777f9f088000 rw-p 00036000 00:21 48158204 /usr/lib/ld-linux-x86-64.so.2 777f9f088000-777f9f089000 rw-p 00000000 00:00 0 7ffc7bfa7000-7ffc7bfc8000 rw-p 00000000 00:00 0 [stack] ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0 [vsyscall] The anonymous memory areas are now labelled so that we can see which ones have been allocated by the Go runtime versus which ones have been allocated by the glibc. Fixes #71546 Change-Id: I304e8b4dd7f2477a6da794fd44e9a7a5354e4bf4 Reviewed-on: https://go-review.googlesource.com/c/go/+/646095 Auto-Submit: Alan Donovan <adonovan@google.com> Commit-Queue: Alan Donovan <adonovan@google.com> Reviewed-by: Felix Geisendörfer <felix.geisendoerfer@datadoghq.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-11-21all: fix some function names and typos in commentcuishuang
Change-Id: I07e7c8eaa5bd4bac0d576b2f2f4cd3f81b0b77a4 Reviewed-on: https://go-review.googlesource.com/c/go/+/630055 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Commit-Queue: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Russ Cox <rsc@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com>
2024-11-18runtime: get rid of gc programs for typesKeith Randall
Instead, have the runtime build the gc bitmaps on demand at runtime. Change-Id: If7a245bc62e4bce3ce80972410b0ed307d921abe Reviewed-on: https://go-review.googlesource.com/c/go/+/616255 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@google.com>
2024-11-13runtime: prevent weak->strong conversions during mark terminationMichael Anthony Knyszek
Currently it's possible for weak->strong conversions to create more GC work during mark termination. When a weak->strong conversion happens during the mark phase, we need to mark the newly-strong pointer, since it may now be the only pointer to that object. In other words, the object could be white. But queueing new white objects creates GC work, and if this happens during mark termination, we could end up violating mark termination invariants. In the parlance of the mark termination algorithm, the weak->strong conversion is a non-monotonic source of GC work, unlike the write barriers (which will eventually only see black objects). This change fixes the problem by forcing weak->strong conversions to block during mark termination. We can do this efficiently by setting a global flag before the ragged barrier that is checked at each weak->strong conversion. If the flag is set, then the conversions block. The ragged barrier ensures that all Ps have observed the flag and that any weak->strong conversions which completed before the ragged barrier have their newly-minted strong pointers visible in GC work queues if necessary. We later unset the flag and wake all the blocked goroutines during the mark termination STW. There are a few subtleties that we need to account for. For one, it's possible that a goroutine which blocked in a weak->strong conversion wakes up only to find it's mark termination time again, so we need to recheck the global flag on wake. We should also stay non-preemptible while performing the check, so that if the check *does* appear as true, it cannot switch back to false while we're actively trying to block. If it switches to false while we try to block, then we'll be stuck in the queue until the following GC. All-in-all, this CL is more complicated than I would have liked, but it's the only idea so far that is clearly correct to me at a high level. This change adds a test which is somewhat invasive as it manipulates mark termination, but hopefully that infrastructure will be useful for debugging, fixing, and regression testing mark termination whenever we do fix it. Fixes #69803. Change-Id: Ie314e6fd357c9e2a07a9be21f217f75f7aba8c4a Reviewed-on: https://go-review.googlesource.com/c/go/+/623615 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-10-14all: wire up swisstable mapsMichael Pratt
Use the new SwissTable-based map in internal/runtime/maps as the basis for the runtime map when GOEXPERIMENT=swissmap. Integration is complete enough to pass all.bash. Notable missing features: * Race integration / concurrent write detection * Stack-allocated maps * Specialized "fast" map variants * Indirect key / elem For #54766. Cq-Include-Trybots: luci.golang.try:gotip-linux-ppc64_power10,gotip-linux-amd64-longtest-swissmap Change-Id: Ie97b656b6d8e05c0403311ae08fef9f51756a639 Reviewed-on: https://go-review.googlesource.com/c/go/+/594596 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-09-17runtime: move getcallersp to internal/runtime/sysMichael Pratt
Moving these intrinsics to a base package enables other internal/runtime packages to use them. For #54766. Change-Id: I45a530422207dd94b5ad4eee51216c9410a84040 Reviewed-on: https://go-review.googlesource.com/c/go/+/613261 Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-09-17runtime: move getcallerpc to internal/runtime/sysMichael Pratt
Moving these intrinsics to a base package enables other internal/runtime packages to use them. For #54766. Change-Id: I0b3eded3bb45af53e3eb5bab93e3792e6a8beb46 Reviewed-on: https://go-review.googlesource.com/c/go/+/613260 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-08-02all: split old and swiss map abi and compiler integrationMichael Pratt
The two map implementations are still identical, but now the compiler targets the appropriate ABI depending on GOEXPERIMENT. For #54766. Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-linux-amd64-longtest-swissmap Change-Id: I8438f64f044ba9de30ddbf2b8ceb9b4edd2d5614 Reviewed-on: https://go-review.googlesource.com/c/go/+/580779 Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Michael Pratt <mpratt@google.com>
2024-08-01runtime: measure speed of procyield and osyieldRhys Hiltner
These are delay primitives for lock2. If a mutex isn't immediately available, we can use procyield to tell the processor to wait for a moment, or osyield to allow the OS to run a different process or thread if one is waiting. We expect a processor-level yield to be faster than an os-level yield, and for both of them to be fast relative to entering a full sleep (via futexsleep or semasleep). Each architecture has its own way of hinting to the processor that it's in a spin-wait loop, so procyield presents an architecture-independent interface for use in lock_futex.go and lock_sema.go. Measure the (single-threaded) speed of these to confirm. For #68578 Change-Id: I90cd46ea553f2990395aceb048206285558c877e Reviewed-on: https://go-review.googlesource.com/c/go/+/601396 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2024-07-23runtime,internal: move runtime/internal/sys to internal/runtime/sysDavid Chase
Cleanup and friction reduction For #65355. Change-Id: Ia14c9dc584a529a35b97801dd3e95b9acc99a511 Reviewed-on: https://go-review.googlesource.com/c/go/+/600436 Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org>
2024-05-30Revert "runtime: improve runtime-internal mutex profile tests"Rhys Hiltner
This reverts commit f9ba2cff2286d378eca28c841bea8488c69fc30e (CL 586237) Reason for revert: This is part of a patch series that changed the handling of contended lock2/unlock2 calls, reducing the maximum throughput of contended runtime.mutex values, and causing a performance regression on applications where that is (or became) the bottleneck. This test verifies that the semantics of the mutex profile for runtime.mutex values matches that of sync.Mutex values. Without the rest of the patch series, this test would correctly identify that Go 1.22's semantics are incorrect (issue #66999). Updates #66999 Updates #67585 Change-Id: Id06ae01d7bc91c94054c80d273e6530cb2d59d10 Reviewed-on: https://go-review.googlesource.com/c/go/+/589096 Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Than McIntosh <thanm@google.com> Auto-Submit: Rhys Hiltner <rhys.hiltner@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-21runtime: improve runtime-internal mutex profile testsRhys Hiltner
Have the test use the same clock (cputicks) as the profiler, and use the test's own measurements as hard bounds on the magnitude to expect in the profile. Compare the depiction of two users of the same lock: one where the critical section is fast, one where it is slow. Confirm that the profile shows the slow critical section as a large source of delay (with #66999 fixed), rather than showing the fast critical section as a large recipient of delay. For #64253 For #66999 Change-Id: I784c8beedc39de564dc8cee42060a5d5ce55de39 Reviewed-on: https://go-review.googlesource.com/c/go/+/586237 Auto-Submit: Rhys Hiltner <rhys.hiltner@gmail.com> Reviewed-by: Carlos Amedee <carlos@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com>
2024-04-10runtime: rewrite traceMap to scale betterMichael Anthony Knyszek
The existing implementation of traceMap is a hash map with a fixed bucket table size which scales poorly with the number of elements added to the map. After a few thousands elements are in the map, it tends to fall over. Furthermore, cleaning up the trace map is currently non-preemptible, without very good reason. This change replaces the traceMap implementation with a simple append-only concurrent hash-trie. The data structure is incredibly simple and does not suffer at all from the same scaling issues. Because the traceMap no longer has a lock, and the traceRegionAlloc it embeds is not thread-safe, we have to push that lock down. While we're here, this change also makes the fast path for the traceRegionAlloc lock-free. This may not be inherently faster due to contention on the atomic add, but it creates an easy path to sharding the main allocation buffer to reduce contention in the future. (We might want to also consider a fully thread-local allocator that covers both string and stack tables. The only reason a thread-local allocator isn't feasible right now is because each of these has their own region, but we could certainly group all them together.) Change-Id: I8c06d42825c326061a1b8569e322afc4bc2a513a Reviewed-on: https://go-review.googlesource.com/c/go/+/570035 Reviewed-by: Carlos Amedee <carlos@golang.org> Auto-Submit: Michael Knyszek <mknyszek@google.com> TryBot-Bypass: Michael Knyszek <mknyszek@google.com> Reviewed-by: David Chase <drchase@google.com>