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

Circular call results in fatal error: stack overflow #1745

Closed
jiyoonie9 opened this issue Jun 12, 2024 · 0 comments · Fixed by #1764
Closed

Circular call results in fatal error: stack overflow #1745

jiyoonie9 opened this issue Jun 12, 2024 · 0 comments · Fixed by #1764
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@jiyoonie9
Copy link

jiyoonie9 commented Jun 12, 2024

if i import "ftl/B" inside a go file in A module
and B already depends on A
then this creates a circular dependency.

pulling in this import while just dev is running results in just dev failing with stack overflow error. see error below (the full error is very long)

runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0x140458d4350 stack=[0x140458d4000, 0x140658d4000]
fatal error: stack overflow

runtime stack:
runtime.throw({0x10144c530?, 0x100751d64?})
	runtime/panic.go:1023 +0x40 fp=0x16ff9ad20 sp=0x16ff9acf0 pc=0x10075a2d0
runtime.newstack()
	runtime/stack.go:1103 +0x460 fp=0x16ff9aed0 sp=0x16ff9ad20 pc=0x100776d60
runtime.morestack()
	runtime/asm_arm64.s:341 +0x70 fp=0x16ff9aed0 sp=0x16ff9aed0 pc=0x10078f6e0

goroutine 34438 gp=0x140065a0fc0 m=16 mp=0x14001a0a008 [running]:
runtime.deductAssistCredit(0x10?)
	runtime/malloc.go:1337 +0x7c fp=0x140458d4350 sp=0x140458d4350 pc=0x10072ff5c
runtime.mallocgc(0x10, 0x1021924a0, 0x1)
	runtime/malloc.go:1025 +0xe8 fp=0x140458d43e0 sp=0x140458d4350 pc=0x10072f6c8
runtime.growslice(0x103015d40, 0x1400cc45380?, 0x0?, 0x1400cc3d380?, 0x1021924a0)
	runtime/slice.go:250 +0x4c0 fp=0x140458d4440 sp=0x140458d43e0 pc=0x100774f00
github.com/TBD54566975/ftl/backend/schema.(*Field).schemaChildren(0x1400066dd80)
	github.com/TBD54566975/ftl/backend/schema/field.go:27 +0x70 fp=0x140458d44e0 sp=0x140458d4440 pc=0x100b74d40
github.com/TBD54566975/ftl/backend/schema.Visit.func1()
	github.com/TBD54566975/ftl/backend/schema/visit.go:8 +0x30 fp=0x140458d4520 sp=0x140458d44e0 pc=0x100b923e0
github.com/TBD54566975/ftl/backend/schema.(*Module).Imports.func1({0x1023a2448?, 0x1400066dd80?}, 0x140003db340?)
	github.com/TBD54566975/ftl/backend/schema/module.go:168 +0xd0 fp=0x140458d4560 sp=0x140458d4520 pc=0x100b7cf10
github.com/TBD54566975/ftl/backend/schema.Visit({0x1023a2448, 0x1400066dd80}, 0x1400cc12918)
	github.com/TBD54566975/ftl/backend/schema/visit.go:7 +0x8c fp=0x140458d4590 sp=0x140458d4560 pc=0x100b9237c
github.com/TBD54566975/ftl/backend/schema.Visit.func1()
...
@github-actions github-actions bot added the triage Issue needs triaging label Jun 12, 2024
@jiyoonie9 jiyoonie9 changed the title Circular call results in `go Circular call results in fatal error: stack overflow Jun 12, 2024
@ftl-robot ftl-robot mentioned this issue Jun 12, 2024
@jonathanj-square jonathanj-square added good first issue Good for newcomers next Work that will be be picked up next and removed triage Issue needs triaging labels Jun 12, 2024
@jonathanj-square jonathanj-square self-assigned this Jun 12, 2024
@github-actions github-actions bot removed the next Work that will be be picked up next label Jun 12, 2024
@jonathanj-square jonathanj-square added bug Something isn't working next Work that will be be picked up next labels Jun 12, 2024
jonathanj-square added a commit that referenced this issue Jun 13, 2024
buildGraph does not check for cycles as it walks dependency chains; this change detects a member of the cycle and reports an error identifying that member
jonathanj-square added a commit that referenced this issue Jun 13, 2024
buildGraph does not check for cycles as it walks dependency chains; this change detects a member of the cycle and reports an error identifying that member
jonathanj-square added a commit that referenced this issue Jun 13, 2024
buildGraph does not check for cycles as it walks dependency chains; this change detects a member of the cycle and reports an error identifying that member
@matt2e matt2e removed the next Work that will be be picked up next label Jun 14, 2024
jonathanj-square added a commit that referenced this issue Jun 14, 2024
buildGraph does not check for cycles as it walks dependency chains; this change detects a member of the cycle and reports an error identifying that member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants