Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: runtime.racefuncenter: nosplit stack overflow -race, Goland debug 1.18rc1 #51247

Closed
jhawk28 opened this issue Feb 17, 2022 · 11 comments
Closed
Labels
NeedsFix
Milestone

Comments

@jhawk28
Copy link

@jhawk28 jhawk28 commented Feb 17, 2022

What version of Go are you using (go version)?

$ go version
go version go1.18rc1 darwin/arm64

Does this issue reproduce with the latest release?

No, works fine on 1.17.6

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

What did you do?

Running debug on Goland with -race flag. It starts up fine without the -race flag or if I use "run".

What did you expect to see?

My program start up.

What did you see instead?

runtime.racefuncenter: nosplit stack overflow
	792	assumed on entry to reflect.methodValueCall<0> (nosplit)
	344	after reflect.methodValueCall<0> (nosplit) uses 448
	280	after reflect.moveMakeFuncArgPtrs<0> (nosplit) uses 64
	8	after reflect.moveMakeFuncArgPtrs<1> (nosplit) uses 272
	-24	after runtime.racefuncenter<1> (nosplit) uses 32
@cherrymui
Copy link
Member

@cherrymui cherrymui commented Feb 17, 2022

Running debug on Goland with -race flag.

Does it set -gcflags=all="-N -l" along with -race? I can reproduce the failure with that. Arguably that is a weird setting.

@jhawk28
Copy link
Author

@jhawk28 jhawk28 commented Feb 17, 2022

yes, I see this: -gcflags all=-N -l

@cherrymui
Copy link
Member

@cherrymui cherrymui commented Feb 17, 2022

I'll look into if we can fix that. But in the meantime, you can use either -race (for race detection) or -gcflags=all="-N -l" (for debugging) separately. I don't think you need to use them at same time.

@dmitshur dmitshur added the NeedsInvestigation label Feb 18, 2022
@dmitshur dmitshur added this to the Go1.18 milestone Feb 18, 2022
@robpike
Copy link
Contributor

@robpike robpike commented Feb 18, 2022

Wow, where is this race fun center? I want to play!

@mengzhuo
Copy link
Contributor

@mengzhuo mengzhuo commented Feb 18, 2022

Is it darwin only? runtime test on linux/arm64(raspi 4) with '-race' and '-N -l' all passed.

@gopherbot
Copy link

@gopherbot gopherbot commented Feb 18, 2022

Change https://go.dev/cl/386715 mentions this issue: runtime: define racefuncenter and racefuncexit as ABIInternal

@gopherbot
Copy link

@gopherbot gopherbot commented Feb 18, 2022

Change https://go.dev/cl/386716 mentions this issue: runtime: save some stack space for racecall on ARM64

@gopherbot
Copy link

@gopherbot gopherbot commented Feb 18, 2022

Change https://go.dev/cl/386714 mentions this issue: reflect: call ABIInternal moveMakeFuncArgPtrs on ARM64

@gopherbot
Copy link

@gopherbot gopherbot commented Feb 18, 2022

Change https://go.dev/cl/386719 mentions this issue: runtime: avoid cgo_unsafe_args for syscall.syscall functions on darwin/arm64

gopherbot pushed a commit that referenced this issue Feb 18, 2022
Save some stack space, to avoid nosplit overflow in
-race -N -l build.

For #51247.

Change-Id: I7357d6227f816a612a64f55f7ca1b1384e9268e1
Reviewed-on: https://go-review.googlesource.com/c/go/+/386714
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
gopherbot pushed a commit that referenced this issue Feb 18, 2022
They are called from compiler instrumented code as ABIInternal.
Define them as ABIInternal to avoid the wrappers and save some
stack space, to avoid nosplit overflow in -race -N -l build.

For #51247.

Change-Id: Iadad7d6da8ac03780a7b02b03b004c52d34e020a
Reviewed-on: https://go-review.googlesource.com/c/go/+/386715
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
gopherbot pushed a commit that referenced this issue Feb 18, 2022
To avoid nosplit overflow in -race -N -l build.

For #51247.

Change-Id: I48426bbd4adefd18eaf26ed51b4113c6a28305b8
Reviewed-on: https://go-review.googlesource.com/c/go/+/386716
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
@prattmic prattmic changed the title runtime.racefuncenter: nosplit stack overflow -race, Goland debug 1.18rc1 runtime: runtime.racefuncenter: nosplit stack overflow -race, Goland debug 1.18rc1 Feb 18, 2022
@prattmic prattmic added NeedsFix and removed NeedsInvestigation labels Feb 18, 2022
@cherrymui
Copy link
Member

@cherrymui cherrymui commented Feb 28, 2022

With the CLs above there should be no more nosplit overflow from the standard library on ARM64 with -race and -gcflags=all="-N -l".

However, I still suggest not to use -race and -gcflags=all="-N -l" separately, not at same time (it is possible using them at same time will not be supported).

@jhawk28
Copy link
Author

@jhawk28 jhawk28 commented Feb 28, 2022

why would we want to remove the ability to do race detection and debugging at the same time? From a dev perspective, I am more likely to run the -race with debugging than I am to swap back and forth. I am also unlikely to compile my production binaries with -race because I won't want the panic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix
Projects
Status: Done
Development

No branches or pull requests

7 participants