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

x/playground: no error reported for stack overflow (due to infinite recursion) #52176

Open
benhoyt opened this issue Apr 6, 2022 · 1 comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@benhoyt
Copy link
Contributor

benhoyt commented Apr 6, 2022

When running the following infinitely-recursive code on the Go Playground (with Go 1.18, but 1.17 and dev do the same):

func f() string {
	return f()
}

func main() {
	fmt.Printf("%q", f())
}

Instead of printing a "stack overflow" or any other kind of error, it prints nothing except the usual "Program exited" message. This is confusing because it appears the program ran successfully. Presumably the Playground runtime can tell whether a program exited successfully or with some kind of error (stack overflow / out of memory in this case) and print "fatal error: stack overflow" or similar.

See related golang-nuts thread.

@gopherbot gopherbot added this to the Unreleased milestone Apr 6, 2022
@cherrymui cherrymui added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 6, 2022
@cherrymui
Copy link
Member

cc @toothrot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants