https://cerbos.dev logo
#help
Title
# help
b

Bradey Wood

11/13/2023, 5:22 PM
Another, unrelated comment -- I can get the binary to segfault when I have strange files in
testdata
...
Copy code
cerbos compile policies --verbose --run=app

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x11f238a]

goroutine 1 [running]:
<http://github.com/cerbos/cerbos/internal/verify.(*TestFixture).lookupResource(0xc001869320|github.com/cerbos/cerbos/internal/verify.(*TestFixture).lookupResource(0xc001869320>, 0x7f8263477878?, {0xc000890f50, 0x8})
        <http://github.com/cerbos/cerbos/internal/verify/test_fixture.go:484|github.com/cerbos/cerbos/internal/verify/test_fixture.go:484> +0x4a
<http://github.com/cerbos/cerbos/internal/verify.(*TestFixture).buildTest(0xc0018f6090|github.com/cerbos/cerbos/internal/verify.(*TestFixture).buildTest(0xc0018f6090>?, 0xc000f6a370, 0xc0018f6090, {{0xc001635350, 0x0}, {{0xc000890f00, 0xc}, {0xc000890f50, 0x8}}})
        <http://github.com/cerbos/cerbos/internal/verify/test_fixture.go:432|github.com/cerbos/cerbos/internal/verify/test_fixture.go:432> +0x12d
<http://github.com/cerbos/cerbos/internal/verify.(*TestFixture).buildTests(0x0|github.com/cerbos/cerbos/internal/verify.(*TestFixture).buildTests(0x0>?, 0x0?, 0x0?)
        <http://github.com/cerbos/cerbos/internal/verify/test_fixture.go:411|github.com/cerbos/cerbos/internal/verify/test_fixture.go:411> +0x107
<http://github.com/cerbos/cerbos/internal/verify.(*TestFixture).getTests|github.com/cerbos/cerbos/internal/verify.(*TestFixture).getTests>(0x4163b0?, 0xc000f6a370)
        <http://github.com/cerbos/cerbos/internal/verify/test_fixture.go:391|github.com/cerbos/cerbos/internal/verify/test_fixture.go:391> +0xee
<http://github.com/cerbos/cerbos/internal/verify.(*TestFixture).runTestSuite(0x1e|github.com/cerbos/cerbos/internal/verify.(*TestFixture).runTestSuite(0x1e>?, {0x34876e0, 0xc000ff4ac0}, {0x345d780, 0xc0014c0de0}, 0x34874e8?, {0xc001015560, 0x24}, 0xc000f6a370, 0x1)
        <http://github.com/cerbos/cerbos/internal/verify/test_fixture.go:187|github.com/cerbos/cerbos/internal/verify/test_fixture.go:187> +0x1fc
<http://github.com/cerbos/cerbos/internal/verify.Verify.func5({0xc001015560|github.com/cerbos/cerbos/internal/verify.Verify.func5({0xc001015560>, 0x24})
        <http://github.com/cerbos/cerbos/internal/verify/verify.go:143|github.com/cerbos/cerbos/internal/verify/verify.go:143> +0x5ef
<http://github.com/cerbos/cerbos/internal/verify.Verify(|github.com/cerbos/cerbos/internal/verify.Verify(>{0x34876e0, 0xc000ff4ac0}, {0x345da20, 0xc0013923f0}, {0x345d780, 0xc0014c0de0}, {{0xc0008707d0?, 0xc000e0f170?}, 0xc0?})
        <http://github.com/cerbos/cerbos/internal/verify/verify.go:151|github.com/cerbos/cerbos/internal/verify/verify.go:151> +0x48f
<http://github.com/cerbos/cerbos/cmd/cerbos/compile.(*Cmd).Run(0xc001408d00|github.com/cerbos/cerbos/cmd/cerbos/compile.(*Cmd).Run(0xc001408d00>, 0xc000d1c280)
        <http://github.com/cerbos/cerbos/cmd/cerbos/compile/compile.go:146|github.com/cerbos/cerbos/cmd/cerbos/compile/compile.go:146> +0x886
reflect.Value.call({0x2809480?, 0xc001408d00?, 0x2b93da0?}, {0x2bb01d5, 0x4}, {0xc0006fa480, 0x1, 0x0?})
        reflect/value.go:596 +0xce7
reflect.Value.Call({0x2809480?, 0xc001408d00?, 0x2797460?}, {0xc0006fa480?, 0x2b93da0?, 0xc000130f70?})
        reflect/value.go:380 +0xb9
<http://github.com/alecthomas/kong.callFunction(|github.com/alecthomas/kong.callFunction(>{0x2809480?, 0xc001408d00?, 0x0?}, 0x2baf710?)
        <http://github.com/alecthomas/kong@v0.8.1/callbacks.go:98|github.com/alecthomas/kong@v0.8.1/callbacks.go:98> +0x40b
<http://github.com/alecthomas/kong.(*Context).RunNode(0xc0007cb880|github.com/alecthomas/kong.(*Context).RunNode(0xc0007cb880>, 0xc000f6c4b0, {0x0, 0x0, 0xc000d1c280?})
        <http://github.com/alecthomas/kong@v0.8.1/context.go:765|github.com/alecthomas/kong@v0.8.1/context.go:765> +0x810
<http://github.com/alecthomas/kong.(*Context).Run(0x25f1be0|github.com/alecthomas/kong.(*Context).Run(0x25f1be0>?, {0x0?, 0xc00149fee0?, 0x7?})
        <http://github.com/alecthomas/kong@v0.8.1/context.go:790|github.com/alecthomas/kong@v0.8.1/context.go:790> +0x132
main.main()
        <http://github.com/cerbos/cerbos/cmd/cerbos/main.go:45|github.com/cerbos/cerbos/cmd/cerbos/main.go:45> +0x2b6