Skip to content

Commit

Permalink
roachtest: fix panic when tests fail using an existing cluster
Browse files Browse the repository at this point in the history
```
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
    panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x61498e6]

goroutine 67 [running]:
github.com/cockroachdb/cockroach/pkg/util/stop.(*Stopper).Recover(0xc0000e9560, 0x7942500, 0xc0005beb10)
    /Users/lucy/go/src/github.com/cockroachdb/cockroach/pkg/util/stop/stopper.go:181 +0x121
panic(0x6ce8ee0, 0x9b12c10)
    /usr/local/go/src/runtime/panic.go:522 +0x1b5
github.com/cockroachdb/cockroach/pkg/util/quotapool.(*IntAlloc).Freeze(0x0)
```

Release justification: Not production code.

Release note: None
  • Loading branch information
ajwerner committed Sep 25, 2019
1 parent 1311b51 commit d386073
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/cmd/roachtest/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,9 @@ func (c *cluster) setTest(t testI) {
func (c *cluster) Save(ctx context.Context, msg string, l *logger) {
l.PrintfCtx(ctx, "saving cluster %s for debugging (--debug specified)", c)
// TODO(andrei): should we extend the cluster here? For how long?
c.destroyState.alloc.Freeze()
if c.destroyState.owned { // we won't have an alloc for an existing cluster
c.destroyState.alloc.Freeze()
}
c.r.markClusterAsSaved(c, msg)
c.destroyState.mu.Lock()
c.destroyState.mu.saved = true
Expand Down

0 comments on commit d386073

Please sign in to comment.