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

nest_dotted function panics on non-record value #5241

Open
philrz opened this issue Aug 21, 2024 · 1 comment
Open

nest_dotted function panics on non-record value #5241

philrz opened this issue Aug 21, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@philrz
Copy link
Contributor

philrz commented Aug 21, 2024

Repro is with Zed commit 48021d7.

The nest_dotted function docs set expectations that it's only intended to be used on records, so I'm not surprised this failed. But a panic and stack dump is undesirable.

$ zq -version
Version: v1.17.0-35-g48021d77

$ echo '"Hello"' | zq -z 'yield nest_dotted(this)' -
panic: runtime error: invalid memory address or nil pointer dereference
goroutine 1 [running]:
runtime/debug.Stack()
	/usr/local/opt/[email protected]/libexec/src/runtime/debug/stack.go:24 +0x5e
github.com/brimdata/zed/runtime/sam/op.(*Catcher).Pull.func1()
	/Users/phil/work/zed/runtime/sam/op/catcher.go:25 +0x3d
panic({0x24b2660?, 0x376df50?})
	/usr/local/opt/[email protected]/libexec/src/runtime/panic.go:914 +0x21f
github.com/brimdata/zed.(*TypeRecord).ID(...)
	/Users/phil/work/zed/complex.go:215
github.com/brimdata/zed/runtime/sam/expr/function.(*NestDotted).lookupBuilderAndType(0xc000012f18, 0x0)
	/Users/phil/work/zed/runtime/sam/expr/function/nestdotted.go:32 +0x2e
github.com/brimdata/zed/runtime/sam/expr/function.(*NestDotted).Call(0xc000012f18, {0x298c928, 0xc000525d80}, {0xc000116300?, 0xc0005278a0?, 0x0?})
	/Users/phil/work/zed/runtime/sam/expr/function/nestdotted.go:61 +0x189
github.com/brimdata/zed/runtime/sam/expr.(*Call).Eval(0xc000175280, {0x298c928, 0xc000525d80}, {0x2986700?, 0xc00041f7a8?})
	/Users/phil/work/zed/runtime/sam/expr/eval.go:752 +0xce
github.com/brimdata/zed/runtime/sam/op/yield.(*Op).Pull(0xc0001752c0, 0x37?)
	/Users/phil/work/zed/runtime/sam/op/yield/yield.go:36 +0x4e8
github.com/brimdata/zed/runtime/sam/op.(*Single).Pull(0xc000515a10, 0xf4)
	/Users/phil/work/zed/runtime/sam/op/mux.go:120 +0x33
github.com/brimdata/zed/runtime/sam/op.(*Catcher).Pull(0xc000680000?, 0xd8?)
	/Users/phil/work/zed/runtime/sam/op/catcher.go:28 +0x62
github.com/brimdata/zed/runtime/exec.(*Query).Pull(0xc000680000?, 0x60?)
	/Users/phil/work/zed/runtime/exec/query.go:59 +0x3e
github.com/brimdata/zed/zbuf.CopyMux(0x2494ac0?, {0x2986200, 0xc000515a40})
	/Users/phil/work/zed/zbuf/mux.go:40 +0x38
github.com/brimdata/zed/cli/zq.(*Command).Run(0xc0004da1e0, {0xc0000400a0, 0x2, 0x2})
	/Users/phil/work/zed/cli/zq/command.go:168 +0x9c5
github.com/brimdata/zed/pkg/charm.path.run({0xc0007202f8?, 0x1, 0x1}, {0xc0000400a0?, 0x2, 0x0?})
	/Users/phil/work/zed/pkg/charm/path.go:11 +0x79
github.com/brimdata/zed/pkg/charm.(*Spec).ExecRoot(0x100874b?, {0xc000040090, 0x3, 0x3})
	/Users/phil/work/zed/pkg/charm/charm.go:63 +0x3f
main.main()
	/Users/phil/work/zed/cmd/zq/main.go:11 +0x5b
@philrz philrz added the bug Something isn't working label Aug 21, 2024
@philrz
Copy link
Contributor Author

philrz commented Sep 3, 2024

@mattnibs noted that he's likely to take up vectorized nest_dotted soon and hence might be able to fix this at the same time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants