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

panic: runtime error: invalid memory address or nil pointer dereference #31

Closed
dkropachev opened this issue Apr 13, 2020 · 1 comment · Fixed by #35
Closed

panic: runtime error: invalid memory address or nil pointer dereference #31

dkropachev opened this issue Apr 13, 2020 · 1 comment · Fixed by #35

Comments

@dkropachev
Copy link
Contributor

Running command "/$HOME/go/bin/scylla-bench -workload=sequential -mode=write -max-rate=300 -replication-factor=3 -partition-count=10 -clustering-row-count=100 -clustering-row-size=5120 -concurrency=7 -rows-per-request=10 -nodes 10.142.0.4"...
Configuration
Mode: write
Workload: sequential
Timeout: 5s
Consistency level: quorum
Partition count: 10
Clustering rows: 100
Clustering row size: Fixed(5120)
Rows per request: 10
Page size: 1000
Concurrency: 7
Connections: 4
Maximum rate: 300 op/s
Client compression: true

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

goroutine 132 [running]:
sync.(*Mutex).Lock(...)
/usr/local/go/src/sync/mutex.go:74
github.com/gocql/gocql.(*Session).routingKeyInfo(0x0, 0x7af5a0, 0xc00008e010, 0xc0000c1080, 0x3a, 0x0, 0x0, 0x0)
/home/scylla-test/go/src/github.com/gocql/gocql/session.go:495 +0x58
github.com/gocql/gocql.(*Batch).GetRoutingKey(0xc00048e0e0, 0x7f6b86f7cfff, 0x800, 0x7f6b86da2a00, 0x20300000000000, 0x7f6b86f7cfff)
/home/scylla-test/go/src/github.com/gocql/gocql/session.go:1774 +0xcf
github.com/gocql/gocql.(*tokenAwareHostPolicy).Pick(0xc0000c43f0, 0x7b2900, 0xc00048e0e0, 0x400)
/home/scylla-test/go/src/github.com/gocql/gocql/policies.go:575 +0x52
github.com/gocql/gocql.(*queryExecutor).do(0xc000084dc0, 0x7af5a0, 0xc00008e010, 0x7b2900, 0xc00048e0e0, 0x5b)
/home/scylla-test/go/src/github.com/gocql/gocql/query_executor.go:87 +0x63
github.com/gocql/gocql.(*queryExecutor).executeQuery(0xc000084dc0, 0x7b2900, 0xc00048e0e0, 0x0, 0x0, 0x0)
/home/scylla-test/go/src/github.com/gocql/gocql/query_executor.go:60 +0x437
github.com/gocql/gocql.(*Session).executeBatch(0xc000069880, 0xc00048e0e0, 0x1d6ea4013ff)
/home/scylla-test/go/src/github.com/gocql/gocql/session.go:642 +0xbc
github.com/gocql/gocql.(*Session).ExecuteBatch(0xc000069880, 0xc00048e0e0, 0x981f40, 0xc0002f86a0)
/home/scylla-test/go/src/github.com/gocql/gocql/session.go:653 +0x39
main.DoBatchedWrites.func1(0xc0002fa2c0, 0xc246cc00, 0x981f40, 0x9788e0)
/home/scylla-test/go/src/github.com/scylladb/scylla-bench/modes.go:453 +0x518
main.RunTest(0xc00019b440, 0x7b0840, 0xc00008b2c0, 0x7acd00, 0xc000205770, 0xc00024eea0)
/home/scylla-test/go/src/github.com/scylladb/scylla-bench/modes.go:268 +0x10c
main.DoBatchedWrites(0xc000069880, 0xc00019b440, 0x7b0840, 0xc00008b2c0, 0x7acd00, 0xc000205770)
/home/scylla-test/go/src/github.com/scylladb/scylla-bench/modes.go:440 +0x179
main.main.func4(0x1, 0xc00019b440, 0x7acd00, 0xc000205770)
/home/scylla-test/go/src/github.com/scylladb/scylla-bench/main.go:440 +0x145
main.RunConcurrently.func1(0xc000281020, 0xc0002a6d80, 0xc000290500, 0x7, 0x7, 0xc000281018, 0x1)
/home/scylla-test/go/src/github.com/scylladb/scylla-bench/modes.go:158 +0x73
created by main.RunConcurrently
/home/scylla-test/go/src/github.com/scylladb/scylla-bench/modes.go:156 +0x203
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x67abc8]

goroutine 135 [running]:
sync.(*Mutex).Lock(...)
/usr/local/go/src/sync/mutex.go:74
github.com/gocql/gocql.(*Session).routingKeyInfo(0x0, 0x7af5a0, 0xc00008e010, 0xc0002e6180, 0x3a, 0x0, 0x0, 0x0)
/home/scylla-test/go/src/github.com/gocql/gocql/session.go:495 +0x58
github.com/gocql/gocql.(*Batch).GetRoutingKey(0xc0002b61c0, 0x7f6b86f7cfff, 0x800, 0x7f6b86da2500, 0x20300000000000, 0x7f6b86f7cfff)
/home/scylla-test/go/src/github.com/gocql/gocql/session.go:1774 +0xcf
github.com/gocql/gocql.(*tokenAwareHostPolicy).Pick(0xc0000c43f0, 0x7b2900, 0xc0002b61c0, 0x400)
/home/scylla-test/go/src/github.com/gocql/gocql/policies.go:575 +0x52
github.com/gocql/gocql.(*queryExecutor).do(0xc000084dc0, 0x7af5a0, 0xc00008e010, 0x7b2900, 0xc0002b61c0, 0x5b)
/home/scylla-test/go/src/github.com/gocql/gocql/query_executor.go:87 +0x63
github.com/gocql/gocql.(*queryExecutor).executeQuery(0xc000084dc0, 0x7b2900, 0xc0002b61c0, 0x0, 0x0, 0x0)
/home/scylla-test/go/src/github.com/gocql/gocql/query_executor.go:60 +0x437
github.com/gocql/gocql.(*Session).executeBatch(0xc000069880, 0xc0002b61c0, 0x1d6ea400496)
/home/scylla-test/go/src/github.com/gocql/gocql/session.go:642 +0xbc
github.com/gocql/gocql.(*Session).ExecuteBatch(0xc000069880, 0xc0002b61c0, 0x981f40, 0xc0002d36a0)
/home/scylla-test/go/src/github.com/gocql/gocql/session.go:653 +0x39
main.DoBatchedWrites.func1(0xc00001db20, 0xc2479600, 0x981f40, 0x9788e0)
/home/scylla-test/go/src/github.com/scylladb/scylla-bench/modes.go:453 +0x518
main.RunTest(0xc00019b560, 0x7b0840, 0xc00001ae40, 0x7acd00, 0xc0002a70b0, 0xc000249ea0)
/home/scylla-test/go/src/github.com/scylladb/scylla-bench/modes.go:268 +0x10c
main.DoBatchedWrites(0xc000069880, 0xc00019b560, 0x7b0840, 0xc00001ae40, 0x7acd00, 0xc0002a70b0)
/home/scylla-test/go/src/github.com/scylladb/scylla-bench/modes.go:440 +0x179
main.main.func4(0x4, 0xc00019b560, 0x7acd00, 0xc0002a70b0)
/home/scylla-test/go/src/github.com/scylladb/scylla-bench/main.go:440 +0x145
main.RunConcurrently.func1(0xc000281020, 0xc0002a6d80, 0xc000290500, 0x7, 0x7, 0xc000281018, 0x4)
/home/scylla-test/go/src/github.com/scylladb/scylla-bench/modes.go:158 +0x73
created by main.RunConcurrently
/home/scylla-test/go/src/github.com/scylladb/scylla-bench/modes.go:156 +0x203
Error executing command: "/$HOME/go/bin/scylla-bench -workload=sequential -mode=write -max-rate=300 -replication-factor=3 -partition-count=10 -clustering-row-count=100 -clustering-row-size=5120 -concurrency=7 -rows-per-request=10 -nodes 10.142.0.4"; Exit status: 2
STDOUT: Connections: 4
STDERR: panic: runtime error: invalid memory address or nil pointer dereference
Running command "pgrep -f cassandra-stress | xargs -I{} kill -TERM -{}"...
Running command "pgrep -f ycsb | xargs -I{} kill -TERM -{}"...

@fruch
Copy link
Contributor

fruch commented May 26, 2020

I'm narrowed it down to this command that crash:

go run github.com/scylladb/scylla-bench -workload=sequential -mode=write -max-rate=300 -replication-factor=1 -clustering-row-size=5120 -concurrency=7 -rows-per-request=10

if I remove the -row-per-requests is works fine

from a quick look at the code, when -row-per-requests is bigger then one, batch statements is used for write, and failing on this.

fruch added a commit to fruch/scylla-bench that referenced this issue May 26, 2020
`gocql.NewBatch` is now deprecated (and broken)
switching to use `session.NewBatch`

Fixes: scylladb#31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants