Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fd_operator.go:62 panic #330

Open
gh73962 opened this issue May 13, 2024 · 7 comments
Open

fd_operator.go:62 panic #330

gh73962 opened this issue May 13, 2024 · 7 comments

Comments

@gh73962
Copy link

gh73962 commented May 13, 2024

Describe the bug
生产环境的websocket server
最近偶尔会在netpoll.Connection Close()调用后这样

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

goroutine 4340 [running]:
github.com/cloudwego/netpoll.(*FDOperator).Free(0xc00c49f738?)
	/root/go/pkg/mod/github.com/cloudwego/netpoll@v0.6.0/fd_operator.go:62 +0x16
github.com/cloudwego/netpoll.(*connection).init.(*connection).initFinalizer.func1({0x4103c5?, 0xc002b52800?})
	/root/go/pkg/mod/github.com/cloudwego/netpoll@v0.6.0/connection_impl.go:373 +0x45
github.com/cloudwego/netpoll.(*connection).closeCallback(0x0?, 0x0?, 0x0?)
	/root/go/pkg/mod/github.com/cloudwego/netpoll@v0.6.0/connection_onevent.go:321 +0x21f
github.com/cloudwego/netpoll.(*connection).onClose(0xc00158d520?)
	/root/go/pkg/mod/github.com/cloudwego/netpoll@v0.6.0/connection_reactor.go:67 +0x105
github.com/cloudwego/netpoll.(*connection).Close(0x989680?)
	/root/go/pkg/mod/github.com/cloudwego/netpoll@v0.6.0/connection_impl.go:299 +0x13

0.6.0 之前的版本用了1年多(no feature)没有这个情况发生

To Reproduce
unknown

Additional context
run on almalinux:9.2 x86_64
有什么建议排查这个问题吗?

@joway
Copy link
Member

joway commented May 13, 2024

@gh73962 「最近偶尔」的意思是,最近你们升级过了吗还是什么?

@gh73962
Copy link
Author

gh73962 commented May 14, 2024

4月从0.5.1升级到0.6
然后开始出现这个问题,大概出现了3次

@joway
Copy link
Member

joway commented May 14, 2024

@gh73962 比较奇怪,内部至少也有相当大规模的实例在使用了,怀疑和使用姿势有关系。你们的websocket是自己实现的还是用的什么框架?

@gh73962
Copy link
Author

gh73962 commented May 15, 2024

用的github.com/gobwas/ws读写数据和帧控制, 接的v0.3.2版本那会ws example没有,都是自己实现的
@joway

@gh73962
Copy link
Author

gh73962 commented May 15, 2024

conn 用的github.com/orcaman/concurrent-map/v2存储的

@gh73962
Copy link
Author

gh73962 commented May 15, 2024

我先在close前检查一下IsActive()看看
现场pod stdout 就是截图那点内容, 其他没截取的就是配置信息什么的

@joway
Copy link
Member

joway commented May 16, 2024

@gh73962 ok。如果没有敏感信息的话,你把二进制和 coredump 后的文件可以发我邮箱,也能debug 。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants