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

index out of range panic on COUNT() query with WHERE clause #6859

Closed
sparrc opened this issue Jun 17, 2016 · 1 comment · Fixed by #6860
Closed

index out of range panic on COUNT() query with WHERE clause #6859

sparrc opened this issue Jun 17, 2016 · 1 comment · Fixed by #6860
Assignees
Milestone

Comments

@sparrc
Copy link
Contributor

sparrc commented Jun 17, 2016

Bug report

System info: [Include InfluxDB version, operating system name, and other relevant details]

1.0.0-beta1
OSX

Steps to reproduce:

can't for the life of me get this to reproduce

Actual behavior: [What actually happened]

Panic after running query:

select count(http_status_code) from nginx_access_log where http_status_code < 400

panic traceback:

[query] 2016/06/17 12:59:16 SELECT count(nginx_access_log) FROM telegraf.autogen.nginx_access_log WHERE http_status_code > 400
panic: runtime error: index out of range

goroutine 164 [running]:
panic(0x77ce40, 0xc82000a0a0)
    /usr/local/Cellar/go/1.6.2/libexec/src/runtime/panic.go:481 +0x3e6
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Engine).createVarRefSeriesIterator(0xc82030a0c0, 0xc8209daa60, 0xc8200702a0, 0xc820799dc0, 0x2b, 0xc821195450, 0x3a00580, 0xc8207e7b90, 0xc820704b40, 0x1, ...)
    /Users/sparrc/ws/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/engine.go:1148 +0x144c
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Engine).createTagSetGroupIterators(0xc82030a0c0, 0xc8209daa60, 0xc8200702a0, 0xc820704a10, 0x1, 0x1, 0xc821195450, 0xc820704a30, 0x1, 0x1, ...)
    /Users/sparrc/ws/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/engine.go:1068 +0x429
github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Engine).createTagSetIterators.func1(0xc8208a7c40, 0xc821740370, 0x2, 0x2, 0xc82030a0c0, 0xc8209daa60, 0xc8200702a0, 0xc821195450, 0xc82174ea80, 0x1)
    /Users/sparrc/ws/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/engine.go:1023 +0x11a
created by github.com/influxdata/influxdb/tsdb/engine/tsm1.(*Engine).createTagSetIterators
    /Users/sparrc/ws/go/src/github.com/influxdata/influxdb/tsdb/engine/tsm1/engine.go:1024 +0x419

The same query without count() was working fine, as well as the count() query without the WHERE clause:

> select http_status_code from nginx_access_log where http_status_code > 400
...
> select count(http_status_code) from nginx_access_log
...
@jwilder jwilder added this to the 1.0.0 milestone Jun 17, 2016
@jwilder
Copy link
Contributor

jwilder commented Jun 17, 2016

@jsternberg

@jsternberg jsternberg self-assigned this Jun 17, 2016
jsternberg added a commit that referenced this issue Jun 17, 2016
…condition cursor

A copy/paste error had nil cursors destined for a condition cursor get
set to the auxiliary cursor instead. When the number of conditions
exceeded the number of auxiliary fields, this would result in a stack
trace in some situations. When the number of conditions was less than or
equal to the number of auxiliary fields, it means that an auxiliary
cursor may have been overwritten with a nil cursor accidentally and a
leak might have happened since it was never closed.

Fixes #6859.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants