如何分析Go(golang)崩溃日志

So my application crashed and I can't for the life of me figure out what the problem is only from the error messages. Because it ran for hours fine.

this is the error

(err): net.(*pollDesc).WaitRead(0xc20802ac30, 0x0, 0x0)
(err):     /usr/lib/go/src/pkg/net/fd_poll_runtime.go:89 +0x42
(err): net.(*netFD).Read(0xc20802abd0, 0xc208083000, 0x1000, 0x1000, 0x0, 0x7fab4f8082b8, 0xb)
(err):     /usr/lib/go/src/pkg/net/fd_unix.go:242 +0x34c
(err): net.(*conn).Read(0xc208038090, 0xc208083000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
(err):     /usr/lib/go/src/pkg/net/net.go:122 +0xe7
(err): bufio.(*Reader).fill(0xc208004540)
(err):     /usr/lib/go/src/pkg/bufio/bufio.go:97 +0x1b3
(err): bufio.(*Reader).ReadSlice(0xc208004540, 0x7ffff8000000000a, 0x0, 0x0, 0x0, 0x0, 0x0)
(err):     /usr/lib/go/src/pkg/bufio/bufio.go:298 +0x22c
(err): bufio.(*Reader).ReadLine(0xc208004540, 0x0, 0x0, 0x0, 0x200, 0x0, 0x0)
(err):     /usr/lib/go/src/pkg/bufio/bufio.go:326 +0x69
(err): net/textproto.(*Reader).readLineSlice(0xc208022d50, 0x0, 0x0, 0x0, 0x0, 0x0)
(err):     /usr/lib/go/src/pkg/net/textproto/reader.go:55 +0x9d
(err): net/textproto.(*Reader).ReadLine(0xc208022d50, 0x0, 0x0, 0x0, 0x0)
(err):     /usr/lib/go/src/pkg/net/textproto/reader.go:36 +0x4e
(err): main.(*Bot).ListenToConnection(0xc208046460, 0x7fab4f809518, 0xc208038090)
(err):     /home/gempir/gempbroker/main.go:73 +0xab
(err): created by main.(*Bot).CreateConnection
(err):     /home/gempir/gempbroker/main.go:106 +0x8a3

I found that main.go:73 which is a simple Readline reading from a TCP connection

reader := bufio.NewReader(conn)
    tp := textproto.NewReader(reader)
    for {
        line, err := tp.ReadLine()
        if err != nil {
            break // break loop on errors
        }
        // do stuff
    }

main.go:106 just creates a goroutine for listening to the connection

go listenToConnection(conn)

How do I find out what the error logs actually mean and find a solution to my problem?

If you follow the stack trace, you can see that, as expected, you are polling a network (TCP connection). Networks are fragile; you must expect errors and handle them gracefully.

reader := bufio.NewReader(conn)
tp := textproto.NewReader(reader)
for {
    line, err := tp.ReadLine()
    if err != nil {
        break // break loop on errors
    }
    // do stuff
}

If an error occurs here

line, err := tp.ReadLine()

you discard it

    if err != nil {
        break // break loop on errors
    }

and keep going, pretending nothing happened

for {
    line, err := tp.ReadLine()
    if err != nil {
        break // break loop on errors
    }
    // do stuff
}

On the next

line, err := tp.ReadLine()

after an error, the results are undefined.