Skip to content

Commit

Permalink
Merge #41086
Browse files Browse the repository at this point in the history
41086: roachtest: fix panic when tests fail using an existing cluster r=andreimatei a=ajwerner

```
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

Co-authored-by: Andrew Werner <[email protected]>
  • Loading branch information
craig[bot] and ajwerner committed Sep 25, 2019
2 parents d714f55 + 05c8a9e commit 7df2a12
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 unowned 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 7df2a12

Please sign in to comment.