gagliardetto / solana-go

Go SDK library and RPC client for the Solana Blockchain
Apache License 2.0
929 stars 264 forks source link

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

Open andmart opened 1 month ago

andmart commented 1 month ago

go version go1.23.1 linux/amd64


package main

import (
    "context"

    "github.com/gagliardetto/solana-go"
    serum "github.com/gagliardetto/solana-go/programs/serum"
    "github.com/gagliardetto/solana-go/rpc"
)

func main() {
    endpoint := rpc.MainNetBeta_RPC
    client := rpc.New(endpoint)
    ctx := context.Background()
    marketAddr := solana.MustPublicKeyFromBase58("GTpWscSoJegU3Ry3ZinMCLEnD2FAMRqNYRhG9E6UX2EY")
    serum.FetchMarket(ctx, client, marketAddr)
}

generates

Starting: /dev/go/bin/dlv dap --listen=127.0.0.1:40005 --log-dest=3 from /dev/projetos/proj_go/teste
DAP server listening at: 127.0.0.1:40005
Type 'dlv help' for list of commands.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa9f6da]

goroutine 1 [running]:
debug/elf.(*Section).ReadAt(0xc0000fef00, {0xc000154500, 0x25b, 0x25b}, 0x0)
    <autogenerated>:1 +0x7a
archive/zip.readDirectoryEnd({0xc0d4e0, 0xc0000fef00}, 0x25b)
    /dev/apps/go/src/archive/zip/reader.go:576 +0x1d6
archive/zip.(*Reader).init(0xc00017a000, {0xc0d4e0, 0xc0000fef00}, 0x25b)
    /dev/apps/go/src/archive/zip/reader.go:119 +0x78
archive/zip.NewReader({0xc0d4e0, 0xc0000fef00}, 0x25b)
    /dev/apps/go/src/archive/zip/reader.go:112 +0xbd
github.com/daaku/go%2ezipexe.zipExeReaderElf({0xc0d4c0, 0xc0000c02a8}, 0xdc5e89)
    /dev/go/pkg/mod/github.com/daaku/go.zipexe@v1.0.0/zipexe.go:128 +0x1df
github.com/daaku/go%2ezipexe.NewReader({0xc0d4c0, 0xc0000c02a8}, 0xdc5e89)
    /dev/go/pkg/mod/github.com/daaku/go.zipexe@v1.0.0/zipexe.go:48 +0x1bf
github.com/daaku/go%2ezipexe.OpenCloser({0xc00010e180, 0x38})
    /dev/go/pkg/mod/github.com/daaku/go.zipexe@v1.0.0/zipexe.go:30 +0x258
github.com/GeertJohan/go%2erice.init.0()
    /dev/go/pkg/mod/github.com/!geert!johan/go.rice@v1.0.0/appended.go:41 +0x205
Process 3028354 has exited with status 2
Detaching