panjf2000 / gnet

🚀 gnet is a high-performance, lightweight, non-blocking, event-driven networking framework written in pure Go.
https://gnet.host
Apache License 2.0
9.71k stars 1.04k forks source link

压力测试崩溃,偶现 #417

Closed LiuWillis closed 2 years ago

LiuWillis commented 2 years ago

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

goroutine 50 [running]: github.com/panjf2000/gnet/v2/pkg/buffer/elastic.(Buffer).IsEmpty(...) /root/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.1.1/pkg/buffer/elastic/elastic_ring_list_buffer.go:158 github.com/panjf2000/gnet/v2.(eventloop).closeConn(0xc00011c480, 0xc00a9ae000, {0x0, 0x0}) /root/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.1.1/eventloop.go:196 +0xb1 github.com/panjf2000/gnet/v2.(eventloop).closeAllSockets(0xc00011c480) /root/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.1.1/eventloop.go:67 +0x85 github.com/panjf2000/gnet/v2.(eventloop).run.func1() /root/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.1.1/reactor_default_linux.go:93 +0x25 panic({0x94a6c0, 0xf8d180}) /usr/local/go/src/runtime/panic.go:838 +0x207 github.com/panjf2000/gnet/v2/pkg/buffer/elastic.(Buffer).IsEmpty(...) /root/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.1.1/pkg/buffer/elastic/elastic_ring_list_buffer.go:158 github.com/panjf2000/gnet/v2.(eventloop).closeConn(0xc00011c480, 0xc00a9ae000, {0x0, 0x0}) /root/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.1.1/eventloop.go:196 +0xb1 github.com/panjf2000/gnet/v2.(eventloop).read(0xc00011c480, 0xc00a9ae000) /root/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.1.1/eventloop.go:134 +0x1d1 github.com/panjf2000/gnet/v2.(eventloop).run.func2(0xc0000aa2d0?, 0x1) /root/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.1.1/reactor_default_linux.go:117 +0xb8 github.com/panjf2000/gnet/v2/internal/netpoll.(Poller).Polling(0xc0000c2320, 0xc009491f88) /root/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.1.1/internal/netpoll/epoll_default_poller.go:138 +0x2ba github.com/panjf2000/gnet/v2.(eventloop).run(0xc00011c480, 0x1?) /root/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.1.1/reactor_default_linux.go:98 +0xcb github.com/panjf2000/gnet/v2.(engine).startEventLoops.func1.1() /root/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.1.1/engine.go:69 +0x2e created by github.com/panjf2000/gnet/v2.(engine).startEventLoops.func1 /root/go/pkg/mod/github.com/panjf2000/gnet/v2@v2.1.1/engine.go:68 +0x8d

panjf2000 commented 2 years ago
  1. 按模板填 issue
  2. 压测代码给一下
lesismal commented 2 years ago

估计是我之前说的相同原因: https://github.com/panjf2000/gnet/issues/414

panjf2000 commented 2 years ago

长时间没回应,暂时关闭,有更多信息了可以随时重开。