On Tue, Apr 5, 2022 at 6:18 PM ben...@gmail.com <benh...@gmail.com> wrote:
>
> Normally the Go Playground gives errors when a runtime panic or other error 
> occurs, including "timeout running program" for programs that run too long. 
> I'm wondering why the Playground doesn't show a stack overflow error (or any 
> error) for this infinitely-recursing program?
>
> https://go.dev/play/p/ILbGVj0dfWg
>
> It seems like a quirk (bug?) in the way this particular error is handled. 
> This confused my colleague (who's new to Go) because he (correctly) expected 
> it to show some kind of overflow/recursion error.
>
> For comparison, here's what the Go runtime says locally for this code:
>
> $ go run t.go
> runtime: goroutine stack exceeds 1000000000-byte limit
> runtime: sp=0xc020160398 stack=[0xc020160000, 0xc040160000]
> fatal error: stack overflow
> ... full stack trace elided ...
>
> Should I report a golang/go issue?

The playground isn't intended to be an exact replica of running a
program on a real machine.  If the program uses too many resources it
will simply be stopped.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcW80mviOFUkcCLo1aNeyJaag_iJesau5ruJyNSFbkA7Pw%40mail.gmail.com.

Reply via email to