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

bench1/q4 vector CSUP query causes "panic: runtime error: index out of range [0] with length 0" #5514

Closed
philrz opened this issue Dec 4, 2024 · 1 comment · Fixed by #5518
Labels
bug Something isn't working

Comments

@philrz
Copy link
Contributor

philrz commented Dec 4, 2024

Repro is with super commit 1f0c0ce.

Per #5507 (comment), now that both #5507 and #5508 have merged, I'm revisiting the mgbench queries with CSUP to make sure they all still run ok and see if their performance has improved. When doing this, I've found that the bench1/q4 query now panics where it didn't previously.

Test data is s3://brim-sampledata/mgbench/bench1.csup. The older CSUP that used to run ok via super dev vector query pre-#5507 has been renamed to s3://brim-sampledata/mgbench/bench1-pre-super-5507.csup.

$ super -version
Version: v1.18.0-180-g1f0c0cea

$ SUPER_VAM=1 super -c '
from "bench1.csup"
| where
    machine_group=="Servers"
    and cpu_wio > float32(0.99)
    and log_time >= 2016-12-01T00:00:00Z
    and log_time < 2017-01-01T00:00:00Z
| summarize
    spikes := count()
    by machine_name
| sort -r spikes
| head 10'

panic: runtime error: index out of range [0] with length 0

goroutine 2486 [running]:
github.com/brimdata/super/runtime/vam/op/summarize.(*countByString).countDict(0xc000b94200, 0xdb65d3c?, {0x0, 0x0, 0x1?}, 0x0)
	/Users/phil/work/super/runtime/vam/op/summarize/agg.go:204 +0x1a5
github.com/brimdata/super/runtime/vam/op/summarize.(*countByString).update(0xf4f9020?, {0xc000b941c0?, 0x0?, 0xc000a03c08?}, {0xc000b941d0?, 0x574792f8?, 0xc000b95f80?})
	/Users/phil/work/super/runtime/vam/op/summarize/agg.go:151 +0x134
github.com/brimdata/super/runtime/vam/op/summarize.(*Summarize).consume(0xc0006c6d10, {0xc000b941c0, 0x1, 0x2}, {0xc000b941d0, 0x1, 0x1})
	/Users/phil/work/super/runtime/vam/op/summarize/summarize.go:102 +0x4cc
github.com/brimdata/super/runtime/vam/op/summarize.(*Summarize).Pull.func1({0xc000b941c0, 0x2, 0xc000a03d80?})
	/Users/phil/work/super/runtime/vam/op/summarize/summarize.go:83 +0x78
github.com/brimdata/super/vector.Apply(0x10?, 0xf78fa78?, {0xc000b941c0?, 0x2?, 0xf58c620?})
	/Users/phil/work/super/vector/apply.go:17 +0xa3
github.com/brimdata/super/runtime/vam/op/summarize.(*Summarize).Pull(0xc0006c6d10, 0x80?)
	/Users/phil/work/super/runtime/vam/op/summarize/summarize.go:82 +0x13b
github.com/brimdata/super/runtime/vam/op.(*combineParent).run(0xc0011f0540)
	/Users/phil/work/super/runtime/vam/op/combine.go:110 +0x3f
created by github.com/brimdata/super/runtime/vam/op.(*Combine).Pull.func1 in goroutine 2481
	/Users/phil/work/super/runtime/vam/op/combine.go:42 +0x35
@philrz philrz added the bug Something isn't working label Dec 4, 2024
mattnibs added a commit that referenced this issue Dec 5, 2024
@philrz
Copy link
Contributor Author

philrz commented Dec 5, 2024

Verified in super commit 3284256.

The query now completes successfully without panic.

$ super -version
Version: v1.18.0-182-g32842569

$ SUPER_VAM=1 super -c '
from "bench1.csup"
| where
    machine_group=="Servers"
    and cpu_wio > float32(0.99)
    and log_time >= 2016-12-01T00:00:00Z
    and log_time < 2017-01-01T00:00:00Z
| summarize
    spikes := count()
    by machine_name
| sort -r spikes
| head 10'

{machine_name:"sourpatch",spikes:8861(uint64)}
{machine_name:"louie",spikes:581(uint64)}
{machine_name:"zotz",spikes:550(uint64)}
{machine_name:"pieces",spikes:495(uint64)}
{machine_name:"reeces",spikes:453(uint64)}
{machine_name:"thing",spikes:438(uint64)}
{machine_name:"adminhost",spikes:366(uint64)}
{machine_name:"cadbury",spikes:357(uint64)}
{machine_name:"york",spikes:193(uint64)}
{machine_name:"reflect",spikes:156(uint64)}

Thanks @mattnibs!

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

Successfully merging a pull request may close this issue.

1 participant