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

eval: stack overflow with cue def #3476

Open
rogpeppe opened this issue Oct 3, 2024 · 0 comments
Open

eval: stack overflow with cue def #3476

rogpeppe opened this issue Oct 3, 2024 · 0 comments
Labels
evaluator evalv3-win Issues resolved by switching from evalv2 to evalv3 NeedsFix

Comments

@rogpeppe
Copy link
Member

rogpeppe commented Oct 3, 2024

What version of CUE are you using (cue version)?

8a6ed2c44ebc23549793d3fdd71523b88523b542

Does this issue reproduce with the latest stable release?

Yes (v0.10)

What did you do?

exec cue def -e '#a' file.cue
-- file.cue --
#a:  (#b & {x: _}).x
#b: {
	x?: #c
	#c: [string]: #c
}

What did you expect to see?

Passing test.

What did you see instead?

> exec cue def -e '#a' file.cue
[stderr]
runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0xc020624c18 stack=[0xc020624000, 0xc040624000]
fatal error: stack overflow

runtime stack:
runtime.throw({0xe1814f?, 0x42c47c?})
	/home/rogpeppe/go/src/runtime/panic.go:1067 +0x48 fp=0x787e35fffc98 sp=0x787e35fffc68 pc=0x473048
runtime.newstack()
	/home/rogpeppe/go/src/runtime/stack.go:1117 +0x5bb fp=0x787e35fffdd0 sp=0x787e35fffc98 pc=0x4572fb
runtime.morestack()
	/home/rogpeppe/go/src/runtime/asm_amd64.s:621 +0x7a fp=0x787e35fffdd8 sp=0x787e35fffdd0 pc=0x4794fa

goroutine 1 gp=0xc000002380 m=5 mp=0xc000100008 [running]:
cuelang.org/go/internal/core/adt.(*nodeContext).expandDisjuncts(0xc000155208?, 0x2?, 0xc000155208?, 0x0?, 0x0?, 0x1?)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/disjunct.go:139 +0x2249 fp=0xc020624c28 sp=0xc020624c20 pc=0x6fdf49
cuelang.org/go/internal/core/adt.(*OpContext).unify(0xc00015cc00, 0xc000153720, 0x7fff0102)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/eval.go:306 +0x57c fp=0xc020624e78 sp=0xc020624c28 pc=0x7058dc
cuelang.org/go/internal/core/adt.(*OpContext).relNode(0xc00015cc00, 0x6ee119?)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/context.go:335 +0x3f fp=0xc020624ea8 sp=0xc020624e78 pc=0x6ed71f
cuelang.org/go/internal/core/adt.(*FieldReference).resolve(0xc00047fc80, 0xc00015cc00, 0x7fff0405)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/expr.go:727 +0x29 fp=0xc020624ee8 sp=0xc020624ea8 pc=0x7164a9
cuelang.org/go/internal/core/adt.(*OpContext).resolveState(0xc00015cc00, {0xc004135020, {0xf817d0, 0xc00047fc80}, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}}, ...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/context.go:500 +0xdd fp=0xc020625028 sp=0xc020624ee8 pc=0x6ee5dd
cuelang.org/go/internal/core/adt.(*OpContext).Resolve(0x0?, {0xc004135020, {0xf817d0, 0xc00047fc80}, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...}}, ...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/context.go:494 +0x58 fp=0xc020625098 sp=0xc020625028 pc=0x6ee4b8
cuelang.org/go/internal/core/dep.(ts: exit 1
*visitor).markResolver(0xc00037a580, 0xc004135020, {0xf86350, 0xc00047fc80})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:362 +0xfc fp=0xc020625170 sp=0xc020625098 pc=0x74529c
cuelang.org/go/internal/core/dep.(*visitor).markExpr(0xc00037a580, 0xc004135020, {0x787e37e4fca0?, 0xc00047fc80})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:284 +0x371 fp=0xc020625218 sp=0xc020625170 pc=0x7445d1
cuelang.org/go/internal/core/dep.(*visitor).markSubExpr(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:572
cuelang.org/go/internal/core/dep.(*visitor).markDecl(0xc00037a580, 0xc004135020, {0xf84aa0?, 0xc00026e570})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:586 +0x4fc fp=0xc020625270 sp=0xc020625218 pc=0x74679c
cuelang.org/go/internal/core/dep.(*visitor).markExpr(0xc00037a580, 0xc0006990e0, {0xf87100?, 0xc00032b0e0})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:349 +0x8dc fp=0xc020625318 sp=0xc020625270 pc=0x744b3c
cuelang.org/go/internal/core/dep.(*visitor).markInternalResolvers.(*visitor).markConjuncts.func2({0xc0006990e0, {0xf816b8, 0xc000698120}, {0xc0006990c0, 0x0, 0x0, 0x0, 0x0, 0x4, {0x0, ...}}})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:495 +0x3d fp=0xc020625350 sp=0xc020625318 pc=0x745ebd
cuelang.org/go/internal/core/adt.visitConjuncts({0xc000372880?, 0x0?, 0x0?}, 0xc020625430)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/composite.go:600 +0x102 fp=0xc0206253f0 sp=0xc020625350 pc=0x6ddf62
cuelang.org/go/internal/core/adt.(*Vertex).VisitLeafConjuncts(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/composite.go:589
cuelang.org/go/internal/core/dep.(*visitor).markConjuncts(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:492
cuelang.org/go/internal/core/dep.(*visitor).markInternalResolvers(0xc00037a580, 0xc004135000, {0xf86350, 0xc00047fc80}, 0x0?)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:520 +0x9b fp=0xc020625460 sp=0xc0206253f0 pc=0x745d1b
cuelang.org/go/internal/core/dep.(*visitor).reportDependency(0xc00037a580, 0xf817d0?, {0xf86350?, 0xc00047fc80?}, 0xc000153900)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:418 +0x178 fp=0xc020625578 sp=0xc020625460 pc=0x745718
cuelang.org/go/internal/core/dep.(*visitor).markResolver(0xc00037a580, 0xc004135000, {0xf86350, 0xc00047fc80})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:370 +0x1f9 fp=0xc020625650 sp=0xc020625578 pc=0x745399
cuelang.org/go/internal/core/dep.(*visitor).markExpr(0xc00037a580, 0xc004135000, {0x787e37e4fca0?, 0xc00047fc80})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:284 +0x371 fp=0xc0206256f8 sp=0xc020625650 pc=0x7445d1
cuelang.org/go/internal/core/dep.(*visitor).markSubExpr(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:572
cuelang.org/go/internal/core/dep.(*visitor).markDecl(0xc00037a580, 0xc004135000, {0xf84aa0?, 0xc00026e570})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:586 +0x4fc fp=0xc020625750 sp=0xc0206256f8 pc=0x74679c
cuelang.org/go/internal/core/dep.(*visitor).markExpr(0xc00037a580, 0xc0006990e0, {0xf87100?, 0xc00032b0e0})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:349 +0x8dc fp=0xc0206257f8 sp=0xc020625750 pc=0x744b3c
cuelang.org/go/internal/core/dep.(*visitor).markInternalResolvers.(*visitor).markConjuncts.func2({0xc0006990e0, {0xf816b8, 0xc000698120}, {0xc0006990c0, 0x0, 0x0, 0x0, 0x0, 0x4, {0x0, ...}}})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:495 +0x3d fp=0xc020625830 sp=0xc0206257f8 pc=0x745ebd
cuelang.org/go/internal/core/adt.visitConjuncts({0xc000372880?, 0x0?, 0x0?}, 0xc020625910)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/composite.go:600 +0x102 fp=0xc0206258d0 sp=0xc020625830 pc=0x6ddf62
cuelang.org/go/internal/core/adt.(*Vertex).VisitLeafConjuncts(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/composite.go:589
cuelang.org/go/internal/core/dep.(*visitor).markConjuncts(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:492
cuelang.org/go/internal/core/dep.(*visitor).markInternalResolvers(0xc00037a580, 0xc004134fe0, {0xf86350, 0xc00047fc80}, 0x0?)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:520 +0x9b fp=0xc020625940 sp=0xc0206258d0 pc=0x745d1b
cuelang.org/go/internal/core/dep.(*visitor).reportDependency(0xc00037a580, 0xf817d0?, {0xf86350?, 0xc00047fc80?}, 0xc000153900)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:418 +0x178 fp=0xc020625a58 sp=0xc020625940 pc=0x745718
cuelang.org/go/internal/core/dep.(*visitor).markResolver(0xc00037a580, 0xc004134fe0, {0xf86350, 0xc00047fc80})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:370 +0x1f9 fp=0xc020625b30 sp=0xc020625a58 pc=0x745399
cuelang.org/go/internal/core/dep.(*visitor).markExpr(0xc00037a580, 0xc004134fe0, {0x787e37e4fca0?, 0xc00047fc80})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:284 +0x371 fp=0xc020625bd8 sp=0xc020625b30 pc=0x7445d1
cuelang.org/go/internal/core/dep.(*visitor).markSubExpr(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:572
cuelang.org/go/internal/core/dep.(*visitor).markDecl(0xc00037a580, 0xc004134fe0, {0xf84aa0?, 0xc00026e570})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:586 +0x4fc fp=0xc020625c30 sp=0xc020625bd8 pc=0x74679c
cuelang.org/go/internal/core/dep.(*visitor).markExpr(0xc00037a580, 0xc0006990e0, {0xf87100?, 0xc00032b0e0})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:349 +0x8dc fp=0xc020625cd8 sp=0xc020625c30 pc=0x744b3c
cuelang.org/go/internal/core/dep.(*visitor).markInternalResolvers.(*visitor).markConjuncts.func2({0xc0006990e0, {0xf816b8, 0xc000698120}, {0xc0006990c0, 0x0, 0x0, 0x0, 0x0, 0x4, {0x0, ...}}})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:495 +0x3d fp=0xc020625d10 sp=0xc020625cd8 pc=0x745ebd
cuelang.org/go/internal/core/adt.visitConjuncts({0xc000372880?, 0x0?, 0x0?}, 0xc020625df0)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/composite.go:600 +0x102 fp=0xc020625db0 sp=0xc020625d10 pc=0x6ddf62
cuelang.org/go/internal/core/adt.(*Vertex).VisitLeafConjuncts(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/composite.go:589
cuelang.org/go/internal/core/dep.(*visitor).markConjuncts(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:492
cuelang.org/go/internal/core/dep.(*visitor).markInternalResolvers(0xc00037a580, 0xc004134fc0, {0xf86350, 0xc00047fc80}, 0x0?)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:520 +0x9b fp=0xc020625e20 sp=0xc020625db0 pc=0x745d1b
cuelang.org/go/internal/core/dep.(*visitor).reportDependency(0xc00037a580, 0xf817d0?, {0xf86350?, 0xc00047fc80?}, 0xc000153900)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:418 +0x178 fp=0xc020625f38 sp=0xc020625e20 pc=0x745718
cuelang.org/go/internal/core/dep.(*visitor).markResolver(0xc00037a580, 0xc004134fc0, {0xf86350, 0xc00047fc80})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:370 +0x1f9 fp=0xc020626010 sp=0xc020625f38 pc=0x745399
cuelang.org/go/internal/core/dep.(*visitor).markExpr(0xc00037a580, 0xc004134fc0, {0x787e37e4fca0?, 0xc00047fc80})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:284 +0x371 fp=0xc0206260b8 sp=0xc020626010 pc=0x7445d1
cuelang.org/go/internal/core/dep.(*visitor).markSubExpr(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:572
cuelang.org/go/internal/core/dep.(*visitor).markDecl(0xc00037a580, 0xc004134fc0, {0xf84aa0?, 0xc00026e570})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:586 +0x4fc fp=0xc020626110 sp=0xc0206260b8 pc=0x74679c
cuelang.org/go/internal/core/dep.(*visitor).markExpr(0xc00037a580, 0xc0006990e0, {0xf87100?, 0xc00032b0e0})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:349 +0x8dc fp=0xc0206261b8 sp=0xc020626110 pc=0x744b3c
cuelang.org/go/internal/core/dep.(*visitor).markInternalResolvers.(*visitor).markConjuncts.func2({0xc0006990e0, {0xf816b8, 0xc000698120}, {0xc0006990c0, 0x0, 0x0, 0x0, 0x0, 0x4, {0x0, ...}}})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:495 +0x3d fp=0xc0206261f0 sp=0xc0206261b8 pc=0x745ebd
cuelang.org/go/internal/core/adt.visitConjuncts({0xc000372880?, 0x0?, 0x0?}, 0xc0206262d0)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/composite.go:600 +0x102 fp=0xc020626290 sp=0xc0206261f0 pc=0x6ddf62
cuelang.org/go/internal/core/adt.(*Vertex).VisitLeafConjuncts(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/composite.go:589
cuelang.org/go/internal/core/dep.(*visitor).markConjuncts(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:492
cuelang.org/go/internal/core/dep.(*visitor).markInternalResolvers(0xc00037a580, 0xc004134fa0, {0xf86350, 0xc00047fc80}, 0x0?)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:520 +0x9b fp=0xc020626300 sp=0xc020626290 pc=0x745d1b
cuelang.org/go/internal/core/dep.(*visitor).reportDependency(0xc00037a580, 0xf817d0?, {0xf86350?, 0xc00047fc80?}, 0xc000153900)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:418 +0x178 fp=0xc020626418 sp=0xc020626300 pc=0x745718
...4731898 frames elided...
cuelang.org/go/internal/core/adt.visitConjuncts({0xc000372880?, 0x0?, 0x0?}, 0xc040622830)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/composite.go:600 +0x102 fp=0xc0406227f0 sp=0xc040622750 pc=0x6ddf62
cuelang.org/go/internal/core/adt.(*Vertex).VisitLeafConjuncts(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/composite.go:589
cuelang.org/go/internal/core/dep.(*visitor).markConjuncts(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:492
cuelang.org/go/internal/core/dep.(*visitor).markInternalResolvers(0xc00037a580, 0xc000699180, {0xf86350, 0xc00047fc80}, 0x0?)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:520 +0x9b fp=0xc040622860 sp=0xc0406227f0 pc=0x745d1b
cuelang.org/go/internal/core/dep.(*visitor).reportDependency(0xc00037a580, 0xf817d0?, {0xf86350?, 0xc00047fc80?}, 0xc000153900)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:418 +0x178 fp=0xc040622978 sp=0xc040622860 pc=0x745718
cuelang.org/go/internal/core/dep.(*visitor).markResolver(0xc00037a580, 0xc000699180, {0xf86350, 0xc00047fc80})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:370 +0x1f9 fp=0xc040622a50 sp=0xc040622978 pc=0x745399
cuelang.org/go/internal/core/dep.(*visitor).markExpr(0xc00037a580, 0xc000699180, {0x787e37e4fca0?, 0xc00047fc80})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:284 +0x371 fp=0xc040622af8 sp=0xc040622a50 pc=0x7445d1
cuelang.org/go/internal/core/dep.(*visitor).markSubExpr(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:572
cuelang.org/go/internal/core/dep.(*visitor).markDecl(0xc00037a580, 0xc000699180, {0xf84aa0?, 0xc00026e570})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:586 +0x4fc fp=0xc040622b50 sp=0xc040622af8 pc=0x74679c
cuelang.org/go/internal/core/dep.(*visitor).markExpr(0xc00037a580, 0xc0006990e0, {0xf87100?, 0xc00032b0e0})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:349 +0x8dc fp=0xc040622bf8 sp=0xc040622b50 pc=0x744b3c
cuelang.org/go/internal/core/dep.(*visitor).markInternalResolvers.(*visitor).markConjuncts.func2({0xc0006990e0, {0xf816b8, 0xc000698120}, {0xc0006990c0, 0x0, 0x0, 0x0, 0x0, 0x4, {0x0, ...}}})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:495 +0x3d fp=0xc040622c30 sp=0xc040622bf8 pc=0x745ebd
cuelang.org/go/internal/core/adt.visitConjuncts({0xc000372880?, 0x0?, 0x0?}, 0xc040622d10)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/composite.go:600 +0x102 fp=0xc040622cd0 sp=0xc040622c30 pc=0x6ddf62
cuelang.org/go/internal/core/adt.(*Vertex).VisitLeafConjuncts(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/composite.go:589
cuelang.org/go/internal/core/dep.(*visitor).markConjuncts(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:492
cuelang.org/go/internal/core/dep.(*visitor).markInternalResolvers(0xc00037a580, 0xc0006990e0, {0xf86350, 0xc00047fc60}, 0x0?)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:520 +0x9b fp=0xc040622d40 sp=0xc040622cd0 pc=0x745d1b
cuelang.org/go/internal/core/dep.(*visitor).reportDependency(0xc00037a580, 0xf817d0?, {0xf86350?, 0xc00047fc60?}, 0xc000153900)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:418 +0x178 fp=0xc040622e58 sp=0xc040622d40 pc=0x745718
cuelang.org/go/internal/core/dep.(*visitor).markResolver(0xc00037a580, 0xc0006990e0, {0xf86350, 0xc00047fc60})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:370 +0x1f9 fp=0xc040622f30 sp=0xc040622e58 pc=0x745399
cuelang.org/go/internal/core/dep.(*visitor).markExpr(0xc00037a580, 0xc0006990e0, {0x787e37e4fca0?, 0xc00047fc60})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:284 +0x371 fp=0xc040622fd8 sp=0xc040622f30 pc=0x7445d1
cuelang.org/go/internal/core/dep.(*visitor).markInternalResolvers.(*visitor).markConjuncts.func2({0xc0006990e0, {0xf816b8, 0xc000698100}, {0xc0006990c0, 0x0, 0x0, 0x0, 0x0, 0x4, {0x0, ...}}})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:495 +0x3d fp=0xc040623010 sp=0xc040622fd8 pc=0x745ebd
cuelang.org/go/internal/core/adt.visitConjuncts({0xc00037a600?, 0x0?, 0x0?}, 0xc0406230f0)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/composite.go:600 +0x102 fp=0xc0406230b0 sp=0xc040623010 pc=0x6ddf62
cuelang.org/go/internal/core/adt.(*Vertex).VisitLeafConjuncts(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/composite.go:589
cuelang.org/go/internal/core/dep.(*visitor).markConjuncts(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:492
cuelang.org/go/internal/core/dep.(*visitor).markInternalResolvers(0xc00037a580, 0xc0006981a0, {0xf86440, 0xc0006980c0}, 0x0?)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:520 +0x9b fp=0xc040623120 sp=0xc0406230b0 pc=0x745d1b
cuelang.org/go/internal/core/dep.(*visitor).reportDependency(0xc00037a580, 0xf81758?, {0xf86440?, 0xc0006980c0?}, 0xc000153860)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:418 +0x178 fp=0xc040623238 sp=0xc040623120 pc=0x745718
cuelang.org/go/internal/core/dep.(*visitor).markResolver(0xc00037a580, 0xc0006981a0, {0xf86440, 0xc0006980c0})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:370 +0x1f9 fp=0xc040623310 sp=0xc040623238 pc=0x745399
cuelang.org/go/internal/core/dep.(*visitor).markExpr(0xc00037a580, 0xc0006981a0, {0x787e37e518f8?, 0xc0006980c0})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:284 +0x371 fp=0xc0406233b8 sp=0xc040623310 pc=0x7445d1
cuelang.org/go/internal/core/dep.(*visitor).visit.func2({0xc0006981a0, {0xf816b8, 0xc0006980e0}, {0x0, 0x0, 0x0, 0x0, 0x0, 0x4, {0x0, ...}}})
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:239 +0x3d fp=0xc0406233f0 sp=0xc0406233b8 pc=0x74415d
cuelang.org/go/internal/core/adt.visitConjuncts({0xc0003056c0?, 0xf816b8?, 0x6980e0?}, 0xc0406234f0)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/composite.go:600 +0x102 fp=0xc040623490 sp=0xc0406233f0 pc=0x6ddf62
cuelang.org/go/internal/core/adt.(*Vertex).VisitLeafConjuncts(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/adt/composite.go:589
cuelang.org/go/internal/core/dep.(*visitor).visit(0x78?, 0xde49e0?, 0x1?)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:238 +0xbf fp=0xc040623518 sp=0xc040623490 pc=0x74409f
cuelang.org/go/internal/core/dep.(*visitor).visitReusingVisitor(0xc00037a580, 0x10?, 0x88?)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:213 +0x91 fp=0xc040623540 sp=0xc040623518 pc=0x743f91
cuelang.org/go/internal/core/dep.Visit(0x787e37e5d810?, 0xc00015cc00, 0xc00013d9a0, 0xc000514350)
	/home/rogpeppe/src/cuelabs/cue/internal/core/dep/dep.go:200 +0x145 fp=0xc0406235f0 sp=0xc040623540 pc=0x743ea5
cuelang.org/go/internal/core/export.(*pivotter).markDeps(0xc0000a1f20, 0xc00013d9a0, 0x30?)
	/home/rogpeppe/src/cuelabs/cue/internal/core/export/self.go:159 +0x78 fp=0xc040623630 sp=0xc0406235f0 pc=0x75b098
cuelang.org/go/internal/core/export.(*pivotter).linkDependencies(0xc0000a1f20, 0xc00013d9a0)
	/home/rogpeppe/src/cuelabs/cue/internal/core/export/self.go:120 +0x31 fp=0xc0406236e0 sp=0xc040623630 pc=0x75adf1
cuelang.org/go/internal/core/export.(*exporter).initPivotter(0xc0000cc790, 0xc00013d9a0)
	/home/rogpeppe/src/cuelabs/cue/internal/core/export/self.go:51 +0xcf fp=0xc040623708 sp=0xc0406236e0 pc=0x75ac0f
cuelang.org/go/internal/core/export.(*exporter).initPivot(...)
	/home/rogpeppe/src/cuelabs/cue/internal/core/export/export.go:372
cuelang.org/go/internal/core/export.(*Profile).Def(0xc0003b92c0, {0xf8c7f0?, 0xc00025b4c0?}, {0x0?, 0x0?}, 0xc00013d9a0)
	/home/rogpeppe/src/cuelabs/cue/internal/core/export/export.go:116 +0x8e fp=0xc040623810 sp=0xc040623708 pc=0x7503ae
cuelang.org/go/cue.Value.Syntax({0xc00025b4c0?, 0xc00013d9a0?, 0x0?}, {0xc000372680, 0x7, 0x0?})
	/home/rogpeppe/src/cuelabs/cue/cue/types.go:1021 +0x265 fp=0xc0406238e0 sp=0xc040623810 pc=0x951a45
cuelang.org/go/internal/encoding.NewEncoder.func4({0xc00025b4c0?, 0xc00013d9a0?, 0x0?})
	/home/rogpeppe/src/cuelabs/cue/internal/encoding/encoder.go:162 +0x37 fp=0xc040623928 sp=0xc0406238e0 pc=0xa927d7
cuelang.org/go/internal/encoding.(*Encoder).Encode(0xc000305ac0, {0xc00025b4c0?, 0xc00013d9a0?, 0x0?})
	/home/rogpeppe/src/cuelabs/cue/internal/encoding/encoder.go:267 +0xb9 fp=0xc040623998 sp=0xc040623928 pc=0xa93219
cuelang.org/go/cmd/cue/cmd.runDef(0xc00026ee10, {0xc00026fc20, 0x1, 0x3})
	/home/rogpeppe/src/cuelabs/cue/cmd/cue/cmd/def.go:72 +0x1c5 fp=0xc040623a60 sp=0xc040623998 pc=0xc397c5
cuelang.org/go/cmd/cue/cmd.newDefCmd.mkRunE.func1(0xc0001b4e00?, {0xc00026fc20, 0x1, 0x3})
	/home/rogpeppe/src/cuelabs/cue/cmd/cue/cmd/root.go:136 +0x2c2 fp=0xc040623c48 sp=0xc040623a60 pc=0xc38fc2
github.com/spf13/cobra.(*Command).execute(0xc00026d208, {0xc00026fbc0, 0x3, 0x3})
	/home/rogpeppe/src/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:985 +0xaaa fp=0xc040623dd0 sp=0xc040623c48 pc=0x5fcb2a
github.com/spf13/cobra.(*Command).ExecuteC(0xc00026c308)
	/home/rogpeppe/src/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1117 +0x3ff fp=0xc040623ea8 sp=0xc040623dd0 pc=0x5fd3ff
github.com/spf13/cobra.(*Command).Execute(...)
	/home/rogpeppe/src/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1041
cuelang.org/go/cmd/cue/cmd.(*Command).Run(0xc00026ee10, {0x157c120?, 0xd2d9c0?})
	/home/rogpeppe/src/cuelabs/cue/cmd/cue/cmd/root.go:368 +0x1c fp=0xc040623ec0 sp=0xc040623ea8 pc=0xc6251c
cuelang.org/go/cmd/cue/cmd.Main()
	/home/rogpeppe/src/cuelabs/cue/cmd/cue/cmd/root.go:276 +0x95 fp=0xc040623f38 sp=0xc040623ec0 pc=0xc62075
main.main()
	/home/rogpeppe/src/cuelabs/cue/cmd/cue/main.go:24 +0x13 fp=0xc040623f50 sp=0xc040623f38 pc=0xc85993
runtime.main()
	/home/rogpeppe/go/src/runtime/proc.go:283 +0x28b fp=0xc040623fe0 sp=0xc040623f50 pc=0x43e46b
runtime.goexit({})
	/home/rogpeppe/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc040623fe8 sp=0xc040623fe0 pc=0x47b3a1
[exit status 2]
FAIL: /tmp/y.txtar:1: unexpected command failure
@mpvl mpvl added the evalv3-win Issues resolved by switching from evalv2 to evalv3 label Oct 7, 2024
cueckoo pushed a commit that referenced this issue Oct 8, 2024
Tests for two chains for fields referring to
each other in a circular fashion.

Note that one of the tests is currently broken,
even though the comments pretend they are not.
The diff/todo section mentions it, thouhg.

This is part of fix needed for
Issue #3476

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: Id24e0ce090faca908663ee598544b697578a8f10
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202215
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Matthew Sackman <matthew@cue.works>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
cueckoo pushed a commit that referenced this issue Oct 8, 2024
The finalized state of a node was set before processing
patterns. This caused cycles in patterns to go unnoticed.

Fixing this further exposed some issues with cycle detection
in sharing: allowing cyclic nodes to share could make
structure sharing go unnoticed. We now do not allow
sharing in this case.

Another issue was that clearing the Refs in a nonRooted
struct could remove a necessary cycle detection.

Issue #3476
Issue #2854
Issue #2850

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: Ibfbf716b9aa2b07ac83d0125a8e5188486eda4eb
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202216
Reviewed-by: Matthew Sackman <matthew@cue.works>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
cueckoo pushed a commit that referenced this issue Oct 14, 2024
We know from the cycle algorithm that inline and
non-rooted structs/lists should get the same treatment
as regular fields. This is a first step in removing
their discrepancies.

To avoid some test breakages, we had to move where
the unification of shared structures was done.
This indeed seems to be a more sensible spot.

Issue #3476
Issue #2850
Issue #2854
Fixes #3509

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: Ic26cb31f207d7be0209d01bad5c6df3130251e2f
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202269
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Matthew Sackman <matthew@cue.works>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
vanhtuan0409 pushed a commit to anduintransaction/cue that referenced this issue Oct 15, 2024
Tests for two chains for fields referring to
each other in a circular fashion.

Note that one of the tests is currently broken,
even though the comments pretend they are not.
The diff/todo section mentions it, thouhg.

This is part of fix needed for
Issue cue-lang#3476

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: Id24e0ce090faca908663ee598544b697578a8f10
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202215
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Matthew Sackman <matthew@cue.works>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
vanhtuan0409 pushed a commit to anduintransaction/cue that referenced this issue Oct 15, 2024
The finalized state of a node was set before processing
patterns. This caused cycles in patterns to go unnoticed.

Fixing this further exposed some issues with cycle detection
in sharing: allowing cyclic nodes to share could make
structure sharing go unnoticed. We now do not allow
sharing in this case.

Another issue was that clearing the Refs in a nonRooted
struct could remove a necessary cycle detection.

Issue cue-lang#3476
Issue cue-lang#2854
Issue cue-lang#2850

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: Ibfbf716b9aa2b07ac83d0125a8e5188486eda4eb
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202216
Reviewed-by: Matthew Sackman <matthew@cue.works>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
vanhtuan0409 pushed a commit to anduintransaction/cue that referenced this issue Oct 15, 2024
We know from the cycle algorithm that inline and
non-rooted structs/lists should get the same treatment
as regular fields. This is a first step in removing
their discrepancies.

To avoid some test breakages, we had to move where
the unification of shared structures was done.
This indeed seems to be a more sensible spot.

Issue cue-lang#3476
Issue cue-lang#2850
Issue cue-lang#2854
Fixes cue-lang#3509

Signed-off-by: Marcel van Lohuizen <mpvl@gmail.com>
Change-Id: Ic26cb31f207d7be0209d01bad5c6df3130251e2f
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1202269
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>
Reviewed-by: Matthew Sackman <matthew@cue.works>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
evaluator evalv3-win Issues resolved by switching from evalv2 to evalv3 NeedsFix
Projects
None yet
Development

No branches or pull requests

2 participants