-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
cmd/link: stack check too deep when compiling deep call graph with -gcflags=-l #51814
Comments
CC @randall77 |
The failure here is "nosplit stack check too deep" reported by the linker (https://go.googlesource.com/go/+/refs/heads/master/src/cmd/link/internal/ld/lib.go#2295). When not using We can increase the stack limit if there are real programs with a stack check that deep. But I'm not sure we should increase it for a test program. Any limit we set can be easily exceeded by any test program. Is it important for the test to have such a deep call graph? Does that correspond to real programs? |
It is a case of "It used to work it doesn't anymore"; that's was caught by a real project that is currently used, the real world value of this specific case is discutable. I wrote panic in panicparse to test edge cases. The test case My primary concern is that it only fails when running with coverage or when disabling the inliner to debug something. Otherwise it works just fine. This can be surprising to developers when they disable optimizations to debug something more easily and the program stops compiling. I'd prefer if the behavior was consistent. I would suspect this would risk happening mostly in generated code as I wouldn't expect humans to naturally such deep recursive code. As I noted in my report, it does fail when using coverage but I failed to extract a simplified repro case, you can reproduce locally with:
The fact that this occurs with go test -covermode=(atomic|count|set) is much more material to me than with -gcflags -l. |
I figured out a reduced repro case for Observations:
|
What version of Go are you using (
go version
)?New regression in go1.18, works on go1.7.
Culprit commit is c991278.
cc @mdempsky
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Run go test on github.com/maruel/panicparse/v2/...
Here's a smaller repro case with main.go.txt attached file:
What did you expect to see?
Works as before.
What did you see instead?
Workaround
Using -G=0 works most of the time but not always (?) -covermode=count is broken in panicparse/cmd/panic but I haven't successfully extracted a repro yet.
The text was updated successfully, but these errors were encountered: