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

Stack overflow during partial evaluation #3071

Closed
tfadeyi opened this issue Jan 18, 2021 · 0 comments · Fixed by #3691
Closed

Stack overflow during partial evaluation #3071

tfadeyi opened this issue Jan 18, 2021 · 0 comments · Fixed by #3691
Assignees

Comments

@tfadeyi
Copy link

tfadeyi commented Jan 18, 2021

We have recently been using partial evaluation in our application and ran into this issue in one of our rules which we think might be a bug. We use OPA in go, however it can be replicated using partial evaluation in the CLI's eval functionality.

Expected Behavior

When running opa eval -p -d rule.rego 'data.example.rule' with the following rego code:

package example
rule[message] {
	strings := {i | input[i]}
	strings & set() != strings
	message := sprintf("%v", [strings])
}

we expect a partial result to be evaluated.

Actual Behavior

Currently when running opa eval -p -d rule.rego 'data.example.rule', with code above, we get the following stack_overflow error:

runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0xc0202e0368 stack=[0xc0202e0000, 0xc0402e0000]
fatal error: stack overflow

runtime stack:
runtime.throw(0xdaac60, 0xe)
        /usr/local/go/src/runtime/panic.go:1116 +0x72
runtime.newstack()
        /usr/local/go/src/runtime/stack.go:1035 +0x6ce
runtime.morestack()
        /usr/local/go/src/runtime/asm_amd64.s:449 +0x8f

full logs attached to the bottom of the issue.

Meanwhile, if we changed the order between strings and strings & set() in the operation the rule was able to be partially evaluated.

rule_2[message] {
	strings := {i | input[i]}
	strings != strings & set()# <----
	message := sprintf("%v", [strings])
}

Steps to Reproduce the Problem

./issue
❯ tree -a .
.
└── rule.rego

The rule.rego file contains the following:

package example
rule[message] {
	strings := {i | input[i]}
	strings & set() != strings
	message := sprintf("%v", [strings])
}

Run partial evaluation.

cd ./issue
opa eval -p -d rule.rego 'data.example.rule'

Additional Info

Version: 0.25.2
Build Commit: 4c6e524
Build Timestamp: 2020-12-08T16:56:43Z
Build Hostname: 3bb58334a5a9
Go Version: go1.14.9
WebAssembly: unavailable

Full logs

runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0xc020360368 stack=[0xc020360000, 0xc040360000]
fatal error: stack overflow

runtime stack:
runtime.throw(0xdaac60, 0xe)
        /usr/local/go/src/runtime/panic.go:1116 +0x72
runtime.newstack()
        /usr/local/go/src/runtime/stack.go:1035 +0x6ce
runtime.morestack()
        /usr/local/go/src/runtime/asm_amd64.s:449 +0x8f

