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: Game Of Life play example fails to compile on golang.org due to out of memory error #28283

Closed
epeay opened this issue Oct 19, 2018 · 10 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@epeay
Copy link

epeay commented Oct 19, 2018

Please answer these questions before submitting your issue. Thanks!

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

1.11.1 as reported by the server.

Does this issue reproduce with the latest release?

Not relevant. Server-side issue.

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

Not relevant. Server-side issue.

What did you do?

https://play.golang.org/p/jibIOKi7wqW

What did you expect to see?

The game of life

What did you see instead?

go tool compile: exit status 2
fatal error: runtime: out of memory

The example does run (I tested on 1.10.3 locally). It just doesn't run on the golang.org site, likely due to a restriction on the back-end environment that's doing the compilation.

If the environment is what it's supposed to be (whatever that is), and the example just needs to be tweaked to use less memory, I'd be interested in taking care of that and sending a PR.

@ALTree
Copy link
Member

ALTree commented Oct 19, 2018

and the example just needs to be tweaked to use less memory,

I very much doubt this is the case. I suspect this is related to the bad caching on nondetermistic error issue the playground had: #26926. Not sure why it's still happening, in theory it should be fixed. I don't know if the fixed playground was deployed.

@ALTree ALTree changed the title Game Of Life play example fails to compile on golang.org due to out of memory error x/playground: Game Of Life play example fails to compile on golang.org due to out of memory error Oct 19, 2018
@gopherbot gopherbot added this to the Unreleased milestone Oct 19, 2018
@ALTree ALTree added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Oct 19, 2018
@agnivade
Copy link
Contributor

/cc @broady @andybons

@ysmolski
Copy link
Member

Right now playground checks errors in the response.Events slice, that is for successfully built programs:

// Runtime error strings that will not be cached if found in an Event message.
var nonCachingRuntimeErrors = []string{"out of memory", "cannot allocate memory"}

But in our case it failed to build the program , response.Errors contains OOM message, response was cached and returned. We should do the same check for response.Errors too.

@ysmolski ysmolski added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Oct 22, 2018
@andybons
Copy link
Member

@katiehockman

@katiehockman
Copy link
Contributor

Thanks for the extra context @ysmolsky. Looks like the original change fixed some issues, but not all.

@ALTree to answer your question, yes it was deployed shortly after the change was merged.

I'll assign this to myself and hopefully send out the fix very soon.

@katiehockman katiehockman self-assigned this Oct 22, 2018
@gopherbot
Copy link

Change https://golang.org/cl/144297 mentions this issue: playground: prevent caching memory-related compile time errors

@dmitshur
Copy link
Contributor

dmitshur commented Oct 26, 2018

Commit golang/playground@d134d7d has been deployed now. Please let us know if the issue occurs again.

@epeay
Copy link
Author

epeay commented Oct 26, 2018

@dmitshur The issue is still happening live now...
https://play.golang.org/p/jibIOKi7wqW

Now that we know what the issue is, I can see that changing a single character in the code sample results in successful code execution. Clearing that cached execution result (the error) should get this working on the site again.

@katiehockman
Copy link
Contributor

katiehockman commented Oct 26, 2018 via email

@andybons
Copy link
Member

The cache has been cleared. I don't see an error in the playground response any more.

@golang golang locked and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

8 participants