aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/debug
AgeCommit message (Collapse)Author
2020-09-18runtime/debug: provide Addr method for errors from SetPanicOnFaultKeith Randall
When we're building a panic that's triggered by a memory fault when SetPanicOnFault has been called, include an Addr method. This method reports the address at which the fault occurred. Fixes #37023 RELNOTE=yes Change-Id: Idff144587d6b75070fdc861a36efec76f4ec7384 Reviewed-on: https://go-review.googlesource.com/c/go/+/249677 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Trust: Keith Randall <khr@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
2020-02-25Revert "Revert "cmd/go/internal/modload: record the replacement for the ↵Bryan C. Mills
module containing package main in BuildInfo"" This reverts CL 220722. Reason for revert: rolling forward with fix. Fixes #37392 Change-Id: Iba8b0c645267777fbb7019976292d691a10b906a Reviewed-on: https://go-review.googlesource.com/c/go/+/220898 Run-TryBot: Bryan C. Mills <bcmills@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-02-24Revert "cmd/go/internal/modload: record the replacement for the module ↵Andrew Bonventre
containing package main in BuildInfo" This reverts CL 220645 (commit e092fc352ad393a4d2f1f7fa641df2d23572ccff). Reason for revert: Seems to have broken windows/amd64 longtest Change-Id: Iffa8c882524250e5845514bc827fcd8927645a44 Reviewed-on: https://go-review.googlesource.com/c/go/+/220722 Run-TryBot: Andrew Bonventre <andybons@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-02-24cmd/go/internal/modload: record the replacement for the module containing ↵Bryan C. Mills
package main in BuildInfo Fixes #37392 Change-Id: I2cb051e6f556b0af95e059611dda3f62e7c1f21a Reviewed-on: https://go-review.googlesource.com/c/go/+/220645 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
2019-10-09all: remove the nacl port (part 1)Brad Fitzpatrick
You were a useful port and you've served your purpose. Thanks for all the play. A subsequent CL will remove amd64p32 (including assembly files and toolchain bits) and remaining bits. The amd64p32 removal will be separated into its own CL in case we want to support the Linux x32 ABI in the future and want our old amd64p32 support as a starting point. Updates #30439 Change-Id: Ia3a0c7d49804adc87bf52a4dea7e3d3007f2b1cd Reviewed-on: https://go-review.googlesource.com/c/go/+/199499 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-09-20runtime/debug: correct BuildInfo.Main documentationHana Kim
The term "main module" has a special meaning [1] and is not what we intended to refer to with BuildInfo.Main. [1] https://golang.org/cmd/go/#hdr-The_main_module_and_the_build_list Updates #33975 Change-Id: Ieaba5fcacee2e87c5c15fa7425527bbd64ada5d5 Reviewed-on: https://go-review.googlesource.com/c/go/+/196522 Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-04-23cmd/go: move runtime/debug.modinfo to runtime.modinfoRuss Cox
It is easier to ensure that the symbol is always present if we move it to package runtime. Avoids init-time work. Also moves it next to buildVersion, the other similar symbol. Setting up for "go version <binary>". For #31624. Change-Id: I943724469ce6992153e701257eb6f12da88c8e4e Reviewed-on: https://go-review.googlesource.com/c/go/+/173341 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-11-13runtime/debug: add API to read module info in binaryHana Kim
When module is enabled, the go tool embeds build information related to the module in the binary including the dependencies and the replace information (See src/cmd/go/internal/modload.PackageBuildInfo). The newly introduced ReadBuildInfo reads the information and makes it accessible programmatically. Update #26404 Change-Id: Ide37022d609b4a8fb6b5ce02afabb73f04fbb532 Reviewed-on: https://go-review.googlesource.com/c/144220 Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
2018-06-01os: add js/wasm architectureRichard Musiol
This commit adds the js/wasm architecture to the os package. Access to the actual file system is supported through Node.js. Updates #18892 Change-Id: I6fa642fb294ca020b2c545649d4324d981aa0408 Reviewed-on: https://go-review.googlesource.com/109977 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-24runtime/debug: mark TestSetGCPercent as flakyBrad Fitzpatrick
Updates #20076 Change-Id: I4eb98abbb49174cc6433e5da2c3660893ef88fd1 Reviewed-on: https://go-review.googlesource.com/41615 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-04-21runtime/debug: increase threshold on TestSetGCPercentAustin Clements
Currently TestSetGCPercent checks that NextGC is within 10 MB of the expected value. For some reason it's much noisier on some of the builders. To get these passing again, raise the threshold to 20 MB. Change-Id: I14e64025660d782d81ff0421c1eb898f416e11fe Reviewed-on: https://go-review.googlesource.com/41374 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Russ Cox <rsc@golang.org>
2017-04-21runtime/debug: don't trigger a GC on SetGCPercentAustin Clements
Currently SetGCPercent forces a GC in order to recompute GC pacing. Since we can now recompute pacing on the fly using gcSetTriggerRatio, change SetGCPercent (really runtime.setGCPercent) to go through gcSetTriggerRatio and not trigger a GC. Fixes #19076. Change-Id: Ib30d7ab1bb3b55219535b9f238108f3d45a1b522 Reviewed-on: https://go-review.googlesource.com/39835 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Rick Hudson <rlh@golang.org>
2017-04-21runtime/debug: expand SetGCPercent testAustin Clements
The current SetGCPercent test is, shall we say, minimal. Expand it to check that the GC target is actually computed and updated correctly. For #19076. Change-Id: I6e9b2ee0ef369f22f72e43b58d89e9f1e1b73b1b Reviewed-on: https://go-review.googlesource.com/39834 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org>
2017-02-10runtime/debug: don't run a GC when setting SetGCPercent negativeBrad Fitzpatrick
If the user is calling SetGCPercent(-1), they intend to disable GC. They probably don't intend to run one. If they do, they can call runtime.GC themselves. Change-Id: I40ef40dfc7e15193df9ff26159cd30e56b666f73 Reviewed-on: https://go-review.googlesource.com/34013 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
2016-11-13all: fix vet nitsJosh Bleecher Snyder
Fixes these vet complaints: net/error_test.go:254: unrecognized printf flag for verb 'T': '#' os/os_test.go:1067: arg mt for printf verb %d of wrong type: time.Time runtime/debug/garbage_test.go:83: arg dt for printf verb %d of wrong type: time.Time Change-Id: I0e986712a4b083b75fb111e687e424d06a85a47b Reviewed-on: https://go-review.googlesource.com/33167 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-10-20runtime/debug: avoid overflow in SetMaxThreadsAlberto Donizetti
Fixes #16076 Change-Id: I91fa87b642592ee4604537dd8c3197cd61ec8b31 Reviewed-on: https://go-review.googlesource.com/31516 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-10-04all: use sort.Slice where applicableBrad Fitzpatrick
I avoided anywhere in the compiler or things which might be used by the compiler in the future, since they need to build with Go 1.4. I also avoided anywhere where there was no benefit to changing it. I probably missed some. Updates #16721 Change-Id: Ib3c895ff475c6dec2d4322393faaf8cb6a6d4956 Reviewed-on: https://go-review.googlesource.com/30250 TryBot-Result: Gobot Gobot <gobot@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-09-06runtime/debug: enable TestFreeOSMemory on all archesAustin Clements
TestFreeOSMemory was disabled on many arches because of issue #9993. Since that's been fixed, enable the test everywhere. Change-Id: I298c38c3e04128d9c8a1f558980939d5699bea03 Reviewed-on: https://go-review.googlesource.com/27403 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Minux Ma <minux@golang.org>
2016-06-07cmd/compile: fix heap dump test on androidKeith Randall
go_android_exec is looking for "exitcode=" to decide the result of running a test. The heap dump test nondeterministically prints "finalized" right at the end of the test. When the timing is just right, we print "finalizedexitcode=0" and confuse go_android_exec. This failure happens occasionally on the android builders. Change-Id: I4f73a4db05d8f40047ecd3ef3a881a4ae3741e26 Reviewed-on: https://go-review.googlesource.com/23861 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
2016-03-16runtime/debug: clarify WriteHeapDump STW behaviorAlan Donovan
Change-Id: I049d2596fe8ce0e93391599f5c224779fd8e316f Reviewed-on: https://go-review.googlesource.com/20761 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-03-15runtime: update link to WriteHeapDump formatMichael Matloob
The new link is https://golang.org/s/go15heapdump. Change-Id: Ifcaf8572bfe815ffaa78442a1991f6e20e990a50 Reviewed-on: https://go-review.googlesource.com/20740 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-03-01all: make copyright headers consistent with one space after periodBrad Fitzpatrick
This is a subset of https://golang.org/cl/20022 with only the copyright header lines, so the next CL will be smaller and more reviewable. Go policy has been single space after periods in comments for some time. The copyright header template at: https://golang.org/doc/contribute.html#copyright also uses a single space. Make them all consistent. Change-Id: Icc26c6b8495c3820da6b171ca96a74701b4a01b0 Reviewed-on: https://go-review.googlesource.com/20111 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-02-19all: replace strings.Index with strings.Contains where possibleNathan VanBenschoten
Change-Id: Ia613f1c37bfce800ece0533a5326fca91d99a66a Reviewed-on: https://go-review.googlesource.com/18120 Reviewed-by: Robert Griesemer <gri@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org>
2015-12-18testing: use debug.SetTraceback("all") to show all goroutines at test timeoutRuss Cox
Fixes #13681. Change-Id: I308930f4d9200fbe0f09cd08c38392ca1bb0db67 Reviewed-on: https://go-review.googlesource.com/18044 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Austin Clements <austin@google.com>
2015-12-18runtime/debug: add SetTracebackRuss Cox
Programs that call panic to crash after detecting a serious problem may wish to use SetTraceback to force printing of all goroutines first. Change-Id: Ib23ad9336f405485aabb642ca73f454a14c8baf3 Reviewed-on: https://go-review.googlesource.com/18043 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-11-12runtime/debug: skip TestFreeOSMemory for mips64{,le}Yao Zhang
Change-Id: I419f3b8bf1bddffd4a775b0cd7b98f0239fe19cb Reviewed-on: https://go-review.googlesource.com/14458 Reviewed-by: Minux Ma <minux@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-10-16runtime, runtime/debug: access unexported runtime functions with ↵Michael Hudson-Doyle
//go:linkname, not assembly stubs Change-Id: I88f80f5914d6e4c179f3d28aa59fc29b7ef0cc66 Reviewed-on: https://go-review.googlesource.com/15960 Reviewed-by: Minux Ma <minux@golang.org> Run-TryBot: Minux Ma <minux@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-09-16runtime/debug: more explicit Stack docsDavid Crawshaw
Change-Id: I81a7f22be827519b5290b4acbcba357680cad3c4 Reviewed-on: https://go-review.googlesource.com/14605 Reviewed-by: Rob Pike <r@golang.org>
2015-09-16runtime/debug: implement Stack using runtime.StackDavid Crawshaw
Fixes #12363 Change-Id: I1a025ab6a1cbd5a58f5c2bce5416788387495428 Reviewed-on: https://go-review.googlesource.com/14604 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-07-28runtime: use 64k page rounding on arm64Russ Cox
Fixes #11886. Change-Id: I9392fd2ef5951173ae275b3ab42db4f8bd2e1d7a Reviewed-on: https://go-review.googlesource.com/12747 Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-07-20cmd/compile: define func value symbols at declarationMichael Hudson-Doyle
This is mostly Russ's https://golang.org/cl/12145 but with some extra fixes to account for the fact that function declarations without implementations now break shared libraries, and including my test case. Fixes #11480. Change-Id: Iabdc2934a0378e5025e4e7affadb535eaef2c8f1 Reviewed-on: https://go-review.googlesource.com/12340 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-07-11all: link to https instead of httpBrad Fitzpatrick
The one in misc/makerelease/makerelease.go is particularly bad and probably warrants rotating our keys. I didn't update old weekly notes, and reverted some changes involving test code for now, since we're late in the Go 1.5 freeze. Otherwise, the rest are all auto-generated changes, and all manually reviewed. Change-Id: Ia2753576ab5d64826a167d259f48a2f50508792d Reviewed-on: https://go-review.googlesource.com/12048 Reviewed-by: Rob Pike <r@golang.org>
2015-06-18all: switch to the new deprecation conventionShenghou Ma
While we're at it, move some misplaced comment blocks around. Change-Id: I1847d7f1ca1dbb8e5de737203c4ed6c66e112508 Reviewed-on: https://go-review.googlesource.com/10188 Reviewed-by: Rob Pike <r@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
2015-04-13runtime/debug: disable arm64 test for issue 9993David Crawshaw
Like other arm64 platforms, darwin/arm64 has a different physical page size to logical page size so it is running into issue 9993. I hope it can be fixed for Go 1.5, but for now it is demonstrating the same bug as the other skipped os+arch combinations. Change-Id: Iedaf9afe56d6954bb4391b6e843d81742a75a00c Reviewed-on: https://go-review.googlesource.com/8814 Reviewed-by: Minux Ma <minux@golang.org>
2015-03-16runtime: add support for linux/arm64Aram Hăvărneanu
Change-Id: Ibda6a5bedaff57fd161d63fc04ad260931d34413 Reviewed-on: https://go-review.googlesource.com/7142 Reviewed-by: Russ Cox <rsc@golang.org>
2015-02-26runtime/debug: fix nacl buildDave Cheney
Disable the test properly on nacl systems, tested on nacl/amd64p32. Change-Id: Iffe210be4f9c426bfc47f2dd3a8f0c6b5a398cc3 Reviewed-on: https://go-review.googlesource.com/6093 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-02-26runtime: disable scavenger on 64k page size kernelsDave Cheney
Update #9993 If the physical page size of the machine is larger than the logical heap size, for example 8k logical, 64k physical, then madvise(2) will round up the requested amount to a 64k boundary and may discard pages close to the page being madvised. This patch disables the scavenger in these situations, which at the moment is only ppc64 and ppc64le systems. NaCl also uses a 64k page size, but it's not clear if it is affected by this problem. Change-Id: Ib897f8d3df5bd915ddc0b510f2fd90a30ef329ca Reviewed-on: https://go-review.googlesource.com/6091 Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
2014-12-16runtime: gofmtBrad Fitzpatrick
Fixes #9339 Change-Id: I22faf2593cb73f42612c2c2bfe38de001fb2746b Reviewed-on: https://go-review.googlesource.com/1630 Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-10runtime: fix finalizer iteratorKeith Randall
It could only handle one finalizer before it raised an out-of-bounds error. Fixes issue #9172 Change-Id: Ibb4d0c8aff2d78a1396e248c7129a631176ab427 Reviewed-on: https://go-review.googlesource.com/1201 Reviewed-by: Russ Cox <rsc@golang.org>
2014-12-05all: power64 is now ppc64Russ Cox
Fixes #8654. LGTM=austin R=austin CC=golang-codereviews https://golang.org/cl/180600043
2014-10-29[dev.power64] all: merge default (dd5014ed9b01) into dev.power64Russ Cox
Still passes on amd64. LGTM=austin R=austin CC=golang-codereviews https://golang.org/cl/165110043
2014-10-28runtime: add PauseEnd array to MemStats and GCStatsJens Frederich
Fixes #8787. LGTM=rsc R=rsc, dvyukov CC=golang-codereviews https://golang.org/cl/153670043
2014-10-27[dev.power64] runtime: power64 fixes and ports of changesAustin Clements
Fix include paths that got moved in the great pkg/ rename. Add missing runtime/arch_* files for power64. Port changes that happened on default since branching to runtime/{asm,atomic,sys_linux}_power64x.s (precise stacks, calling convention change, various new and deleted functions. Port struct renaming and fix some bugs in runtime/defs_linux_power64.h. LGTM=rsc R=rsc, dave CC=golang-codereviews https://golang.org/cl/161450043
2014-09-24cmd/go: prohibit C sources files unless using cgoRuss Cox
Those C files would have been compiled with 6c. It's close to impossible to use C correctly anymore, and the C compilers are going away eventually. Make them unavailable now. go1.4.txt change in CL 145890046 LGTM=iant R=iant CC=golang-codereviews, r https://golang.org/cl/149720043
2014-09-08build: move package sources from src/pkg to srcRuss Cox
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.