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

[0.10.0] influx_tsm: panic: runtime error: invalid memory address or nil pointer dereference #5656

Closed
jwilder opened this issue Feb 12, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@jwilder
Copy link
Contributor

jwilder commented Feb 12, 2016

Panic originally reported in #5648 when running influx_tsm.

panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x1 pc=0x68f211]

goroutine 20 [running]:
github.com/boltdb/bolt.(*Tx).Rollback(0x0, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/boltdb/bolt/tx.go:231 +0x31
github.com/influxdb/influxdb/cmd/influx_tsm/bz1.(*Reader).Close(0xc208156090, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/bz1/reader.go:178 +0x3e
main.convertShard(0xc208039d00, 0xc20802efc0, 0x7f38ae6a0bc0, 0xc2080ee8c0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/main.go:329 +0x591
main.func·007()
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:91 +0x1e8
main.ParallelGroup.Do(0xc20805dce0, 0xc20801cba0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/main.go:366 +0x86
created by main.(*tracker).Run
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:95 +0x4ef

goroutine 1 [select]:
main.(*tracker).Run(0xc20802efc0, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:106 +0x717
main.main()
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/main.go:214 +0x1867

goroutine 6 [syscall]:
os/signal.loop()
        /root/.gvm/gos/go1.4.3/src/os/signal/signal_unix.go:21 +0x1f
created by os/signal.init·1
        /root/.gvm/gos/go1.4.3/src/os/signal/signal_unix.go:27 +0x35

goroutine 18 [runnable]:
github.com/boltdb/bolt.flock(0xc208182000, 0xc208182001, 0x3b9aca00, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/boltdb/bolt/bolt_unix.go:38 +0x1b7
github.com/boltdb/bolt.Open(0xc20815c0f0, 0x26, 0xc2000001b6, 0xc20812eab0, 0xc20815c0f0, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/boltdb/bolt/db.go:180 +0x257
github.com/influxdb/influxdb/cmd/influx_tsm/bz1.(*Reader).Open(0xc20817c000, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/bz1/reader.go:55 +0x9b
main.convertShard(0xc208039a80, 0xc20802efc0, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/main.go:328 +0x3f1
main.func·007()
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:91 +0x1e8
main.ParallelGroup.Do(0xc20805dce0, 0xc20801cb60)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/main.go:366 +0x86
created by main.(*tracker).Run
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:95 +0x4ef

goroutine 17 [runnable]:
github.com/boltdb/bolt.flock(0xc20810c0e0, 0xc20810c001, 0x3b9aca00, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/boltdb/bolt/bolt_unix.go:38 +0x1b7
github.com/boltdb/bolt.Open(0xc2080f13b0, 0x26, 0xc2000001b6, 0xc2080fcab0, 0xc2080f13b0, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/boltdb/bolt/db.go:180 +0x257
github.com/influxdb/influxdb/cmd/influx_tsm/bz1.(*Reader).Open(0xc20810afc0, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/bz1/reader.go:55 +0x9b
main.convertShard(0xc208039980, 0xc20802efc0, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/main.go:328 +0x3f1
main.func·007()
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:91 +0x1e8
main.ParallelGroup.Do(0xc20805dce0, 0xc20801cb40)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/main.go:366 +0x86
created by main.(*tracker).Run
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:95 +0x4ef

goroutine 19 [runnable]:
main.convertShard(0xc208039bc0, 0xc20802efc0, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/main.go:329 +0x499
main.func·007()
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:91 +0x1e8
main.ParallelGroup.Do(0xc20805dce0, 0xc20801cb80)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/main.go:366 +0x86
created by main.(*tracker).Run
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:95 +0x4ef

goroutine 21 [runnable]:
github.com/boltdb/bolt.flock(0xc208182008, 0xc208182001, 0x3b9aca00, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/boltdb/bolt/bolt_unix.go:38 +0x1b7
github.com/boltdb/bolt.Open(0xc20815c270, 0x26, 0xc2000001b6, 0xc208134ab0, 0xc20815c270, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/boltdb/bolt/db.go:180 +0x257
github.com/influxdb/influxdb/cmd/influx_tsm/bz1.(*Reader).Open(0xc20817c090, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/bz1/reader.go:55 +0x9b
main.convertShard(0xc208039dc0, 0xc20802efc0, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/main.go:328 +0x3f1
main.func·007()
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:91 +0x1e8
main.ParallelGroup.Do(0xc20805dce0, 0xc20801cbc0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/main.go:366 +0x86
created by main.(*tracker).Run
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:95 +0x4ef

goroutine 22 [runnable]:
github.com/boltdb/bolt.flock(0xc208160000, 0xc208160001, 0x3b9aca00, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/boltdb/bolt/bolt_unix.go:38 +0x1b7
github.com/boltdb/bolt.Open(0xc208148030, 0x26, 0x1b6, 0xc2080f8ab0, 0x4444488cc4484401, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/boltdb/bolt/db.go:180 +0x257
github.com/influxdb/influxdb/cmd/influx_tsm/bz1.(*Reader).Open(0xc208156000, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/bz1/reader.go:55 +0x9b
main.convertShard(0xc208039ec0, 0xc20802efc0, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/main.go:328 +0x3f1
main.func·007()
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:91 +0x1e8
main.ParallelGroup.Do(0xc20805dce0, 0xc20801cbe0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/main.go:366 +0x86
created by main.(*tracker).Run
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:95 +0x4ef

goroutine 23 [runnable]:
github.com/boltdb/bolt.flock(0xc208180000, 0xc208180001, 0x3b9aca00, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/boltdb/bolt/bolt_unix.go:38 +0x1b7
github.com/boltdb/bolt.Open(0xc208172030, 0x26, 0x1b6, 0xc2080fdab0, 0x4444488cc4484401, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/boltdb/bolt/db.go:180 +0x257
github.com/influxdb/influxdb/cmd/influx_tsm/bz1.(*Reader).Open(0xc208176000, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/bz1/reader.go:55 +0x9b
main.convertShard(0xc208039f80, 0xc20802efc0, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/main.go:328 +0x3f1
main.func·007()
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:91 +0x1e8
main.ParallelGroup.Do(0xc20805dce0, 0xc20801cc00)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/main.go:366 +0x86
created by main.(*tracker).Run
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:95 +0x4ef

goroutine 24 [running]:
        goroutine running on other thread; stack unavailable
created by main.(*tracker).Run
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:95 +0x4ef

goroutine 25 [semacquire]:
sync.(*WaitGroup).Wait(0xc20802f080)
        /root/.gvm/gos/go1.4.3/src/sync/waitgroup.go:132 +0x169
main.func·008()
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:100 +0x42
created by main.(*tracker).Run
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:102 +0x5da
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x1 pc=0x68f211]

goroutine 24 [running]:
github.com/boltdb/bolt.(*Tx).Rollback(0x0, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/boltdb/bolt/tx.go:231 +0x31
github.com/influxdb/influxdb/cmd/influx_tsm/bz1.(*Reader).Close(0xc208184000, 0x0, 0x0)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/bz1/reader.go:178 +0x3e
main.convertShard(0xc2080e6040, 0xc20802efc0, 0x7f38ae6a0bc0, 0xc20816e060)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/main.go:329 +0x591
main.func·007()
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:91 +0x1e8
main.ParallelGroup.Do(0xc20805dce0, 0xc20801cc20)
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/main.go:366 +0x86
created by main.(*tracker).Run
        /tmp/tmp.r1Nea5VXEw/src/github.com/influxdb/influxdb/cmd/influx_tsm/tracker.go:95 +0x4ef

cc @joelegasse

@jwilder jwilder added this to the 0.11.0 milestone Feb 12, 2016
@joelegasse joelegasse self-assigned this Feb 12, 2016
@jwilder jwilder added the panic label Feb 12, 2016
@joelegasse
Copy link
Contributor

The issue here is that Close() is being deferred before the reader is successfully opened. Which means that if there is an error opening the reader, Close() is still attempted, rolling back a nil transaction

@e-dard
Copy link
Contributor

e-dard commented Feb 15, 2016

Fixed via #5660.

@e-dard e-dard closed this as completed Feb 15, 2016
@jwilder jwilder modified the milestones: 0.10.1, 0.11.0 Feb 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants