could p.Data could be nil here?

On Monday, September 26, 2022 at 12:03:20 AM UTC-7 Bernd Fix wrote:

> On 9/25/22 19:05, Kurtis Rader wrote:
> > Insufficient information. Show us the panic
> panic: runtime error: invalid memory address or nil pointer dereference
> [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x49388d]
>
> goroutine 100037 [running]:
> leatea/core.(*ForwardTable).Learn(0xc0000b6d80, 0xc000c22660)
> /prj/net/routing/leatea/core/forward_table.go:455 +0x25a
> leatea/core.(*Node).Receive(0xc0000b6d80, {0x7275b0?, 0xc000c22660?})
> /prj/net/routing/leatea/core/node.go:164 +0x2f5
> created by leatea/core.(*Node).Start
> /prj/net/routing/leatea/core/node.go:98 +0x2ea
>
> > Are you using CGO?
>
> A third party library ("sdlcanvas") does, but I don't think it is 
> related to the problem as rendering happens later (after the panic).
>
> > Can you show the definition of peer.Key()?
>
> Sure:
>
> // Key returns a string used for map operations
> func (p *PeerID) Key() string {
> if p == nil {
> return "(nil)"
> }
> if len(p.str64) == 0 {
> p.str64 = base64.StdEncoding.EncodeToString(p.Data)
> }
> return p.str64
> }
>
> > Is it (or any function it calls) using "unsafe"?
>
> As said before, "sdlcanvas" as a cgo library might use that but it is 
> not logically involved in the process that panics. >Y<
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/b9a06a83-735f-4e3c-9811-8ebe0ff973a6n%40googlegroups.com.

Reply via email to