open-policy-agent / opa

Open Policy Agent (OPA) is an open source, general-purpose policy engine.
https://www.openpolicyagent.org
Apache License 2.0
9.68k stars 1.34k forks source link

Crash for partial evaluation because of infinite recursion #6428

Open nkey0 opened 11 months ago

nkey0 commented 11 months ago
./opa run --server --log-level debug  policy.rego 
{"current_version":"0.58.0","level":"debug","msg":"OPA is up to date.","time":"2023-11-03T10:32:03+01:00"}

This is basic policy:

package test

import future.keywords.contains
import future.keywords.every
import future.keywords.if
import future.keywords.in

default allow := false

allow if {
    bt = {tag | tag := input.book.tags[_]}
    ut = {tag | tag := input.user.tags[_]}
    bt & ut == bt
}

and query:

curl -d '{"query":"data.test.allow == true","input":{"user":{"tags":["1","3","3"]},"book":{"tags":["1","3"]}},"unknowns":["input.book"]}' localhost:8181/v1/compile?pretty=true
curl: (52) Empty reply from server
Click me for crash stacktrace ```bash ./opa run --server --log-level debug test.rego {"addrs":[":8181"],"diagnostic-addrs":[],"level":"info","msg":"Initializing server. OPA is running on a public (0.0.0.0) network interface. Unless you intend to expose OPA outside of the host, binding to the localhost interface (--addr localhost:8181) is recommended. See https://www.openpolicyagent.org/docs/latest/security/#interface-binding","time":"2023-11-23T13:08:18+01:00"} {"level":"debug","msg":"maxprocs: Leaving GOMAXPROCS=20: CPU quota undefined","time":"2023-11-23T13:08:18+01:00"} {"level":"debug","msg":"Server initialized.","time":"2023-11-23T13:08:18+01:00"} {"headers":{"Content-Type":["application/json"],"User-Agent":["Open Policy Agent/0.58.0 (linux, amd64)"]},"level":"debug","method":"POST","msg":"Sending request.","time":"2023-11-23T13:08:18+01:00","url":"https://telemetry.openpolicyagent.org/v1/version"} {"headers":{"Content-Length":["216"],"Content-Type":["application/json"],"Date":["Thu, 23 Nov 2023 12:08:19 GMT"]},"level":"debug","method":"POST","msg":"Received response.","status":"200 OK","time":"2023-11-23T13:08:19+01:00","url":"https://telemetry.openpolicyagent.org/v1/version"} {"current_version":"0.58.0","level":"debug","msg":"OPA is up to date.","time":"2023-11-23T13:08:19+01:00"} {"client_addr":"127.0.0.1:50862","level":"info","msg":"Received request.","req_body":"{\"query\":\"data.test.allow == true\",\"input\":{\"user\":{\"tags\":[\"1\",\"3\",\"3\"]},\"book\":{\"tags\":[\"1\",\"3\"]}},\"unknowns\":[\"input.book\"]}","req_id":1,"req_method":"POST","req_params":{"pretty":["true"]},"req_path":"/v1/compile","time":"2023-11-23T13:09:30+01:00"} runtime: goroutine stack exceeds 1000000000-byte limit runtime: sp=0xc020682390 stack=[0xc020682000, 0xc040682000] fatal error: stack overflow runtime stack: runtime.throw({0x1c1cb5e?, 0x20?}) /usr/local/go/src/runtime/panic.go:1077 +0x5c fp=0x7fe8b97f9720 sp=0x7fe8b97f96f0 pc=0x48d07c runtime.newstack() /usr/local/go/src/runtime/stack.go:1107 +0x5ac fp=0x7fe8b97f98d0 sp=0x7fe8b97f9720 pc=0x4a78ec traceback: unexpected SPWRITE function runtime.morestack runtime.morestack() /usr/local/go/src/runtime/asm_amd64.s:593 +0x8f fp=0x7fe8b97f98d8 sp=0x7fe8b97f98d0 pc=0x4c180f goroutine 16 [running]: github.com/open-policy-agent/opa/ast.sortOrder({0x1b64960?, 0xc008fab400}) /src/ast/compare.go:249 +0x54d fp=0xc0206823a0 sp=0xc020682398 pc=0x8817ed github.com/open-policy-agent/opa/ast.Compare({0x1b64960?, 0xc008fab400?}, {0x1b64960?, 0xc008fab3f0?}) /src/ast/compare.go:67 +0xfa fp=0xc0206825f8 sp=0xc0206823a0 pc=0x87fe5a github.com/open-policy-agent/opa/ast.Var.Compare(...) /src/ast/term.go:836 github.com/open-policy-agent/opa/ast.(*Var).Compare(0xc020682658?, {0x20e3800?, 0xc008fab3f0}) :1 +0x6f fp=0xc020682630 sp=0xc0206825f8 pc=0x92222f github.com/open-policy-agent/opa/ast.valueEq({0x1b64960?, 0xc0000575f0}, {0x1b64960?, 0xc008fab3f0}) /src/ast/map.go:132 +0x6a fp=0xc020682668 sp=0xc020682630 pc=0x8c2eaa github.com/open-policy-agent/opa/util.(*HashMap).Get(0xc00030ce20, {0x1b64960, 0xc008fab3f0}) /src/util/hashmap.go:68 +0x83 fp=0xc0206826a0 sp=0xc020682668 pc=0x7e14c3 github.com/open-policy-agent/opa/ast.(*ValueMap).Get(...) /src/ast/map.go:74 github.com/open-policy-agent/opa/topdown/copypropagation.(*unionFind).Find(0xc000119b30, {0x20e3800?, 0xc008fab3f0}) /src/topdown/copypropagation/unionfind.go:49 +0x48 fp=0xc0206826e8 sp=0xc0206826a0 pc=0x93aa48 github.com/open-policy-agent/opa/topdown/copypropagation.bindingPlugTransform.plugBindingsVar({0xc020682780?}, 0xc00030cf20, {0xc0002c6556, 0x3}) /src/topdown/copypropagation/copypropagation.go:252 +0x6a fp=0xc020682758 sp=0xc0206826e8 pc=0x938c0a github.com/open-policy-agent/opa/topdown/copypropagation.bindingPlugTransform.Transform({0xc00059c598?}, {0x1b64960?, 0xc0000575f0?}) /src/topdown/copypropagation/copypropagation.go:239 +0x4b fp=0xc020682790 sp=0xc020682758 pc=0x938b0b github.com/open-policy-agent/opa/ast.Transform({0x20d9500?, 0xc00030cf20}, {0x1b64960?, 0xc0000575f0?}) /src/ast/transform.go:27 +0xad fp=0xc020682918 sp=0xc020682790 pc=0x8f648d github.com/open-policy-agent/opa/ast.transformValue({0x20d9500?, 0xc00030cf20?}, {0x20e3800?, 0xc0000575f0}) /src/ast/transform.go:398 +0x4f fp=0xc020682988 sp=0xc020682918 pc=0x8f8eaf github.com/open-policy-agent/opa/ast.transformTerm({0x20d9500?, 0xc00030cf20?}, 0xc000688f30) /src/ast/transform.go:386 +0x30 fp=0xc0206829c8 sp=0xc020682988 pc=0x8f8db0 github.com/open-policy-agent/opa/ast.Transform({0x20d9500?, 0xc00030cf20}, {0x1b64960?, 0xc0000575f0?}) /src/ast/transform.go:282 +0x14ea fp=0xc020682b50 sp=0xc0206829c8 pc=0x8f78ca github.com/open-policy-agent/opa/ast.transformValue({0x20d9500?, 0xc00030cf20?}, {0x20e3800?, 0xc0000575f0}) /src/ast/transform.go:398 +0x4f fp=0xc020682bc0 sp=0xc020682b50 pc=0x8f8eaf github.com/open-policy-agent/opa/ast.transformTerm({0x20d9500?, 0xc00030cf20?}, 0xc000688f30) /src/ast/transform.go:386 +0x30 fp=0xc020682c00 sp=0xc020682bc0 pc=0x8f8db0 github.com/open-policy-agent/opa/ast.Transform({0x20d9500?, 0xc00030cf20}, {0x1b64960?, 0xc0000575f0?}) /src/ast/transform.go:282 +0x14ea fp=0xc020682d88 sp=0xc020682c00 pc=0x8f78ca github.com/open-policy-agent/opa/ast.transformValue({0x20d9500?, 0xc00030cf20?}, {0x20e3800?, 0xc0000575f0}) /src/ast/transform.go:398 +0x4f fp=0xc020682df8 sp=0xc020682d88 pc=0x8f8eaf github.com/open-policy-agent/opa/ast.transformTerm({0x20d9500?, 0xc00030cf20?}, 0xc000688f30) /src/ast/transform.go:386 +0x30 fp=0xc020682e38 sp=0xc020682df8 pc=0x8f8db0 github.com/open-policy-agent/opa/ast.Transform({0x20d9500?, 0xc00030cf20}, {0x1b64960?, 0xc0000575f0?}) /src/ast/transform.go:282 +0x14ea fp=0xc020682fc0 sp=0xc020682e38 pc=0x8f78ca github.com/open-policy-agent/opa/ast.transformValue({0x20d9500?, 0xc00030cf20?}, {0x20e3800?, 0xc0000575f0}) /src/ast/transform.go:398 +0x4f fp=0xc020683030 sp=0xc020682fc0 pc=0x8f8eaf github.com/open-policy-agent/opa/ast.transformTerm({0x20d9500?, 0xc00030cf20?}, 0xc000688f30) /src/ast/transform.go:386 +0x30 fp=0xc020683070 sp=0xc020683030 pc=0x8f8db0 github.com/open-policy-agent/opa/ast.Transform({0x20d9500?, 0xc00030cf20}, {0x1b64960?, 0xc0000575f0?}) /src/ast/transform.go:282 +0x14ea fp=0xc0206831f8 sp=0xc020683070 pc=0x8f78ca github.com/open-policy-agent/opa/ast.transformValue({0x20d9500?, 0xc00030cf20?}, {0x20e3800?, 0xc0000575f0}) /src/ast/transform.go:398 +0x4f fp=0xc020683268 sp=0xc0206831f8 pc=0x8f8eaf github.com/open-policy-agent/opa/ast.transformTerm({0x20d9500?, 0xc00030cf20?}, 0xc000688f30) /src/ast/transform.go:386 +0x30 fp=0xc0206832a8 sp=0xc020683268 pc=0x8f8db0 github.com/open-policy-agent/opa/ast.Transform({0x20d9500?, 0xc00030cf20}, {0x1b64960?, 0xc0000575f0?}) /src/ast/transform.go:282 +0x14ea fp=0xc020683430 sp=0xc0206832a8 pc=0x8f78ca github.com/open-policy-agent/opa/ast.transformValue({0x20d9500?, 0xc00030cf20?}, {0x20e3800?, 0xc0000575f0}) /src/ast/transform.go:398 +0x4f fp=0xc0206834a0 sp=0xc020683430 pc=0x8f8eaf github.com/open-policy-agent/opa/ast.transformTerm({0x20d9500?, 0xc00030cf20?}, 0xc000688f30) /src/ast/transform.go:386 +0x30 fp=0xc0206834e0 sp=0xc0206834a0 pc=0x8f8db0 github.com/open-policy-agent/opa/ast.Transform({0x20d9500?, 0xc00030cf20}, {0x1b64960?, 0xc0000575f0?}) /src/ast/transform.go:282 +0x14ea fp=0xc020683668 sp=0xc0206834e0 pc=0x8f78ca github.com/open-policy-agent/opa/ast.transformValue({0x20d9500?, 0xc00030cf20?}, {0x20e3800?, 0xc0000575f0}) /src/ast/transform.go:398 +0x4f fp=0xc0206836d8 sp=0xc020683668 pc=0x8f8eaf github.com/open-policy-agent/opa/ast.transformTerm({0x20d9500?, 0xc00030cf20?}, 0xc000688f30) /src/ast/transform.go:386 +0x30 fp=0xc020683718 sp=0xc0206836d8 pc=0x8f8db0 github.com/open-policy-agent/opa/ast.Transform({0x20d9500?, 0xc00030cf20}, {0x1b64960?, 0xc0000575f0?}) /src/ast/transform.go:282 +0x14ea fp=0xc0206838a0 sp=0xc020683718 pc=0x8f78ca github.com/open-policy-agent/opa/ast.transformValue({0x20d9500?, 0xc00030cf20?}, {0x20e3800?, 0xc0000575f0}) /src/ast/transform.go:398 +0x4f fp=0xc020683910 sp=0xc0206838a0 pc=0x8f8eaf github.com/open-policy-agent/opa/ast.transformTerm({0x20d9500?, 0xc00030cf20?}, 0xc000688f30) /src/ast/transform.go:386 +0x30 fp=0xc020683950 sp=0xc020683910 pc=0x8f8db0 github.com/open-policy-agent/opa/ast.Transform({0x20d9500?, 0xc00030cf20}, {0x1b64960?, 0xc0000575f0?}) /src/ast/transform.go:282 +0x14ea fp=0xc020683ad8 sp=0xc020683950 pc=0x8f78ca github.com/open-policy-agent/opa/ast.transformValue({0x20d9500?, 0xc00030cf20?}, {0x20e3800?, 0xc0000575f0}) /src/ast/transform.go:398 +0x4f fp=0xc020683b48 sp=0xc020683ad8 pc=0x8f8eaf github.com/open-policy-agent/opa/ast.transformTerm({0x20d9500?, 0xc00030cf20?}, 0xc000688f30) /src/ast/transform.go:386 +0x30 fp=0xc020683b88 sp=0xc020683b48 pc=0x8f8db0 github.com/open-policy-agent/opa/ast.Transform({0x20d9500?, 0xc00030cf20}, {0x1b64960?, 0xc0000575f0?}) /src/ast/transform.go:282 +0x14ea fp=0xc020683d10 sp=0xc020683b88 pc=0x8f78ca github.com/open-policy-agent/opa/ast.transformValue({0x20d9500?, 0xc00030cf20?}, {0x20e3800?, 0xc0000575f0}) /src/ast/transform.go:398 +0x4f fp=0xc020683d80 sp=0xc020683d10 pc=0x8f8eaf github.com/open-policy-agent/opa/ast.transformTerm({0x20d9500?, 0xc00030cf20?}, 0xc000688f30) /src/ast/transform.go:386 +0x30 fp=0xc020683dc0 sp=0xc020683d80 pc=0x8f8db0 github.com/open-policy-agent/opa/ast.Transform({0x20d9500?, 0xc00030cf20}, {0x1b64960?, 0xc0000575f0?}) /src/ast/transform.go:282 +0x14ea fp=0xc020683f48 sp=0xc020683dc0 pc=0x8f78ca github.com/open-policy-agent/opa/ast.transformValue({0x20d9500?, 0xc00030cf20?}, {0x20e3800?, 0xc0000575f0}) /src/ast/transform.go:398 +0x4f fp=0xc020683fb8 sp=0xc020683f48 pc=0x8f8eaf github.com/open-policy-agent/opa/ast.transformTerm({0x20d9500?, 0xc00030cf20?}, 0xc000688f30) /src/ast/transform.go:386 +0x30 fp=0xc020683ff8 sp=0xc020683fb8 pc=0x8f8db0 github.com/open-policy-agent/opa/ast.Transform({0x20d9500?, 0xc00030cf20}, {0x1b64960?, 0xc0000575f0?}) /src/ast/transform.go:282 +0x14ea fp=0xc020684180 sp=0xc020683ff8 pc=0x8f78ca github.com/open-policy-agent/opa/ast.transformValue({0x20d9500?, 0xc00030cf20?}, {0x20e3800?, 0xc0000575f0}) /src/ast/transform.go:398 +0x4f fp=0xc0206841f0 sp=0xc020684180 pc=0x8f8eaf github.com/open-policy-agent/opa/ast.transformTerm({0x20d9500?, 0xc00030cf20?}, 0xc000688f30) /src/ast/transform.go:386 +0x30 fp=0xc020684230 sp=0xc0206841f0 pc=0x8f8db0 github.com/open-policy-agent/opa/ast.Transform({0x20d9500?, 0xc00030cf20}, {0x1b64960?, 0xc0000575f0?}) /src/ast/transform.go:282 +0x14ea fp=0xc0206843b8 sp=0xc020684230 pc=0x8f78ca github.com/open-policy-agent/opa/ast.transformValue({0x20d9500?, 0xc00030cf20?}, {0x20e3800?, 0xc0000575f0}) /src/ast/transform.go:398 +0x4f fp=0xc020684428 sp=0xc0206843b8 pc=0x8f8eaf github.com/open-policy-agent/opa/ast.transformTerm({0x20d9500?, 0xc00030cf20?}, 0xc000688f30) /src/ast/transform.go:386 +0x30 fp=0xc020684468 sp=0xc020684428 pc=0x8f8db0 github.com/open-policy-agent/opa/ast.Transform({0x20d9500?, 0xc00030cf20}, {0x1b64960?, 0xc0000575f0?}) /src/ast/transform.go:282 +0x14ea fp=0xc0206845f0 sp=0xc020684468 pc=0x8f78ca ...2835486 frames elided... github.com/open-policy-agent/opa/topdown.(*eval).biunify(0xc00021b400, 0x1c1104c?, 0xc0002e9950?, 0x1baefe0?, 0xc000615170?, 0xc0002e9968?) /src/topdown/eval.go:855 +0x16a fp=0xc04067f888 sp=0xc04067f7d8 pc=0x9cd8ea github.com/open-policy-agent/opa/topdown.(*eval).unify(...) /src/topdown/eval.go:844 github.com/open-policy-agent/opa/topdown.(*eval).evalStep(0xc00021b400, 0xc0005238b0) /src/topdown/eval.go:362 +0x5f0 fp=0xc04067fa08 sp=0xc04067f888 pc=0x9c8c50 github.com/open-policy-agent/opa/topdown.(*eval).evalExpr(0xc00021b400, 0xc000598300) /src/topdown/eval.go:343 +0xde fp=0xc04067fa68 sp=0xc04067fa08 pc=0x9c845e github.com/open-policy-agent/opa/topdown.(*eval).next(...) /src/topdown/eval.go:169 github.com/open-policy-agent/opa/topdown.(*eval).evalExpr.func1(0xc00021b400) /src/topdown/eval.go:344 +0x25 fp=0xc04067fa88 sp=0xc04067fa68 pc=0x9c8625 github.com/open-policy-agent/opa/topdown.(*eval).evalStep.func1() /src/topdown/eval.go:364 +0x30 fp=0xc04067faf8 sp=0xc04067fa88 pc=0x9c92b0 github.com/open-policy-agent/opa/topdown.(*eval).saveUnify(0xc00021b400, 0xc000247b30, 0xc000615170, 0xc0006150e0, 0xc0006150e0, 0xc000615110) /src/topdown/eval.go:1361 +0x343 fp=0xc04067fb98 sp=0xc04067faf8 pc=0x9d2003 github.com/open-policy-agent/opa/topdown.(*eval).biunifyComprehensionPartial(0xc00021b400?, 0x1baefe0?, 0xc000247b30, 0xc000247d10?, 0xc0006150e0?, 0x1, 0xa096ad?) /src/topdown/eval.go:1225 +0xd1 fp=0xc04067fc00 sp=0xc04067fb98 pc=0x9d06b1 github.com/open-policy-agent/opa/topdown.(*eval).biunifyComprehension(0xc00021b400, 0xc000247d10, 0xc0000b5740?, 0x884ce0?, 0xc00030c320?, 0x8?, 0xc?) /src/topdown/eval.go:1080 +0x228 fp=0xc04067fc78 sp=0xc04067fc00 pc=0x9cf148 github.com/open-policy-agent/opa/topdown.(*eval).biunifyValues(0xc00021b400, 0xc000247b30, 0xc000247d10, 0xc0006150e0, 0xc0006150e0, 0xc000615110) /src/topdown/eval.go:982 +0x2e5 fp=0xc04067fd00 sp=0xc04067fc78 pc=0x9ce785 github.com/open-policy-agent/opa/topdown.(*eval).biunify(0xc00021b400, 0x1c1104c?, 0x1?, 0x10000c000580400?, 0x3?, 0xc0002e9e90?) /src/topdown/eval.go:855 +0x16a fp=0xc04067fdb0 sp=0xc04067fd00 pc=0x9cd8ea github.com/open-policy-agent/opa/topdown.(*eval).unify(...) /src/topdown/eval.go:844 github.com/open-policy-agent/opa/topdown.(*eval).evalStep(0xc00021b400, 0xc000523770) /src/topdown/eval.go:362 +0x5f0 fp=0xc04067ff30 sp=0xc04067fdb0 pc=0x9c8c50 github.com/open-policy-agent/opa/topdown.(*eval).evalExpr(0xc00021b400, 0xc000598300) /src/topdown/eval.go:343 +0xde fp=0xc04067ff90 sp=0xc04067ff30 pc=0x9c845e github.com/open-policy-agent/opa/topdown.(*eval).eval(...) /src/topdown/eval.go:306 github.com/open-policy-agent/opa/topdown.evalVirtualComplete.partialEval({0xc00021b200, {0xc00030c320, 0x3, 0x4}, {0xc000118dc8, 0x3, 0x3}, 0x2, 0xc0000bef00, 0xc000614bd0, ...}, ...) /src/topdown/eval.go:3041 +0x32f fp=0xc040680048 sp=0xc04067ff90 pc=0x9dff0f github.com/open-policy-agent/opa/topdown.evalVirtualComplete.eval({0xc00021b200, {0xc00030c320, 0x3, 0x4}, {0xc000118dc8, 0x3, 0x3}, 0x2, 0xc0000bef00, 0xc000614bd0, ...}, ...) /src/topdown/eval.go:2948 +0x1dd fp=0xc0406800d8 sp=0xc040680048 pc=0x9df0dd github.com/open-policy-agent/opa/topdown.evalVirtual.eval({0xc00021b200, {0xc00030c320, 0x3, 0x4}, {0xc000118dc8, 0x3, 0x3}, 0x2, 0xc000614bd0, 0xc000614690, ...}, ...) /src/topdown/eval.go:2315 +0x3c5 fp=0xc0406802c8 sp=0xc0406800d8 pc=0x9d9da5 github.com/open-policy-agent/opa/topdown.evalTree.next({0xc00021b200, {0xc00030c320, 0x3, 0x4}, {0xc000118dc8, 0x3, 0x3}, 0x2, 0xc000614bd0, 0xc000614690, ...}, ...) /src/topdown/eval.go:2112 +0x2c5 fp=0xc040680410 sp=0xc0406802c8 pc=0x9d82c5 github.com/open-policy-agent/opa/topdown.evalTree.eval({0xc00021b200, {0xc00030c320, 0x3, 0x4}, {0xc000118dc8, 0x3, 0x3}, 0x2, 0xc000614bd0, 0xc000614690, ...}, ...) /src/topdown/eval.go:2065 +0xa5 fp=0xc0406804a0 sp=0xc040680410 pc=0x9d7de5 github.com/open-policy-agent/opa/topdown.evalTree.next({0xc00021b200, {0xc00030c320, 0x3, 0x4}, {0xc000118dc8, 0x3, 0x3}, 0x1, 0xc000614bd0, 0xc000614690, ...}, ...) /src/topdown/eval.go:2118 +0x305 fp=0xc0406805e8 sp=0xc0406804a0 pc=0x9d8305 github.com/open-policy-agent/opa/topdown.evalTree.eval({0xc00021b200, {0xc00030c320, 0x3, 0x4}, {0xc000118dc8, 0x3, 0x3}, 0x1, 0xc000614bd0, 0xc000614690, ...}, ...) /src/topdown/eval.go:2065 +0xa5 fp=0xc040680678 sp=0xc0406805e8 pc=0x9d7de5 github.com/open-policy-agent/opa/topdown.(*eval).biunifyRef(0xc00021b200, 0x20e3900?, 0xc000614690, 0xc000614bd0, 0xc000614bd0, 0x10?) /src/topdown/eval.go:1043 +0x40b fp=0xc0406807e8 sp=0xc040680678 pc=0x9ceeab github.com/open-policy-agent/opa/topdown.(*eval).biunifyValues(0xc00021b200, 0xc000614660, 0xc000614690, 0xc000614bd0, 0xc000614bd0, 0xc000614e40) /src/topdown/eval.go:959 +0x108 fp=0xc040680870 sp=0xc0406807e8 pc=0x9ce5a8 github.com/open-policy-agent/opa/topdown.(*eval).biunify(0xc00021b200, 0x1c1104c?, 0x0?, 0x3?, 0x5?, 0xc0002eaa00?) /src/topdown/eval.go:855 +0x16a fp=0xc040680920 sp=0xc040680870 pc=0x9cd8ea github.com/open-policy-agent/opa/topdown.(*eval).unify(...) /src/topdown/eval.go:844 github.com/open-policy-agent/opa/topdown.(*eval).evalStep(0xc00021b200, 0xc0005236b0) /src/topdown/eval.go:362 +0x5f0 fp=0xc040680aa0 sp=0xc040680920 pc=0x9c8c50 github.com/open-policy-agent/opa/topdown.(*eval).evalExpr(0xc00021b200, 0xc0005236a0) /src/topdown/eval.go:343 +0xde fp=0xc040680b00 sp=0xc040680aa0 pc=0x9c845e github.com/open-policy-agent/opa/topdown.(*eval).eval(...) /src/topdown/eval.go:306 github.com/open-policy-agent/opa/topdown.(*eval).Run(0xc00021b200, 0xc00030c6c0) /src/topdown/eval.go:107 +0xa5 fp=0xc040680b50 sp=0xc040680b00 pc=0x9c77a5 github.com/open-policy-agent/opa/topdown.(*Query).PartialRun(0xc0003c71e0, {0x20e2790?, 0xc0002aa6f0}) /src/topdown/query.go:389 +0x1365 fp=0xc040680e80 sp=0xc040680b50 pc=0xa00ac5 github.com/open-policy-agent/opa/rego.(*Rego).partial(0xc000287180, {0x20e2790?, 0xc0002aa6f0}, 0xc0002a8a80) /src/rego/rego.go:2387 +0x927 fp=0xc040680ff0 sp=0xc040680e80 pc=0xdbd627 github.com/open-policy-agent/opa/rego.PreparedPartialQuery.Partial({{0xc000287180?, 0xc0001183f0?}}, {0x20e2790, 0xc0002aa6f0}, {0xc0000bedc0?, 0xc0002eb178?, 0xaa?}) /src/rego/rego.go:485 +0x154 fp=0xc040681098 sp=0xc040680ff0 pc=0xdb2434 github.com/open-policy-agent/opa/rego.(*Rego).Partial(0xc000287180, {0x20e2790, 0xc0002aa6f0}) /src/rego/rego.go:1381 +0x713 fp=0xc040681218 sp=0xc040681098 pc=0xdb4bf3 github.com/open-policy-agent/opa/server.(*Server).v1CompilePost(0xc0001721e0, {0x20e0858, 0xc0001180f0}, 0xc00014a600) /src/server/server.go:1342 +0x965 fp=0xc040681548 sp=0xc040681218 pc=0xe15265 github.com/open-policy-agent/opa/server.(*Server).v1CompilePost-fm({0x20e0858?, 0xc0001180f0?}, 0xc0002aa720?) :1 +0x36 fp=0xc040681578 sp=0xc040681548 pc=0xe26776 net/http.HandlerFunc.ServeHTTP(0x1b0fb40?, {0x20e0858?, 0xc0001180f0?}, 0x198b154?) /usr/local/go/src/net/http/server.go:2136 +0x29 fp=0xc0406815a0 sp=0xc040681578 pc=0x75d729 github.com/open-policy-agent/opa/internal/prometheus.(*Provider).InstrumentHandler.func1({0x7fe8c025cfa0?, 0xc0002aa720}, 0xc00014a600) /src/internal/prometheus/prometheus.go:89 +0x149 fp=0xc040681630 sp=0xc0406815a0 pc=0xcdd5c9 net/http.HandlerFunc.ServeHTTP(0x20dfb08?, {0x7fe8c025cfa0?, 0xc0002aa720?}, 0xc0002aa690?) /usr/local/go/src/net/http/server.go:2136 +0x29 fp=0xc040681658 sp=0xc040681630 pc=0x75d729 github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerDuration.func1({0x20dfb08, 0xc000134140}, 0xc00014a600) /src/vendor/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go:97 +0xf9 fp=0xc040681790 sp=0xc040681658 pc=0xcc9f79 net/http.HandlerFunc.ServeHTTP(0xc00014a500?, {0x20dfb08?, 0xc000134140?}, 0x10?) /usr/local/go/src/net/http/server.go:2136 +0x29 fp=0xc0406817b8 sp=0xc040681790 pc=0x75d729 github.com/gorilla/mux.(*Router).ServeHTTP(0xc000000300, {0x20dfb08, 0xc000134140}, 0xc00014a400) /src/vendor/github.com/gorilla/mux/mux.go:210 +0x1c5 fp=0xc0406818e0 sp=0xc0406817b8 pc=0xa2fa45 github.com/open-policy-agent/opa/server.(*Server).initHandlerCompression.CompressHandler.func1({0x20dfb08?, 0xc000134140}, 0xc00014a400) /src/server/handlers/compress.go:41 +0x189 fp=0xc040681958 sp=0xc0406818e0 pc=0xe0d309 net/http.HandlerFunc.ServeHTTP(0xc000522db0?, {0x20dfb08?, 0xc000134140?}, 0x0?) /usr/local/go/src/net/http/server.go:2136 +0x29 fp=0xc040681980 sp=0xc040681958 pc=0x75d729 github.com/open-policy-agent/opa/runtime.(*LoggingHandler).ServeHTTP(0xc0002b8a20, {0x20df598, 0xc00035e000}, 0xc00014a100) /src/runtime/logging.go:110 +0xa76 fp=0xc040681b48 sp=0xc040681980 pc=0xf4b076 net/http.serverHandler.ServeHTTP({0x20dbfb0?}, {0x20df598?, 0xc00035e000?}, 0x6?) /usr/local/go/src/net/http/server.go:2938 +0x8e fp=0xc040681b78 sp=0xc040681b48 pc=0x76040e net/http.(*conn).serve(0xc0002d0120, {0x20e2790, 0xc0003901b0}) /usr/local/go/src/net/http/server.go:2009 +0x5f4 fp=0xc040681fb8 sp=0xc040681b78 pc=0x75c2f4 net/http.(*Server).Serve.func3() /usr/local/go/src/net/http/server.go:3086 +0x28 fp=0xc040681fe0 sp=0xc040681fb8 pc=0x760c28 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc040681fe8 sp=0xc040681fe0 pc=0x4c36a1 created by net/http.(*Server).Serve in goroutine 84 /usr/local/go/src/net/http/server.go:3086 +0x5cb goroutine 1 [select, 1 minutes]: runtime.gopark(0xc00063f820?, 0x3?, 0x0?, 0x0?, 0xc00063f55a?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000985390 sp=0xc000985370 pc=0x48ff6e runtime.selectgo(0xc000985820, 0xc00063f554, 0x13?, 0x0, 0x0?, 0x1) /usr/local/go/src/runtime/select.go:327 +0x725 fp=0xc0009854b0 sp=0xc000985390 pc=0x4a0485 github.com/open-policy-agent/opa/runtime.(*Runtime).Serve(0xc0004b7680, {0x20e2720, 0x2d5bd20}) /src/runtime/runtime.go:631 +0x1965 fp=0xc000985980 sp=0xc0009854b0 pc=0xf4fca5 github.com/open-policy-agent/opa/runtime.(*Runtime).StartServer(0x0?, {0x20e2720?, 0x2d5bd20?}) /src/runtime/runtime.go:465 +0x1d fp=0xc0009859a8 sp=0xc000985980 pc=0xf4e2fd github.com/open-policy-agent/opa/cmd.startRuntime({0x20e2720?, 0x2d5bd20?}, 0xc0004c5398?, 0xb0?) /src/cmd/run.go:351 +0x31 fp=0xc0009859d0 sp=0xc0009859a8 pc=0xfb1211 github.com/open-policy-agent/opa/cmd.init.12.func1(0xc00017f200?, {0xc0004e8d80, 0x1, 0x4}) /src/cmd/run.go:194 +0x17c fp=0xc000985d20 sp=0xc0009859d0 pc=0xfb085c github.com/spf13/cobra.(*Command).execute(0xc00017f200, {0xc0004e8d40, 0x4, 0x4}) /src/vendor/github.com/spf13/cobra/command.go:944 +0x863 fp=0xc000985e58 sp=0xc000985d20 pc=0xf74f83 github.com/spf13/cobra.(*Command).ExecuteC(0x2c23000) /src/vendor/github.com/spf13/cobra/command.go:1068 +0x3a5 fp=0xc000985f10 sp=0xc000985e58 pc=0xf757c5 github.com/spf13/cobra.(*Command).Execute(0xc0000061a0?) /src/vendor/github.com/spf13/cobra/command.go:992 +0x13 fp=0xc000985f28 sp=0xc000985f10 pc=0xf75373 main.main() /src/main.go:14 +0x1a fp=0xc000985f40 sp=0xc000985f28 pc=0xfb78da runtime.main() /usr/local/go/src/runtime/proc.go:267 +0x2bb fp=0xc000985fe0 sp=0xc000985f40 pc=0x48fafb runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000985fe8 sp=0xc000985fe0 pc=0x4c36a1 goroutine 2 [force gc (idle), 1 minutes]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000096fa8 sp=0xc000096f88 pc=0x48ff6e runtime.goparkunlock(...) /usr/local/go/src/runtime/proc.go:404 runtime.forcegchelper() /usr/local/go/src/runtime/proc.go:322 +0xb3 fp=0xc000096fe0 sp=0xc000096fa8 pc=0x48fdd3 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000096fe8 sp=0xc000096fe0 pc=0x4c36a1 created by runtime.init.6 in goroutine 1 /usr/local/go/src/runtime/proc.go:310 +0x1a goroutine 3 [GC sweep wait]: runtime.gopark(0x1?, 0x0?, 0x0?, 0x0?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000097778 sp=0xc000097758 pc=0x48ff6e runtime.goparkunlock(...) /usr/local/go/src/runtime/proc.go:404 runtime.bgsweep(0x0?) /usr/local/go/src/runtime/mgcsweep.go:321 +0xdf fp=0xc0000977c8 sp=0xc000097778 pc=0x479edf runtime.gcenable.func1() /usr/local/go/src/runtime/mgc.go:200 +0x25 fp=0xc0000977e0 sp=0xc0000977c8 pc=0x46f025 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0000977e8 sp=0xc0000977e0 pc=0x4c36a1 created by runtime.gcenable in goroutine 1 /usr/local/go/src/runtime/mgc.go:200 +0x66 goroutine 4 [GC scavenge wait]: runtime.gopark(0x5ce5e2c?, 0x1467692e?, 0x0?, 0x0?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000097f70 sp=0xc000097f50 pc=0x48ff6e runtime.goparkunlock(...) /usr/local/go/src/runtime/proc.go:404 runtime.(*scavengerState).park(0x2d21180) /usr/local/go/src/runtime/mgcscavenge.go:425 +0x49 fp=0xc000097fa0 sp=0xc000097f70 pc=0x477729 runtime.bgscavenge(0xc000052070?) /usr/local/go/src/runtime/mgcscavenge.go:658 +0x59 fp=0xc000097fc8 sp=0xc000097fa0 pc=0x477cd9 runtime.gcenable.func2() /usr/local/go/src/runtime/mgc.go:201 +0x25 fp=0xc000097fe0 sp=0xc000097fc8 pc=0x46efc5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000097fe8 sp=0xc000097fe0 pc=0x4c36a1 created by runtime.gcenable in goroutine 1 /usr/local/go/src/runtime/mgc.go:201 +0xa5 goroutine 5 [finalizer wait]: runtime.gopark(0x0?, 0xc0003940f0?, 0x30?, 0x80?, 0x1000000010?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc0000abe28 sp=0xc0000abe08 pc=0x48ff6e runtime.runfinq() /usr/local/go/src/runtime/mfinal.go:193 +0x107 fp=0xc0000abfe0 sp=0xc0000abe28 pc=0x46e0a7 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0000abfe8 sp=0xc0000abfe0 pc=0x4c36a1 created by runtime.createfing in goroutine 1 /usr/local/go/src/runtime/mfinal.go:163 +0x3d goroutine 19 [GC worker (idle), 1 minutes]: runtime.gopark(0xc0000987a8?, 0x45b06b?, 0xf8?, 0xa1?, 0xc000130020?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000098750 sp=0xc000098730 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc0000987e0 sp=0xc000098750 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0000987e8 sp=0xc0000987e0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 20 [GC worker (idle), 1 minutes]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000092750 sp=0xc000092730 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc0000927e0 sp=0xc000092750 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0000927e8 sp=0xc0000927e0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 21 [GC worker (idle), 1 minutes]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000092f50 sp=0xc000092f30 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc000092fe0 sp=0xc000092f50 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000092fe8 sp=0xc000092fe0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 22 [GC worker (idle), 1 minutes]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000093750 sp=0xc000093730 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc0000937e0 sp=0xc000093750 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0000937e8 sp=0xc0000937e0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 23 [GC worker (idle), 1 minutes]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000093f50 sp=0xc000093f30 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc000093fe0 sp=0xc000093f50 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000093fe8 sp=0xc000093fe0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 24 [GC worker (idle), 1 minutes]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000094750 sp=0xc000094730 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc0000947e0 sp=0xc000094750 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0000947e8 sp=0xc0000947e0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 25 [GC worker (idle), 1 minutes]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000094f50 sp=0xc000094f30 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc000094fe0 sp=0xc000094f50 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000094fe8 sp=0xc000094fe0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 7 [GC worker (idle), 1 minutes]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000098f50 sp=0xc000098f30 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc000098fe0 sp=0xc000098f50 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000098fe8 sp=0xc000098fe0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 26 [GC worker (idle), 1 minutes]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000095750 sp=0xc000095730 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc0000957e0 sp=0xc000095750 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0000957e8 sp=0xc0000957e0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 27 [GC worker (idle), 1 minutes]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000095f50 sp=0xc000095f30 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc000095fe0 sp=0xc000095f50 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000095fe8 sp=0xc000095fe0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 28 [GC worker (idle), 1 minutes]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000146750 sp=0xc000146730 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc0001467e0 sp=0xc000146750 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0001467e8 sp=0xc0001467e0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 34 [GC worker (idle), 1 minutes]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000142750 sp=0xc000142730 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc0001427e0 sp=0xc000142750 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0001427e8 sp=0xc0001427e0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 35 [GC worker (idle)]: runtime.gopark(0x2d5d800?, 0x1?, 0x77?, 0x16?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000142f50 sp=0xc000142f30 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc000142fe0 sp=0xc000142f50 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000142fe8 sp=0xc000142fe0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 36 [GC worker (idle)]: runtime.gopark(0x2d5d800?, 0x1?, 0x1a?, 0x94?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000143750 sp=0xc000143730 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc0001437e0 sp=0xc000143750 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0001437e8 sp=0xc0001437e0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 37 [GC worker (idle), 1 minutes]: runtime.gopark(0x15f91868d1c?, 0x1?, 0x22?, 0x9e?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000143f50 sp=0xc000143f30 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc000143fe0 sp=0xc000143f50 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000143fe8 sp=0xc000143fe0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 38 [GC worker (idle), 1 minutes]: runtime.gopark(0x15f91867e31?, 0x0?, 0x0?, 0x0?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000144750 sp=0xc000144730 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc0001447e0 sp=0xc000144750 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0001447e8 sp=0xc0001447e0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 39 [GC worker (idle)]: runtime.gopark(0x2d5d800?, 0x1?, 0xa3?, 0xeb?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000144f50 sp=0xc000144f30 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc000144fe0 sp=0xc000144f50 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000144fe8 sp=0xc000144fe0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 40 [GC worker (idle)]: runtime.gopark(0x2d5d800?, 0x1?, 0x7?, 0x7e?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000145750 sp=0xc000145730 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc0001457e0 sp=0xc000145750 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0001457e8 sp=0xc0001457e0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 8 [GC worker (idle)]: runtime.gopark(0x17033b42297?, 0x1?, 0x24?, 0x7e?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000099750 sp=0xc000099730 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc0000997e0 sp=0xc000099750 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0000997e8 sp=0xc0000997e0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 29 [GC worker (idle), 1 minutes]: runtime.gopark(0x15f91868e86?, 0x1?, 0xf2?, 0x9?, 0x0?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000146f50 sp=0xc000146f30 pc=0x48ff6e runtime.gcBgMarkWorker() /usr/local/go/src/runtime/mgc.go:1293 +0xe5 fp=0xc000146fe0 sp=0xc000146f50 pc=0x470ba5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000146fe8 sp=0xc000146fe0 pc=0x4c36a1 created by runtime.gcBgMarkStartWorkers in goroutine 1 /usr/local/go/src/runtime/mgc.go:1217 +0x1c goroutine 83 [select, 1 minutes]: runtime.gopark(0xc000317f78?, 0x2?, 0x80?, 0xed?, 0xc000316c14?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000694ab8 sp=0xc000694a98 pc=0x48ff6e runtime.selectgo(0xc000695f78, 0xc000316c10, 0x12?, 0x0, 0x0?, 0x1) /usr/local/go/src/runtime/select.go:327 +0x725 fp=0xc000694bd8 sp=0xc000694ab8 pc=0x4a0485 github.com/open-policy-agent/opa/runtime.(*Runtime).checkOPAUpdateLoop(0xc0004b7680, {0x20e2720, 0x2d5bd20}, 0x34630b8a000?, 0xc000045f20) /src/runtime/runtime.go:728 +0x5ef fp=0xc000695fa8 sp=0xc000694bd8 pc=0xf5108f github.com/open-policy-agent/opa/runtime.(*Runtime).Serve.func7() /src/runtime/runtime.go:581 +0x30 fp=0xc000695fe0 sp=0xc000695fa8 pc=0xf4ff50 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000695fe8 sp=0xc000695fe0 pc=0x4c36a1 created by github.com/open-policy-agent/opa/runtime.(*Runtime).Serve in goroutine 1 /src/runtime/runtime.go:581 +0xfa5 goroutine 84 [IO wait, 1 minutes]: runtime.gopark(0x4dae50?, 0xc0000a7be0?, 0x10?, 0x7c?, 0x504ebd?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc0000a7ba0 sp=0xc0000a7b80 pc=0x48ff6e runtime.netpollblock(0x0?, 0x4588c6?, 0x0?) /usr/local/go/src/runtime/netpoll.go:564 +0xf7 fp=0xc0000a7bd8 sp=0xc0000a7ba0 pc=0x4886f7 internal/poll.runtime_pollWait(0x7fe8c15fef90, 0x72) /usr/local/go/src/runtime/netpoll.go:343 +0x85 fp=0xc0000a7bf8 sp=0xc0000a7bd8 pc=0x4bda65 internal/poll.(*pollDesc).wait(0xc000598080?, 0x0?, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27 fp=0xc0000a7c20 sp=0xc0000a7bf8 pc=0x4fdb27 internal/poll.(*pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(*FD).Accept(0xc000598080) /usr/local/go/src/internal/poll/fd_unix.go:611 +0x2ac fp=0xc0000a7cc8 sp=0xc0000a7c20 pc=0x50300c net.(*netFD).accept(0xc000598080) /usr/local/go/src/net/fd_unix.go:172 +0x29 fp=0xc0000a7d80 sp=0xc0000a7cc8 pc=0x642cc9 net.(*TCPListener).accept(0xc000285be0) /usr/local/go/src/net/tcpsock_posix.go:152 +0x1e fp=0xc0000a7da8 sp=0xc0000a7d80 pc=0x659c7e net.(*TCPListener).AcceptTCP(0xc000285be0) /usr/local/go/src/net/tcpsock.go:302 +0x30 fp=0xc0000a7dd8 sp=0xc0000a7da8 pc=0x658cf0 github.com/open-policy-agent/opa/server.tcpKeepAliveListener.Accept({0x760acb?}) /src/server/server.go:432 +0x17 fp=0xc0000a7e00 sp=0xc0000a7dd8 pc=0xe0afb7 net/http.(*onceCloseListener).Accept(0xc0002d0120?) :1 +0x24 fp=0xc0000a7e18 sp=0xc0000a7e00 pc=0x783fe4 net/http.(*Server).Serve(0xc00043c1e0, {0x20e0468, 0xc000285be0}) /usr/local/go/src/net/http/server.go:3056 +0x364 fp=0xc0000a7f48 sp=0xc0000a7e18 pc=0x760864 github.com/open-policy-agent/opa/server.(*baseHTTPListener).ListenAndServe(0xc0002bc050) /src/server/server.go:494 +0xad fp=0xc0000a7f78 sp=0xc0000a7f48 pc=0xe0b10d github.com/open-policy-agent/opa/server.httpListener.ListenAndServe-fm() :1 +0x25 fp=0xc0000a7f90 sp=0xc0000a7f78 pc=0xe26c25 github.com/open-policy-agent/opa/runtime.(*Runtime).Serve.func4(0x0?) /src/runtime/runtime.go:609 +0x1f fp=0xc0000a7fc8 sp=0xc0000a7f90 pc=0xf4fe9f github.com/open-policy-agent/opa/runtime.(*Runtime).Serve.func8() /src/runtime/runtime.go:610 +0x27 fp=0xc0000a7fe0 sp=0xc0000a7fc8 pc=0xf4fe47 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0000a7fe8 sp=0xc0000a7fe0 pc=0x4c36a1 created by github.com/open-policy-agent/opa/runtime.(*Runtime).Serve in goroutine 1 /src/runtime/runtime.go:608 +0x16a5 goroutine 85 [select, 1 minutes, locked to thread]: runtime.gopark(0xc0001477a8?, 0x2?, 0x0?, 0x0?, 0xc0001477a4?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000147638 sp=0xc000147618 pc=0x48ff6e runtime.selectgo(0xc0001477a8, 0xc0001477a0, 0x0?, 0x0, 0x0?, 0x1) /usr/local/go/src/runtime/select.go:327 +0x725 fp=0xc000147758 sp=0xc000147638 pc=0x4a0485 runtime.ensureSigM.func1() /usr/local/go/src/runtime/signal_unix.go:1014 +0x19f fp=0xc0001477e0 sp=0xc000147758 pc=0x4ba03f runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0001477e8 sp=0xc0001477e0 pc=0x4c36a1 created by runtime.ensureSigM in goroutine 1 /usr/local/go/src/runtime/signal_unix.go:997 +0xc8 goroutine 86 [syscall, 1 minutes]: runtime.notetsleepg(0x0?, 0x0?) /usr/local/go/src/runtime/lock_futex.go:236 +0x29 fp=0xc000147fa0 sp=0xc000147f68 pc=0x460a49 os/signal.signal_recv() /usr/local/go/src/runtime/sigqueue.go:152 +0x29 fp=0xc000147fc0 sp=0xc000147fa0 pc=0x4bfa49 os/signal.loop() /usr/local/go/src/os/signal/signal_unix.go:23 +0x13 fp=0xc000147fe0 sp=0xc000147fc0 pc=0xa2d173 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000147fe8 sp=0xc000147fe0 pc=0x4c36a1 created by os/signal.Notify.func1.1 in goroutine 1 /usr/local/go/src/os/signal/signal.go:151 +0x1f goroutine 98 [IO wait, 1 minutes]: runtime.gopark(0x537236776f4e5249?, 0xb?, 0x0?, 0x0?, 0x7?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc0001675a0 sp=0xc000167580 pc=0x48ff6e runtime.netpollblock(0x4d8cb8?, 0x4588c6?, 0x0?) /usr/local/go/src/runtime/netpoll.go:564 +0xf7 fp=0xc0001675d8 sp=0xc0001675a0 pc=0x4886f7 internal/poll.runtime_pollWait(0x7fe8c15feda0, 0x72) /usr/local/go/src/runtime/netpoll.go:343 +0x85 fp=0xc0001675f8 sp=0xc0001675d8 pc=0x4bda65 internal/poll.(*pollDesc).wait(0xc000598100?, 0xc0002aa131?, 0x0) /usr/local/go/src/internal/poll/fd_poll_runtime.go:84 +0x27 fp=0xc000167620 sp=0xc0001675f8 pc=0x4fdb27 internal/poll.(*pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:89 internal/poll.(*FD).Read(0xc000598100, {0xc0002aa131, 0x1, 0x1}) /usr/local/go/src/internal/poll/fd_unix.go:164 +0x27a fp=0xc0001676b8 sp=0xc000167620 pc=0x4fee1a net.(*netFD).Read(0xc000598100, {0xc0002aa131?, 0x736f4f3737694f75?, 0x484d672f6a394e2f?}) /usr/local/go/src/net/fd_posix.go:55 +0x25 fp=0xc000167700 sp=0xc0001676b8 pc=0x640ca5 net.(*conn).Read(0xc00059c000, {0xc0002aa131?, 0x2d2d2d4554414349?, 0xa2d2d?}) /usr/local/go/src/net/net.go:179 +0x45 fp=0xc000167748 sp=0xc000167700 pc=0x6513a5 net.(*TCPConn).Read(0x0?, {0xc0002aa131?, 0x0?, 0x0?}) :1 +0x25 fp=0xc000167778 sp=0xc000167748 pc=0x663b45 net/http.(*connReader).backgroundRead(0xc0002aa120) /usr/local/go/src/net/http/server.go:683 +0x37 fp=0xc0001677c8 sp=0xc000167778 pc=0x756177 net/http.(*connReader).startBackgroundRead.func2() /usr/local/go/src/net/http/server.go:679 +0x25 fp=0xc0001677e0 sp=0xc0001677c8 pc=0x7560a5 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc0001677e8 sp=0xc0001677e0 pc=0x4c36a1 created by net/http.(*connReader).startBackgroundRead in goroutine 16 /usr/local/go/src/net/http/server.go:679 +0xba goroutine 99 [select, 1 minutes]: runtime.gopark(0xc000167f80?, 0x2?, 0x0?, 0x0?, 0xc000167f7c?) /usr/local/go/src/runtime/proc.go:398 +0xce fp=0xc000167e28 sp=0xc000167e08 pc=0x48ff6e runtime.selectgo(0xc000167f80, 0xc000167f78, 0x0?, 0x0, 0x0?, 0x1) /usr/local/go/src/runtime/select.go:327 +0x725 fp=0xc000167f48 sp=0xc000167e28 pc=0x4a0485 github.com/open-policy-agent/opa/rego.waitForDone({0x20e2790?, 0xc0002aa6f0?}, 0xc0002d20c0, 0xc000118bd0) /src/rego/rego.go:2593 +0x67 fp=0xc000167fb0 sp=0xc000167f48 pc=0xdbf027 github.com/open-policy-agent/opa/rego.(*Rego).partial.func3() /src/rego/rego.go:2383 +0x2c fp=0xc000167fe0 sp=0xc000167fb0 pc=0xdbda6c runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1650 +0x1 fp=0xc000167fe8 sp=0xc000167fe0 pc=0x4c36a1 created by github.com/open-policy-agent/opa/rego.(*Rego).partial in goroutine 16 /src/rego/rego.go:2383 +0x90a ```

Workaround:

allow if {
    bt = {tag | tag := input.book.tags[_]}
    ut = {tag | tag := input.user.tags[_]}
        bt2 = {tag | tag := input.book.tags[_]}

    bt & ut == bt2
}
anderseknert commented 11 months ago

Thanks for reporting this @nkey0 👍 I was able to reproduce using opa eval -d . --optimize 2 data.test.