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

"incDependent: already closed" panic on evalv3 #3750

Open
verdverm opened this issue Feb 12, 2025 · 3 comments
Open

"incDependent: already closed" panic on evalv3 #3750

verdverm opened this issue Feb 12, 2025 · 3 comments
Assignees
Labels
evaluator evalv3 issues affecting only the evaluator version 3 panic

Comments

@verdverm
Copy link

verdverm commented Feb 12, 2025

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

v0.12.0 with evalv3 turned on

Does this issue reproduce with the latest stable release?

Tried running our CUE with v0.12 and evalv3 turned on and got a panic

I don't think I can share this code, but here is the stack trace if it helps at all

Happens with def, eval, and export

panic: incDependent: already closed: 0xc00421b440 [recovered]
        panic: incDependent: already closed: 0xc00421b440 [recovered]
        panic: incDependent: already closed: 0xc00421b440 [recovered]
        panic: incDependent: already closed: 0xc00421b440

goroutine 1 [running]:
cuelang.org/go/internal/core/adt.runTask.func1()
        /home/tony/cue/internal/core/adt/sched.go:695 +0x76
panic({0xea7520?, 0xc0042f0750?})
        /usr/local/go/src/runtime/panic.go:785 +0x132
cuelang.org/go/internal/core/adt.runTask.func1()
        /home/tony/cue/internal/core/adt/sched.go:695 +0x76
panic({0xea7520?, 0xc0042f0750?})
        /usr/local/go/src/runtime/panic.go:785 +0x132
cuelang.org/go/internal/core/adt.runTask.func1()
        /home/tony/cue/internal/core/adt/sched.go:695 +0x76
panic({0xea7520?, 0xc0042f0750?})
        /usr/local/go/src/runtime/panic.go:785 +0x132