goroutine 1 [running]:
github.com/open-policy-agent/opa/topdown/copypropagation.bindingPlugTransform.plugBindingsVar(0xc0003169c0, 0xc0003169c0, 0xc000034438, 0x3, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/topdown/copypropagation/copypropagation.go:225 +0x19c fp=0xc020360378 sp=0xc020360370 pc=0x89dc5c
github.com/open-policy-agent/opa/topdown/copypropagation.bindingPlugTransform.Transform(0xc0003169c0, 0xd25c60, 0xc000435160, 0x0, 0x0, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/topdown/copypropagation/copypropagation.go:217 +0x91 fp=0xc0203603c8 sp=0xc020360378 pc=0x89d9a1
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd25c60, 0xc000435160, 0x7f33ff721108, 0x0, 0xc000435160, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:25 +0xfc fp=0xc020360598 sp=0xc0203603c8 pc=0x866a5c
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef2320, 0xc000435160, 0x1, 0xc000436320, 0x1, 0xc00000e6e0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020360618 sp=0xc020360598 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc000436240, 0xd6bc40, 0xc000436320, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020360678 sp=0xc020360618 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd6bc40, 0xc000436260, 0x18, 0xc7b9a0, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:185 +0x26f0 fp=0xc020360848 sp=0xc020360678 pc=0x869050
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef22a0, 0xc000436260, 0xc020360918, 0x40a7d3, 0xd48060, 0xd22ae0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc0203608c8 sp=0xc020360848 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc000436280, 0x0, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020360928 sp=0xc0203608c8 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd22ae0, 0xc000316940, 0xc0004362e0, 0xc000436201, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020360af8 sp=0xc020360928 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef21e0, 0xc000316940, 0xef22a0, 0xc0004362e0, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020360b78 sp=0xc020360af8 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc000316960, 0xc000436300, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020360bd8 sp=0xc020360b78 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd25c60, 0xc00030e890, 0xc000436260, 0xc000436201, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020360da8 sp=0xc020360bd8 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef2320, 0xc00030e890, 0xef22a0, 0xc000436260, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020360e28 sp=0xc020360da8 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc0003168e0, 0xc000436280, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020360e88 sp=0xc020360e28 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd22ae0, 0xc000316940, 0xc0004361e0, 0xc000436101, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020361058 sp=0xc020360e88 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef21e0, 0xc000316940, 0xef22a0, 0xc0004361e0, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc0203610d8 sp=0xc020361058 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc000316960, 0xc000436200, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020361138 sp=0xc0203610d8 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd25c60, 0xc00030e890, 0xc000436160, 0xc000436101, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020361308 sp=0xc020361138 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef2320, 0xc00030e890, 0xef22a0, 0xc000436160, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020361388 sp=0xc020361308 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc0003168e0, 0xc000436180, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc0203613e8 sp=0xc020361388 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd22ae0, 0xc000316940, 0xc0004360e0, 0xc000436001, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc0203615b8 sp=0xc0203613e8 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef21e0, 0xc000316940, 0xef22a0, 0xc0004360e0, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020361638 sp=0xc0203615b8 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc000316960, 0xc000436100, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020361698 sp=0xc020361638 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd25c60, 0xc00030e890, 0xc000436060, 0xc000436001, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020361868 sp=0xc020361698 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef2320, 0xc00030e890, 0xef22a0, 0xc000436060, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc0203618e8 sp=0xc020361868 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc0003168e0, 0xc000436080, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020361948 sp=0xc0203618e8 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd22ae0, 0xc000316940, 0xc000433fe0, 0xc000433f01, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020361b18 sp=0xc020361948 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef21e0, 0xc000316940, 0xef22a0, 0xc000433fe0, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020361b98 sp=0xc020361b18 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc000316960, 0xc000436000, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020361bf8 sp=0xc020361b98 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd25c60, 0xc00030e890, 0xc000433f60, 0xc000433f01, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020361dc8 sp=0xc020361bf8 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef2320, 0xc00030e890, 0xef22a0, 0xc000433f60, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020361e48 sp=0xc020361dc8 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc0003168e0, 0xc000433f80, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020361ea8 sp=0xc020361e48 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd22ae0, 0xc000316940, 0xc000433ee0, 0xc000433e01, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020362078 sp=0xc020361ea8 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef21e0, 0xc000316940, 0xef22a0, 0xc000433ee0, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc0203620f8 sp=0xc020362078 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc000316960, 0xc000433f00, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020362158 sp=0xc0203620f8 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd25c60, 0xc00030e890, 0xc000433e60, 0xc000433e01, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020362328 sp=0xc020362158 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef2320, 0xc00030e890, 0xef22a0, 0xc000433e60, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc0203623a8 sp=0xc020362328 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc0003168e0, 0xc000433e80, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020362408 sp=0xc0203623a8 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd22ae0, 0xc000316940, 0xc000433de0, 0xc000433d01, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc0203625d8 sp=0xc020362408 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef21e0, 0xc000316940, 0xef22a0, 0xc000433de0, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020362658 sp=0xc0203625d8 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc000316960, 0xc000433e00, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc0203626b8 sp=0xc020362658 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd25c60, 0xc00030e890, 0xc000433d60, 0xc000433d01, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020362888 sp=0xc0203626b8 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef2320, 0xc00030e890, 0xef22a0, 0xc000433d60, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020362908 sp=0xc020362888 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc0003168e0, 0xc000433d80, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020362968 sp=0xc020362908 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd22ae0, 0xc000316940, 0xc000433ce0, 0xc000433c01, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020362b38 sp=0xc020362968 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef21e0, 0xc000316940, 0xef22a0, 0xc000433ce0, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020362bb8 sp=0xc020362b38 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc000316960, 0xc000433d00, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020362c18 sp=0xc020362bb8 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd25c60, 0xc00030e890, 0xc000433c60, 0xc000433c01, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020362de8 sp=0xc020362c18 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef2320, 0xc00030e890, 0xef22a0, 0xc000433c60, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020362e68 sp=0xc020362de8 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc0003168e0, 0xc000433c80, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020362ec8 sp=0xc020362e68 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd22ae0, 0xc000316940, 0xc000433be0, 0xc000433b01, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020363098 sp=0xc020362ec8 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef21e0, 0xc000316940, 0xef22a0, 0xc000433be0, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020363118 sp=0xc020363098 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc000316960, 0xc000433c00, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020363178 sp=0xc020363118 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd25c60, 0xc00030e890, 0xc000433b60, 0xc000433b01, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020363348 sp=0xc020363178 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef2320, 0xc00030e890, 0xef22a0, 0xc000433b60, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc0203633c8 sp=0xc020363348 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc0003168e0, 0xc000433b80, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020363428 sp=0xc0203633c8 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd22ae0, 0xc000316940, 0xc000433ae0, 0xc000433a01, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc0203635f8 sp=0xc020363428 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef21e0, 0xc000316940, 0xef22a0, 0xc000433ae0, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020363678 sp=0xc0203635f8 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc000316960, 0xc000433b00, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc0203636d8 sp=0xc020363678 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd25c60, 0xc00030e890, 0xc000433a60, 0xc000433a01, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc0203638a8 sp=0xc0203636d8 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef2320, 0xc00030e890, 0xef22a0, 0xc000433a60, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020363928 sp=0xc0203638a8 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc0003168e0, 0xc000433a80, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020363988 sp=0xc020363928 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd22ae0, 0xc000316940, 0xc0004339e0, 0xc000433901, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020363b58 sp=0xc020363988 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef21e0, 0xc000316940, 0xef22a0, 0xc0004339e0, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020363bd8 sp=0xc020363b58 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc000316960, 0xc000433a00, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020363c38 sp=0xc020363bd8 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd25c60, 0xc00030e890, 0xc000433960, 0xc000433901, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020363e08 sp=0xc020363c38 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef2320, 0xc00030e890, 0xef22a0, 0xc000433960, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020363e88 sp=0xc020363e08 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc0003168e0, 0xc000433980, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020363ee8 sp=0xc020363e88 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd22ae0, 0xc000316940, 0xc0004338e0, 0xc000433801, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc0203640b8 sp=0xc020363ee8 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef21e0, 0xc000316940, 0xef22a0, 0xc0004338e0, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020364138 sp=0xc0203640b8 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc000316960, 0xc000433900, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020364198 sp=0xc020364138 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd25c60, 0xc00030e890, 0xc000433860, 0xc000433801, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020364368 sp=0xc020364198 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef2320, 0xc00030e890, 0xef22a0, 0xc000433860, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc0203643e8 sp=0xc020364368 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc0003168e0, 0xc000433880, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020364448 sp=0xc0203643e8 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd22ae0, 0xc000316940, 0xc0004337e0, 0xc000433701, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020364618 sp=0xc020364448 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef21e0, 0xc000316940, 0xef22a0, 0xc0004337e0, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020364698 sp=0xc020364618 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc000316960, 0xc000433800, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc0203646f8 sp=0xc020364698 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd25c60, 0xc00030e890, 0xc000433760, 0xc000433701, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc0203648c8 sp=0xc0203646f8 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef2320, 0xc00030e890, 0xef22a0, 0xc000433760, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020364948 sp=0xc0203648c8 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc0003168e0, 0xc000433780, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc0203649a8 sp=0xc020364948 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd22ae0, 0xc000316940, 0xc0004336e0, 0xc000433601, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020364b78 sp=0xc0203649a8 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef21e0, 0xc000316940, 0xef22a0, 0xc0004336e0, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020364bf8 sp=0xc020364b78 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc000316960, 0xc000433700, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020364c58 sp=0xc020364bf8 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd25c60, 0xc00030e890, 0xc000433660, 0xc000433601, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020364e28 sp=0xc020364c58 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef2320, 0xc00030e890, 0xef22a0, 0xc000433660, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020364ea8 sp=0xc020364e28 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc0003168e0, 0xc000433680, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020364f08 sp=0xc020364ea8 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd22ae0, 0xc000316940, 0xc0004335e0, 0xc000433501, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc0203650d8 sp=0xc020364f08 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef21e0, 0xc000316940, 0xef22a0, 0xc0004335e0, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020365158 sp=0xc0203650d8 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc000316960, 0xc000433600, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc0203651b8 sp=0xc020365158 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd25c60, 0xc00030e890, 0xc000433560, 0xc000433501, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020365388 sp=0xc0203651b8 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef2320, 0xc00030e890, 0xef22a0, 0xc000433560, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020365408 sp=0xc020365388 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc0003168e0, 0xc000433580, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020365468 sp=0xc020365408 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd22ae0, 0xc000316940, 0xc0004334e0, 0xc000433401, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020365638 sp=0xc020365468 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef21e0, 0xc000316940, 0xef22a0, 0xc0004334e0, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc0203656b8 sp=0xc020365638 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc000316960, 0xc000433500, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc020365718 sp=0xc0203656b8 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd25c60, 0xc00030e890, 0xc000433460, 0xc000433401, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc0203658e8 sp=0xc020365718 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef2320, 0xc00030e890, 0xef22a0, 0xc000433460, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020365968 sp=0xc0203658e8 pc=0x869fa6
github.com/open-policy-agent/opa/ast.transformTerm(0xedd360, 0xc0003169c0, 0xc0003168e0, 0xc000433480, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:364 +0x4f fp=0xc0203659c8 sp=0xc020365968 pc=0x869e5f
github.com/open-policy-agent/opa/ast.Transform(0xedd360, 0xc0003169c0, 0xd22ae0, 0xc000316940, 0xc0004333e0, 0xc000433301, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:248 +0x848 fp=0xc020365b98 sp=0xc0203659c8 pc=0x8671a8
github.com/open-policy-agent/opa/ast.transformValue(0xedd360, 0xc0003169c0, 0xef21e0, 0xc000316940, 0xef22a0, 0xc0004333e0, 0x0, 0x0)
        /go/src/github.com/open-policy-agent/opa/ast/transform.go:376 +0x66 fp=0xc020365c18 sp=0xc020365b98 pc=0x869fa6
...additional frames elided...

goroutine 6 [select]:
github.com/open-policy-agent/opa/rego.waitForDone(0xeef120, 0xc0000b4010, 0xc000036180, 0xc00030cf00)
        /go/src/github.com/open-policy-agent/opa/rego/rego.go:2164 +0xb7
created by github.com/open-policy-agent/opa/rego.(*Rego).partial
        /go/src/github.com/open-policy-agent/opa/rego/rego.go:1974 +0x61d
@tsandall tsandall added the bug label Jul 22, 2021
@srenatus srenatus self-assigned this Jul 26, 2021
srenatus added a commit to srenatus/opa that referenced this issue Jul 30, 2021
…tured

updateBindings before checked if the last operand was a variable, and attempted to
replace it if it was. With `neq(s & set(), s)`, the last operand was a variable,
but not the output variable -- the output wasn't captured.

So now, we use the arity of the called function to determine if we can replace a
call.

Fixes open-policy-agent#3071.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
tsandall pushed a commit that referenced this issue Aug 12, 2021
…tured

updateBindings before checked if the last operand was a variable, and attempted to
replace it if it was. With `neq(s & set(), s)`, the last operand was a variable,
but not the output variable -- the output wasn't captured.

So now, we use the arity of the called function to determine if we can replace a
call.

Fixes #3071.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
jgchn pushed a commit to jgchn/opa that referenced this issue Aug 20, 2021
…tured

updateBindings before checked if the last operand was a variable, and attempted to
replace it if it was. With `neq(s & set(), s)`, the last operand was a variable,
but not the output variable -- the output wasn't captured.

So now, we use the arity of the called function to determine if we can replace a
call.

Fixes open-policy-agent#3071.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
dolevf pushed a commit to dolevf/opa that referenced this issue Nov 4, 2021
…tured

updateBindings before checked if the last operand was a variable, and attempted to
replace it if it was. With `neq(s & set(), s)`, the last operand was a variable,
but not the output variable -- the output wasn't captured.

So now, we use the arity of the called function to determine if we can replace a
call.

Fixes open-policy-agent#3071.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
Signed-off-by: Dolev Farhi <farhi.dolev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants