zyazhb / File-monitor

File monitor in golang.
0 stars 0 forks source link

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

Open zyazhb opened 3 years ago

zyazhb commented 3 years ago

引起原因未知 似乎是rpc传参的时候出现空指针的情况 之后应该做一下错误处理 排除掉一些没有意义的数据

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x5e26dd]

goroutine 3969 [running]:
net/rpc.(*Client).send(0x0, 0xc0014ac050)
        /usr/lib/go-1.15/src/net/rpc/client.go:72 +0x3d
net/rpc.(*Client).Go(0x0, 0x6541a5, 0x19, 0x62f460, 0xc00079c180, 0x5ff5a0, 0xc000d504c0, 0xc00194c000, 0x0)
        /usr/lib/go-1.15/src/net/rpc/client.go:316 +0xd0
net/rpc.(*Client).Call(...)
        /usr/lib/go-1.15/src/net/rpc/client.go:322
main/notify.rpcreportfan(0xc001841950, 0x8c, 0x64f41a, 0xa, 0x0, 0x0, 0x7ffdb5cb91ef, 0xe)
        /mnt/d/root/ZYA/File-monitor/agent/notify/rpcconnect.go:69 +0x1dc
created by main/notify.RunFanotify
        /mnt/d/root/ZYA/File-monitor/agent/notify/notifyfan.go:40 +0x4de
exit status 2