cuelang.org/go/internal/core/adt.(*closeContext).incDependent(0xc00421b440, 0xc00292a000, 0xc0042ebe78?, 0x0?)
        /home/tony/cue/internal/core/adt/dep.go:243 +0xa5
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc00421b200, 0xc00292a000, 0xc00421b440, {0x10?, 0x0?, 0x0?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:454 +0x35e
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0x41756b?, 0x7f9e21dcc4f0?, 0xc0042abce0?, {0x0, {0x11e6dc0, 0xc0042ebe60}, {0x0, 0x0, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc00421b0e0, 0xc00292a000, 0xc00421b440, {0x6b?, 0x75?, 0x41?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:427 +0x239
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0x7f9e21dd00f0?, 0x18?, 0x412505?, {0x0, {0x11e6dc0, 0xc0042ebe48}, {0x0, 0x0, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc004225d40, 0xc00292a000, 0xc00421b440, {0x6b?, 0x75?, 0x41?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:427 +0x239
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0x7f9e21dd00f0?, 0x18?, 0x412505?, {0x0, {0x11e6dc0, 0xc0042ebe30}, {0x0, 0x0, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc00422b680, 0xc00292a000, 0xc00421b440, {0x6b?, 0x75?, 0x41?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:427 +0x239
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0x7f9e21dd00f0?, 0x18?, 0x412505?, {0x0, {0x11e6dc0, 0xc0042ebe18}, {0x0, 0x0, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc004230d80, 0xc00292a000, 0xc00421b440, {0x6b?, 0x75?, 0x41?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:427 +0x239
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0x2?, 0xc0027cba88?, 0x471605?, {0x0, {0x11e6dc0, 0xc0042ebe00}, {0x0, 0x0, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc004234480, 0xc00292a000, 0xc00421b440, {0xf?, 0x22?, 0x41?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:427 +0x239
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0x2?, 0xc0027cbc98?, 0x471605?, {0x0, {0x11e6dc0, 0xc0042ebde8}, {0x0, 0x0, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc004237b00, 0xc00292a000, 0xc00421b440, {0x6b?, 0x75?, 0x41?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:427 +0x239
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0x2?, 0xc0027cbea8?, 0x471605?, {0x0, {0x11e6dc0, 0xc0042ebdd0}, {0x0, 0x0, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc00423d200, 0xc00292a000, 0xc00421b440, {0x10?, 0x0?, 0x0?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:427 +0x239
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0xc0042f0660?, 0xe7e380?, 0x8?, {0x0, {0x11e6dc0, 0xc0042ebdb8}, {0x0, 0x0, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc004240900, 0xc00292a000, 0xc00421b440, {0x10?, 0x0?, 0x0?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:427 +0x239
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0xc0042f0670?, 0xe7e380?, 0x8?, {0x0, {0x11e6dc0, 0xc0042ebda0}, {0x0, 0x0, 0x0, 0x1, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc0042c2480, 0xc00292a000, 0xc00421b440, {0x10?, 0x0?, 0x0?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:427 +0x239
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0xc0042f0680?, 0xe7e380?, 0x8?, {0x0, {0x11e6dc0, 0xc0042ebd88}, {0x0, 0x0, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc0042c25a0, 0xc00292a000, 0xc00421b440, {0x10?, 0x0?, 0x0?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:427 +0x239
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0xc0042f0690?, 0xe7e380?, 0x8?, {0x0, {0x11e6dc0, 0xc0042ebd70}, {0x0, 0x0, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc0042c26c0, 0xc00292a000, 0xc00421b440, {0x10?, 0x0?, 0x0?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:427 +0x239
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0xc0042f06a0?, 0xe7e380?, 0x8?, {0x0, {0x11e6dc0, 0xc0042ebd58}, {0x0, 0x0, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc0042c27e0, 0xc00292a000, 0xc00421b440, {0x10?, 0x0?, 0x0?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:427 +0x239
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0xc0042f06b0?, 0xe7e380?, 0x8?, {0x0, {0x11e6dc0, 0xc0042ebd40}, {0x0, 0x0, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc0042c2900, 0xc00292a000, 0xc00421b440, {0x10?, 0x0?, 0x0?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:427 +0x239
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0xc0042f06c0?, 0xe7e380?, 0x8?, {0x0, {0x11e6dc0, 0xc0042ebd28}, {0x0, 0x0, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc0042c2a20, 0xc00292a000, 0xc00421b440, {0x10?, 0x0?, 0x0?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:427 +0x239
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0x417547?, 0xe7e380?, 0x8?, {0x0, {0x11e6dc0, 0xc0042ebd10}, {0x0, 0x0, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc0042c2b40, 0xc00292a000, 0xc00421b440, {0x10?, 0x0?, 0x0?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:427 +0x239
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0xc0042f06e0?, 0xe7e380?, 0x8?, {0x0, {0x11e6dc0, 0xc0042ebcf8}, {0x0, 0x0, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc0042c2c60, 0xc00292a000, 0xc00421b440, {0x10?, 0x0?, 0x0?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:427 +0x239
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0xc0042f0730?, 0xc0042fff80?, 0x10?, {0x0, {0x11e6dc0, 0xc0042ebce0}, {0x0, 0x0, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc0042c2d80, 0xc00292a000, 0xc00421b440, {0xf?, 0x0?, 0x0?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:427 +0x239
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0xc0027cd528?, 0x43bc08?, 0x0?, {0x0, {0x11e6dc0, 0xc0042ebcc8}, {0x0, 0x0, 0x0, 0x1, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc0042da240, 0xc00292a000, 0xc00421b440, {0xc0?, 0x1f?, 0xf7?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:427 +0x239
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0x470000?, 0xc0027cd5f8?, 0x6ec67c?, {0x0, {0x11e6dc0, 0xc0042ebcb0}, {0x0, 0x0, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc0042da360, 0xc00292a000, 0xc00421b440, {0x0?, 0x0?, 0x0?, 0x0?}, 0x0, 0x1)
        /home/tony/cue/internal/core/adt/fields.go:427 +0x239
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0x0?, 0xc004301680?, 0x0?, {0xc004217c40, {0x11e6de8, 0xc001241900}, {0x0, 0xc0042da360, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:478 +0x5a
cuelang.org/go/internal/core/adt.(*closeContext).insertConjunct(0xc004185c20?, 0xc00292a000, 0xc00421b440, {0xc004217c40, {0x11e6de8, 0xc001241900}, {0x0, 0xc0042da360, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:671 +0x65
cuelang.org/go/internal/core/adt.(*nodeContext).insertArcCC(0xc00428d208, 0x861, 0x0, {0xc004217c40, {0x11e6de8, 0xc001241900}, {0x0, 0xc0042da360, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/fields.go:755 +0x205
cuelang.org/go/internal/core/adt.(*nodeContext).insertArc(...)
        /home/tony/cue/internal/core/adt/fields.go:714
...19 frames elided...
cuelang.org/go/internal/core/adt.(*nodeContext).doDisjunct(0xc002bda608, {0xc0013fbe00, {0x11e6f00, 0xc0013dacc0}, {0x0, 0xc00425e480, 0x0, 0x0, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/disjunct2.go:548 +0x619
cuelang.org/go/internal/core/adt.(*nodeContext).crossProduct(0xc002a97808, {0xc00261bb50?, 0x0?, 0xc002af5e60?}, {0xc000b32cf0, 0x1, 0xc002af5e60?}, 0xc0021c7ab8, 0x4, 0x1b)
        /home/tony/cue/internal/core/adt/disjunct2.go:430 +0x491
cuelang.org/go/internal/core/adt.(*nodeContext).processDisjunctions(0xc002a97808)
        /home/tony/cue/internal/core/adt/disjunct2.go:355 +0x417
cuelang.org/go/internal/core/adt.processDisjunctions(0x1036a7d?, 0xc002ae1080, 0x27?)
        /home/tony/cue/internal/core/adt/tasks.go:217 +0x1c
cuelang.org/go/internal/core/adt.runTask(0xc002ae1080, 0x2)
        /home/tony/cue/internal/core/adt/sched.go:718 +0x52e
cuelang.org/go/internal/core/adt.(*scheduler).process(0xc002a979c0, 0x14, 0x2)
        /home/tony/cue/internal/core/adt/sched.go:408 +0x21e
cuelang.org/go/internal/core/adt.(*nodeContext).completeNodeTasks(0xc002a97808, 0x2)
        /home/tony/cue/internal/core/adt/unify.go:486 +0x173
cuelang.org/go/internal/core/adt.runTask.func1()
        /home/tony/cue/internal/core/adt/sched.go:681 +0x30
cuelang.org/go/internal/core/adt.runTask(0xc002ae0e00, 0x4)
        /home/tony/cue/internal/core/adt/sched.go:741 +0x6ef
cuelang.org/go/internal/core/adt.(*scheduler).process(0xc002a979c0, 0x7f7f, 0x4)
        /home/tony/cue/internal/core/adt/sched.go:408 +0x21e
cuelang.org/go/internal/core/adt.(*Vertex).unify(0xc002a8ab40, 0xc00292a000, 0x7fff, 0x4)
        /home/tony/cue/internal/core/adt/unify.go:216 +0x577
cuelang.org/go/internal/core/adt.(*nodeContext).completeAllArcs(0xc002a15808, 0x7fff, 0x4)
        /home/tony/cue/internal/core/adt/unify.go:552 +0x10b
cuelang.org/go/internal/core/adt.(*Vertex).unify(0xc0029a1b80, 0xc00292a000, 0x7fff, 0x4)
        /home/tony/cue/internal/core/adt/unify.go:290 +0xb9f
cuelang.org/go/internal/core/adt.(*nodeContext).completeAllArcs(0xc002a3c008, 0x7fff, 0x4)
        /home/tony/cue/internal/core/adt/unify.go:552 +0x10b
cuelang.org/go/internal/core/adt.(*Vertex).unify(0xc0029a1ae0, 0xc00292a000, 0x7fff, 0x4)
        /home/tony/cue/internal/core/adt/unify.go:290 +0xb9f
cuelang.org/go/internal/core/adt.(*nodeContext).completeAllArcs(0xc002a3ec08, 0x7fff, 0x4)
        /home/tony/cue/internal/core/adt/unify.go:552 +0x10b
cuelang.org/go/internal/core/adt.(*Vertex).unify(0xc0029a1680, 0xc00292a000, 0x7fff, 0x4)
        /home/tony/cue/internal/core/adt/unify.go:290 +0xb9f
cuelang.org/go/internal/core/adt.(*nodeContext).doDisjunct(0xc002968c08, {0xc0013fbe00, {0x11e6f00, 0xc0013dacb0}, {0x0, 0xc0029e7320, 0x0, 0x0, 0x0, 0x0, ...}}, ...)
        /home/tony/cue/internal/core/adt/disjunct2.go:548 +0x619
cuelang.org/go/internal/core/adt.(*nodeContext).crossProduct(0xc002968c08, {0xc00261d868?, 0x72bfdb?, 0x0?}, {0xc00261d8a0, 0x1, 0x0?}, 0xc0020da080, 0x4, 0x1)
        /home/tony/cue/internal/core/adt/disjunct2.go:430 +0x491
cuelang.org/go/internal/core/adt.(*nodeContext).processDisjunctions(0xc002968c08)
        /home/tony/cue/internal/core/adt/disjunct2.go:355 +0x417
cuelang.org/go/internal/core/adt.processDisjunctions(0x1036a7d?, 0xc0020b7f00, 0x27?)
        /home/tony/cue/internal/core/adt/tasks.go:217 +0x1c
cuelang.org/go/internal/core/adt.runTask(0xc0020b7f00, 0x2)
        /home/tony/cue/internal/core/adt/sched.go:718 +0x52e
cuelang.org/go/internal/core/adt.(*scheduler).process(0xc002968dc0, 0x14, 0x2)
        /home/tony/cue/internal/core/adt/sched.go:408 +0x21e
cuelang.org/go/internal/core/adt.(*nodeContext).completeNodeTasks(0xc002968c08, 0x2)
        /home/tony/cue/internal/core/adt/unify.go:486 +0x173
cuelang.org/go/internal/core/adt.runTask.func1()
        /home/tony/cue/internal/core/adt/sched.go:681 +0x30
cuelang.org/go/internal/core/adt.runTask(0xc0020b7b00, 0x4)
        /home/tony/cue/internal/core/adt/sched.go:741 +0x6ef
cuelang.org/go/internal/core/adt.(*scheduler).process(0xc002968dc0, 0x7f7f, 0x4)
        /home/tony/cue/internal/core/adt/sched.go:408 +0x21e
cuelang.org/go/internal/core/adt.(*Vertex).unify(0xc002958f00, 0xc00292a000, 0x7fff, 0x4)
        /home/tony/cue/internal/core/adt/unify.go:216 +0x577
cuelang.org/go/internal/core/adt.(*nodeContext).completeAllArcs(0xc002965808, 0x7fff, 0x4)
        /home/tony/cue/internal/core/adt/unify.go:552 +0x10b
cuelang.org/go/internal/core/adt.(*Vertex).unify(0xc002958d20, 0xc00292a000, 0x7fff, 0x4)
        /home/tony/cue/internal/core/adt/unify.go:290 +0xb9f
cuelang.org/go/internal/core/adt.(*nodeContext).completeAllArcs(0xc0020b0008, 0x7fff, 0x4)
        /home/tony/cue/internal/core/adt/unify.go:552 +0x10b
cuelang.org/go/internal/core/adt.(*Vertex).unify(0xc00292c0a0, 0xc00292a000, 0x7fff, 0x4)
        /home/tony/cue/internal/core/adt/unify.go:290 +0xb9f
cuelang.org/go/internal/core/adt.(*nodeContext).completeAllArcs(0xc0025a3808, 0x7fff, 0x4)
        /home/tony/cue/internal/core/adt/unify.go:552 +0x10b
cuelang.org/go/internal/core/adt.(*Vertex).unify(0xc00280fe00, 0xc00292a000, 0x7fff, 0x4)
        /home/tony/cue/internal/core/adt/unify.go:290 +0xb9f
cuelang.org/go/internal/core/adt.(*OpContext).unify(0xc0013fb032?, 0xc00261f3d0?, 0x41cc16?)
        /home/tony/cue/internal/core/adt/eval.go:160 +0x1c6
cuelang.org/go/internal/core/adt.(*Vertex).Finalize(0x7f9e6b5205b8?, 0xc00292a000)
        /home/tony/cue/internal/core/adt/composite.go:963 +0x59
cuelang.org/go/cue.newVertexRoot(0xc0002d6480, 0x7f9e21e8b398?, 0xc00280fe00)
        /home/tony/cue/cue/types.go:589 +0x25
cuelang.org/go/cue.newValueRoot(0x0?, 0xc00261f520?, {0x11eeea0?, 0xc00280fe00?})
        /home/tony/cue/cue/types.go:598 +0x3e
cuelang.org/go/cue.(*Context).make(0xc0002d6480, 0xc00280fe00)
        /home/tony/cue/cue/context.go:252 +0x79
cuelang.org/go/cue.(*Context).BuildInstances(0xc0002d6480, {0xc00261f7f0, 0x1, 0x1c0?})
        /home/tony/cue/cue/context.go:150 +0x1e5
cuelang.org/go/cmd/cue/cmd.buildInstances(0xc0002d0c00, {0xc00261f7f0, 0x1, 0xc00026fc08?}, 0x1)
        /home/tony/cue/cmd/cue/cmd/common.go:714 +0x46
cuelang.org/go/cmd/cue/cmd.parseArgs(0xc0002d0c00, {0xc0002cad00, 0x1, 0x1}, 0xc00026d770)
        /home/tony/cue/cmd/cue/cmd/common.go:593 +0xc1f
cuelang.org/go/cmd/cue/cmd.runEval(0xc0002d0c00, {0xc0002cad00, 0x1, 0x1})
        /home/tony/cue/cmd/cue/cmd/eval.go:88 +0x94
cuelang.org/go/cmd/cue/cmd.newEvalCmd.mkRunE.func1(0xc0002ce500?, {0xc0002cad00, 0x1, 0x1})
        /home/tony/cue/cmd/cue/cmd/root.go:132 +0x3ba
github.com/spf13/cobra.(*Command).execute(0xc00027cf08, {0xc0002cacc0, 0x1, 0x1})
        /home/tony/go/pkg/mod/github.com/spf13/[email protected]/command.go:985 +0xaaa
github.com/spf13/cobra.(*Command).ExecuteC(0xc00027c308)
        /home/tony/go/pkg/mod/github.com/spf13/[email protected]/command.go:1117 +0x3ff
github.com/spf13/cobra.(*Command).Execute(...)
        /home/tony/go/pkg/mod/github.com/spf13/[email protected]/command.go:1041
cuelang.org/go/cmd/cue/cmd.(*Command).Run(0xc0002d0c00, {0x18d1940?, 0xf080a0?})
        /home/tony/cue/cmd/cue/cmd/root.go:355 +0x1f
cuelang.org/go/cmd/cue/cmd.Main()
        /home/tony/cue/cmd/cue/cmd/root.go:263 +0x95
main.main()
        /home/tony/cue/cmd/cue/main.go:24 +0x13
@verdverm verdverm added NeedsInvestigation Triage Requires triage/attention labels Feb 12, 2025
@mvdan
Copy link
Member

mvdan commented Feb 13, 2025

Thanks - unfortunately we cannot investigate or resolve this issue without a reproducer. Can you share a reproducer privately in the form of a testscript, as described in https://github.com/cue-lang/cue/wiki/Creating-test-or-performance-reproducers? Otherwise, can you install Unity on your private repo so we can gain access to the code for debugging purposes?

@mvdan mvdan added panic NeedsInfo More information or clarification needed from the user and removed NeedsInvestigation Triage Requires triage/attention labels Feb 13, 2025
@mvdan mvdan changed the title Panic in v0.12.0 evalV3 "incDependent: already closed" panic on evalv3 Feb 13, 2025
@mvdan mvdan added the evalv3 issues affecting only the evaluator version 3 label Feb 13, 2025
@mvdan mvdan self-assigned this Feb 13, 2025
@verdverm
Copy link
Author

I think I can probably come up with a minimal reproducer, I've been able to comment out large parts of the config, so it seems it ought to be relatively small. (loads on current evaluator are like 10s)

@myitcv myitcv added tmp/eval and removed tmp/eval labels Feb 15, 2025
@mvdan
Copy link
Member

mvdan commented Feb 24, 2025

Thanks @verdverm for providing a reproducer privately. I was able to reduce it to the following:

# With the old evaluator.
env CUE_EXPERIMENT=evalv3=0
exec cue export input.cue

# With the new evaluator.
env CUE_EXPERIMENT=evalv3=1
env CUE_DEBUG=openinline=0
exec cue export input.cue

-- input.cue --
import "list"

out: #Foo & {
	sub: #Foo
}

#Foo: {
	sub: #Foo | #Bar
	meta: {
		strs: [...string]
		for _, w in list.FlattenN([strs], 1) {}
	}
}


#Bar: {
	kind: "bar"
	meta: strs: [...string]
}

As of df327a6:

# With the old evaluator. (0.010s)
> env CUE_EXPERIMENT=evalv3=0
> exec cue export input.cue
[stdout]
{
    "out": {
        "sub": {
            "sub": {
                "kind": "bar",
                "meta": {
                    "strs": []
                }
            },
            "meta": {
                "strs": []
            }
        },
        "meta": {
            "strs": []
        }
    }
}
# With the new evaluator. (0.052s)
> env CUE_EXPERIMENT=evalv3=1
> env CUE_DEBUG=openinline=0
> exec cue export input.cue
[stderr]
panic: incDependent: already closed: 0xc001e64c60 [recovered, reraised]

goroutine 1 gp=0xc000002380 m=7 mp=0xc000500008 [running]:
panic({0xf0fce0?, 0xc00107e590?})
	/home/mvdan/tip/src/runtime/panic.go:823 +0x168 fp=0xc001e515e0 sp=0xc001e51530 pc=0x47a6c8
cuelang.org/go/internal/core/adt.runTask.func1()
	/home/mvdan/src/c/cue/internal/core/adt/sched.go:695 +0x76 fp=0xc001e51608 sp=0xc001e515e0 pc=0x73b996
panic({0xf0fce0?, 0xc00107e590?})
	/home/mvdan/tip/src/runtime/panic.go:804 +0x132 fp=0xc001e516b8 sp=0xc001e51608 pc=0x47a692
cuelang.org/go/internal/core/adt.runTask.func1()
	/home/mvdan/src/c/cue/internal/core/adt/sched.go:695 +0x76 fp=0xc001e516e0 sp=0xc001e516b8 pc=0x73b996
panic({0xf0fce0?, 0xc00107e590?})
	/home/mvdan/tip/src/runtime/panic.go:804 +0x132 fp=0xc001e51790 sp=0xc001e516e0 pc=0x47a692
cuelang.org/go/internal/core/adt.runTask.func1()
	/home/mvdan/src/c/cue/internal/core/adt/sched.go:695 +0x76 fp=0xc001e517b8 sp=0xc001e51790 pc=0x73b996
panic({0xf0fce0?, 0xc00107e590?})
	/home/mvdan/tip/src/runtime/panic.go:804 +0x132 fp=0xc001e51868 sp=0xc001e517b8 pc=0x47a692
cuelang.org/go/internal/core/adt.runTask.func1()
	/home/mvdan/src/c/cue/internal/core/adt/sched.go:695 +0x76 fp=0xc001e51890 sp=0xc001e51868 pc=0x73b996
panic({0xf0fce0?, 0xc00107e590?})
	/home/mvdan/tip/src/runtime/panic.go:804 +0x132 fp=0xc001e51940 sp=0xc001e51890 pc=0x47a692
cuelang.org/go/internal/core/adt.(*closeContext).incDependent(0xc001e64c60, 0xc001db4b40, 0xc001822948?, 0x0?)
	/home/mvdan/src/c/cue/internal/core/adt/dep.go:247 +0xa5 fp=0xc001e51988 sp=0xc001e51940 pc=0x7093c5
cuelang.org/go/internal/core/adt.(*closeContext).getKeyedCC(0xc001e64b40, 0xc001db4b40, 0xc001e64c60, {0x0?, 0xee?, 0xda?, 0xc001e61080?}, 0x0, 0x1)
	/home/mvdan/src/c/cue/internal/core/adt/fields.go:460 +0x34b fp=0xc001e51a78 sp=0xc001e51988 pc=0x7318ab
cuelang.org/go/internal/core/adt.(*closeContext).assignConjunct(0x47e93c?, 0x3?, 0xc001e51c20?, {0x0, {0x126dec8, 0xc001822930}, {0x0, 0x0, 0x0, 0x0, ...}}, ...)
	/home/mvdan/src/c/cue/internal/core/adt/fields.go:484 +0x56 fp=0xc001e51b98 sp=0xc001e51a78 pc=0x731a76
[...]

@mvdan mvdan removed the NeedsInfo More information or clarification needed from the user label Feb 24, 2025
@mvdan mvdan removed their assignment Feb 24, 2025
@mpvl mpvl self-assigned this Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
evaluator evalv3 issues affecting only the evaluator version 3 panic
Projects
None yet
Development

No branches or pull requests

4 participants