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

spew fails to detect cyclic data #66

Open
cpcallen opened this issue May 25, 2017 · 2 comments
Open

spew fails to detect cyclic data #66

cpcallen opened this issue May 25, 2017 · 2 comments

Comments

@cpcallen
Copy link

cpcallen commented May 25, 2017

The following runs forever(*) without producing any output:

package main

import "github.com/davecgh/go-spew/spew"

func main() {
	type loop *loop
	var loop1, loop2 loop
	loop1 = &loop2
	loop2 = &loop1
	spew.Dump(&loop1)
}

(*) It does not hit the stack size limit; its memory usage does keep growing so obviously it will eventually run out of swap or virtual address space...

@dmitshur
Copy link

#53 is possibly related.

@cpcallen
Copy link
Author

I was going to say there was no interface values involved here, but of course the param to Dump is itself of interface type. So yes: entirely possible that this is related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants