Panic on pool.Close() #275

Closed
opened 2025-12-28 18:07:38 +00:00 by sami · 0 comments
Owner

Originally created by @AliceInHunterland on GitHub (Apr 10, 2025).

Originally assigned to: @roman-khimov on GitHub.

Refs. https://github.com/nspcc-dev/neo-go/issues/3864

Current Behavior

panic on pool.Close()

Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: panic: runtime error: invalid memory address or nil pointer dereference
Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]:         panic: runtime error: invalid memory address or nil pointer dereference
Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xb339b7]
Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: goroutine 194 [running]:
Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: google.golang.org/grpc.(*ClientConn).Close.func1()
Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]:         google.golang.org/grpc@v1.70.0/clientconn.go:1110 +0x17
Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: panic({0x117ee60?, 0x1ec4d80?})
Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]:         runtime/panic.go:785 +0x132
Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: google.golang.org/grpc.(*ClientConn).Close(0x0)
Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]:         google.golang.org/grpc@v1.70.0/clientconn.go:1116 +0x5a
Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: github.com/nspcc-dev/neofs-sdk-go/client.(*Client).Close(...)
Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]:         github.com/nspcc-dev/neofs-sdk-go@v1.0.0-rc.13/client/client.go:219
Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: github.com/nspcc-dev/neofs-sdk-go/pool.(*clientWrapper).Close(0x1?)
Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]:         github.com/nspcc-dev/neofs-sdk-go@v1.0.0-rc.13/pool/pool.go:377 +0x1b
Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: github.com/nspcc-dev/neofs-sdk-go/pool.(*Pool).Close(0xc000322960)
Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]:         github.com/nspcc-dev/neofs-sdk-go@v1.0.0-rc.13/pool/pool.go:1037 +0x472
Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: github.com/nspcc-dev/neo-go/pkg/services/helpers/neofs.PoolWrapper.Close(...)

Expected Behavior

no panic.

Possible Solution

Probably: add a nil check in clientWrapper.Close or check restartIfUnhealthy for nil s

Steps to Reproduce

  1. run neo-go node with blockfetcher

Your Environment

neofs-sdk-go@v1.0.0-rc.13 (Refs. https://github.com/nspcc-dev/neo-go/issues/3864)

Don't forget to add labels!

  • component label (see project-specific labels)
  • good first issue if needed
  • does this issue belong to an epic?
  • priorities (U0-U4/S0-S4/I0-I4) if known, bugs are usually more urgent, but less significant
Originally created by @AliceInHunterland on GitHub (Apr 10, 2025). Originally assigned to: @roman-khimov on GitHub. <!-- Provide a general summary of the issue in the Title above --> Refs. https://github.com/nspcc-dev/neo-go/issues/3864 ## Current Behavior <!-- Tell us what happens instead of the expected behavior --> panic on `pool.Close()` ``` Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: panic: runtime error: invalid memory address or nil pointer dereference Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: panic: runtime error: invalid memory address or nil pointer dereference Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xb339b7] Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: goroutine 194 [running]: Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: google.golang.org/grpc.(*ClientConn).Close.func1() Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: google.golang.org/grpc@v1.70.0/clientconn.go:1110 +0x17 Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: panic({0x117ee60?, 0x1ec4d80?}) Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: runtime/panic.go:785 +0x132 Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: google.golang.org/grpc.(*ClientConn).Close(0x0) Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: google.golang.org/grpc@v1.70.0/clientconn.go:1116 +0x5a Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: github.com/nspcc-dev/neofs-sdk-go/client.(*Client).Close(...) Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: github.com/nspcc-dev/neofs-sdk-go@v1.0.0-rc.13/client/client.go:219 Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: github.com/nspcc-dev/neofs-sdk-go/pool.(*clientWrapper).Close(0x1?) Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: github.com/nspcc-dev/neofs-sdk-go@v1.0.0-rc.13/pool/pool.go:377 +0x1b Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: github.com/nspcc-dev/neofs-sdk-go/pool.(*Pool).Close(0xc000322960) Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: github.com/nspcc-dev/neofs-sdk-go@v1.0.0-rc.13/pool/pool.go:1037 +0x472 Apr 09 20:15:47 ip-172-31-35-244.sa-east-1.compute.internal neo-go[49746]: github.com/nspcc-dev/neo-go/pkg/services/helpers/neofs.PoolWrapper.Close(...) ``` ## Expected Behavior <!-- Tell us what should happen --> no panic. ## Possible Solution <!-- Not obligatory, but suggest a fix/reason for the bug --> Probably: add a nil check in `clientWrapper.Close` or check `restartIfUnhealthy` for nil s ## Steps to Reproduce <!-- Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. --> 1. run neo-go node with blockfetcher ## Your Environment <!-- Include as many relevant details about the environment you experienced the bug in --> neofs-sdk-go@v1.0.0-rc.13 (Refs. https://github.com/nspcc-dev/neo-go/issues/3864) ## Don't forget to add labels! - component label (see project-specific labels) - `good first issue` if needed - does this issue belong to an epic? - priorities (`U0`-`U4`/`S0`-`S4`/`I0`-`I4`) if known, bugs are usually more urgent, but less significant
sami 2025-12-28 18:07:38 +00:00
  • closed this issue
  • added the
    bug
    I4
    S4
    U1
    labels
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-sdk-go#275
No description provided.