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

Infinite loop / stack overflow if you accidentally have a loop in types #264

Open
rcoreilly opened this issue Jul 27, 2020 · 1 comment
Open

Comments

@rcoreilly
Copy link
Member

This is a GoPi issue but filing it here, as it comes up in gide..

github.com/goki/pi/langs/golang.(*GoLang).StructInheritEls(0x63a8e30, 0xc05222e000, 0xc0128a3200, 0xc01dcbf2c0, 0xc058775180, 0xd)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/types.go:463 +0x929 fp=0xc09f402450 sp=0xc09f402448 pc=0x46d1669
github.com/goki/pi/langs/golang.(*GoLang).TypeFromAstComp(0x63a8e30, 0xc05222e000, 0xc0128a3200, 0xc01dcbf2c0, 0xc0524a8240, 0x4613b01, 0xc0524a8000)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/types.go:355 +0x269 fp=0xc09f402608 sp=0xc09f402450 pc=0x46cee19
github.com/goki/pi/langs/golang.(*GoLang).TypeFromAst(0x63a8e30, 0xc05222e000, 0xc0128a3200, 0xc01dcbf2c0, 0xc0524a8240, 0x0, 0x0)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/types.go:217 +0x169 fp=0xc09f402668 sp=0xc09f402608 pc=0x46cdd49
github.com/goki/pi/langs/golang.(*GoLang).InitTypeFromAst(0x63a8e30, 0xc05222e000, 0xc0128a3200, 0xc01dcbf2c0)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/types.go:149 +0x277 fp=0xc09f402708 sp=0xc09f402668 pc=0x46cd957
github.com/goki/pi/langs/golang.(*GoLang).StructInheritEls(0x63a8e30, 0xc05222e000, 0xc0128a3200, 0xc0128a38c0, 0xc0611c3d88, 0x5)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/types.go:475 +0x7fc fp=0xc09f4028a8 sp=0xc09f402708 pc=0x46d153c
github.com/goki/pi/langs/golang.(*GoLang).TypeFromAstComp(0x63a8e30, 0xc05222e000, 0xc0128a3200, 0xc0128a38c0, 0xc0527a97a0, 0x4613b01, 0xc0527a9560)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/types.go:355 +0x269 fp=0xc09f402a60 sp=0xc09f4028a8 pc=0x46cee19
github.com/goki/pi/langs/golang.(*GoLang).TypeFromAst(0x63a8e30, 0xc05222e000, 0xc0128a3200, 0xc0128a38c0, 0xc0527a97a0, 0x0, 0x0)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/types.go:217 +0x169 fp=0xc09f402ac0 sp=0xc09f402a60 pc=0x46cdd49
github.com/goki/pi/langs/golang.(*GoLang).InitTypeFromAst(0x63a8e30, 0xc05222e000, 0xc0128a3200, 0xc0128a38c0)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/types.go:149 +0x277 fp=0xc09f402b60 sp=0xc09f402ac0 pc=0x46cd957
github.com/goki/pi/langs/golang.(*GoLang).StructInheritEls(0x63a8e30, 0xc05222e000, 0xc0128a3200, 0xc01dcbf2c0, 0xc058775180, 0xd)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/types.go:475 +0x7fc fp=0xc09f402d00 sp=0xc09f402b60 pc=0x46d153c

just need to intercept the loop somehow -- we are marking some types as being processed so theoretically something like that should work here..

@rcoreilly
Copy link
Member Author

also infinite loop when importing "golang.org/x/text/message"

runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0xc0b87a8360 stack=[0xc0b87a8000, 0xc0d87a8000]
fatal error: stack overflow

runtime stack:
runtime.throw(0x4fd805e, 0xe)
        /usr/local/Cellar/go/1.14.3/libexec/src/runtime/panic.go:1116 +0x72
runtime.newstack()
        /usr/local/Cellar/go/1.14.3/libexec/src/runtime/stack.go:1034 +0x6ce
runtime.morestack()
        /usr/local/Cellar/go/1.14.3/libexec/src/runtime/asm_amd64.s:449 +0x8f

goroutine 23130 [running]:
runtime.makeslice(0x4d5c2e0, 0x1, 0x1, 0x0)
        /usr/local/Cellar/go/1.14.3/libexec/src/runtime/slice.go:34 +0xf6 fp=0xc0b87a8370 sp=0xc0b87a8368 pc=0x404d706
strings.Fields(0xc02ab2a261, 0xc, 0xc02ab2a261, 0x9, 0xc02ab2a26a)
        /usr/local/Cellar/go/1.14.3/libexec/src/strings/strings.go:349 +0x8f fp=0xc0b87a83b8 sp=0xc0b87a8370 pc=0x40f063f
github.com/goki/pi/langs/golang.(*ParseDirLocks).ParseDir(0x63abf40, 0x63a8ff0, 0xc02ab2a261, 0xc, 0x0, 0xc02ab2a261)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/parsedir.go:49 +0x39 fp=0xc0b87a8418 sp=0xc0b87a83b8 pc=0x46c6f99
github.com/goki/pi/langs/golang.(*GoLang).ParseDir(0x63a8ff0, 0xc02ab2a261, 0xc, 0xc02a000000, 0xc)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/parsedir.go:88 +0x92 fp=0xc0b87a8458 sp=0xc0b87a8418 pc=0x46c72d2
github.com/goki/pi/langs/golang.(*GoLang).AddImportToExts(0x63a8ff0, 0xc07c30ec00, 0xc02ab2a260, 0xe, 0x0)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/parsedir.go:355 +0x8b fp=0xc0b87a84c8 sp=0xc0b87a8458 pc=0x46c8efb
github.com/goki/pi/langs/golang.(*GoLang).PkgSyms(0x63a8ff0, 0xc07c30ec00, 0xc079384c30, 0xc061ec3280, 0x3, 0x4, 0x0)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/parsedir.go:320 +0xfd fp=0xc0b87a8518 sp=0xc0b87a84c8 pc=0x46c8afd
github.com/goki/pi/langs/golang.(*GoLang).FindTypeName(0x63a8ff0, 0xc061ec3280, 0x8, 0xc07c30ec00, 0xc061ea8000, 0x0, 0x0)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/types.go:82 +0x1ec fp=0xc0b87a85f8 sp=0xc0b87a8518 pc=0x46cc5dc
github.com/goki/pi/langs/golang.(*GoLang).TypeFromAstPrim(0x63a8ff0, 0xc07c30ec00, 0xc061ea8000, 0x0, 0xc061ec4000, 0x4612f01, 0xc061eafd40)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/types.go:228 +0xd1 fp=0xc0b87a8730 sp=0xc0b87a85f8 pc=0x46cd351
github.com/goki/pi/langs/golang.(*GoLang).TypeFromAst(0x63a8ff0, 0xc07c30ec00, 0xc061ea8000, 0x0, 0xc061ec4000, 0x400f538, 0x10)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/types.go:215 +0x1c5 fp=0xc0b87a8790 sp=0xc0b87a8730 pc=0x46cd1a5
github.com/goki/pi/langs/golang.(*GoLang).SubTypeFromAst(0x63a8ff0, 0xc07c30ec00, 0xc061ea8000, 0xc061eafd40, 0x1, 0x0, 0x0)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/types.go:163 +0xff fp=0xc0b87a87f0 sp=0xc0b87a8790 pc=0x46cceef
github.com/goki/pi/langs/golang.(*GoLang).TypeFromAstComp(0x63a8ff0, 0xc07c30ec00, 0xc061ea8000, 0xc061ea9680, 0xc061eafc20, 0x4612f01, 0xc061eaf9e0)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/types.go:358 +0x38d fp=0xc0b87a89a8 sp=0xc0b87a87f0 pc=0x46ce33d
github.com/goki/pi/langs/golang.(*GoLang).TypeFromAst(0x63a8ff0, 0xc07c30ec00, 0xc061ea8000, 0xc061ea9680, 0xc061eafc20, 0x6f00000000, 0x0)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/types.go:217 +0x169 fp=0xc0b87a8a08 sp=0xc0b87a89a8 pc=0x46cd149
github.com/goki/pi/langs/golang.(*GoLang).InitTypeFromAst(0x63a8ff0, 0xc07c30ec00, 0xc061ea8000, 0xc061ea9680)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/types.go:149 +0x277 fp=0xc0b87a8aa8 sp=0xc0b87a8a08 pc=0x46ccd57
github.com/goki/pi/langs/golang.(*GoLang).StructInheritEls(0x63a8ff0, 0xc07c30ec00, 0xc061ea8000, 0xc022fb8b40, 0xc061ea1c20, 0x6)
        /Users/oreilly/go/src/github.com/goki/pi/langs/golang/types.go:475 +0x7fc fp=0xc0b87a8c48 sp=0xc0b87a8aa8 pc=0x46d093c

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

1 participant