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

[BUG] panic: runtime error: invalid memory address or nil pointer dereference [recovered] #3084

Closed
lizesheng2020 opened this issue Jan 23, 2025 · 2 comments
Labels
bug Categorizes issue or PR as related to a bug.

Comments

@lizesheng2020
Copy link

OpenIM Server Version

3.8.3

Operating System and CPU Architecture

Linux (AMD)

Deployment Method

Source Code Deployment

Bug Description and Steps to Reproduce

After upgrading to 3.8.3, sending messages by private chat occasionally leads to service panic.

go.uber.org/zap/zapcore.CheckWriteAction.OnWrite(0x6?, 0xc?, {0x0?, 0x0?, 0xc000142180?})
/root/go/pkg/mod/go.uber.org/[email protected]/zapcore/entry.go:198 +0x54
go.uber.org/zap/zapcore.(*CheckedEntry).Write(0xc000920820, {0xc000757508, 0x6, 0xc})
/root/go/pkg/mod/go.uber.org/[email protected]/zapcore/entry.go:264 +0x24e
go.uber.org/zap.(*SugaredLogger).log(0xc000074b28, 0x4, {0x15f50ae?, 0xc002190bf0?}, {0x0?, 0x46ec25?, 0x10?}, {0xc00079eb40, 0xc, 0xc})
/root/go/pkg/mod/go.uber.org/[email protected]/sugar.go:295 +0xec
go.uber.org/zap.(*SugaredLogger).Panicw(...)
/root/go/pkg/mod/go.uber.org/[email protected]/sugar.go:235
github.com/openimsdk/tools/log.(*ZapLogger).Panic(0xc00044a770, {0x17e0e90?, 0xc00090fce0?}, {0x15f50ae, 0x10}, {0x17cab00?, 0xc0006b2f90?}, {0xc000806b80, 0x4, 0x4})
/root/go/pkg/mod/github.com/openimsdk/[email protected]/log/zap.go:456 +0x1a5
github.com/openimsdk/tools/log.ZPanic(...)
/root/go/pkg/mod/github.com/openimsdk/[email protected]/log/zap.go:141
github.com/openimsdk/tools/mw.RpcServerInterceptor.func1()
/root/go/pkg/mod/github.com/openimsdk/[email protected]/mw/rpc_server_interceptor.go:33 +0x1c3
panic({0x13a6100?, 0x232d100?})
/usr/local/go/src/runtime/panic.go:785 +0x132
github.com/openimsdk/open-im-server/v3/pkg/common/convert.FriendsDB2Pb({0x17e0e90, 0xc00090fce0}, {0xc000185f00, 0xb, 0xc000303c20?}, 0xc00063b640)
/openim/open-im-server/pkg/common/convert/friend.go:75 +0x289
github.com/openimsdk/open-im-server/v3/internal/rpc/relation.(*friendServer).GetPaginationFriends(0xc000888ae0, {0x17e0e90, 0xc00090fce0}, 0xc00023b940)
/openim/open-im-server/internal/rpc/relation/friend.go:396 +0x12f
github.com/openimsdk/protocol/relation._Friend_GetPaginationFriends_Handler.func1({0x17e0e90?, 0xc00090fce0?}, {0x14cad40?, 0xc00023b940?})
/root/go/pkg/mod/github.com/openimsdk/[email protected]/relation/relation_grpc.pb.go:886 +0xce
github.com/openimsdk/open-im-server/v3/pkg/common/startrpc.Start[...].prommetricsUnaryInterceptor.func7({0x14cad40?, 0xc00023b940?}, 0xc0007d5120?, 0x0?)
/openim/open-im-server/pkg/common/startrpc/start.go:228 +0x58
google.golang.org/grpc.getChainUnaryHandler.func1({0x17e0e90, 0xc00090fce0}, {0x14cad40, 0xc00023b940})
/root/go/pkg/mod/google.golang.org/[email protected]/server.go:1211 +0xb2
github.com/openimsdk/tools/mw.RpcServerInterceptor({0x17e0e90, 0xc00090fa40}, {0x14cad40, 0xc00023b940}, 0xc0007d5120?, 0xc00023b980)
/root/go/pkg/mod/github.com/openimsdk/[email protected]/mw/rpc_server_interceptor.go:40 +0x2a6
google.golang.org/grpc.NewServer.chainUnaryServerInterceptors.chainUnaryInterceptors.func1({0x17e0e90, 0xc00090fa40}, {0x14cad40, 0xc00023b940}, 0xc0007d5120, 0x78?)
/root/go/pkg/mod/google.golang.org/[email protected]/server.go:1202 +0x85

Screenshots Link

No response

@lizesheng2020 lizesheng2020 added the bug Categorizes issue or PR as related to a bug. label Jan 23, 2025
@withchao
Copy link
Contributor

The reason is that a userID in the friend list does not exist in the user table. You can determine from the log before the crash that the friend information of that person has a problem.

@lizesheng2020
Copy link
Author

It's been screened out
I modified the user ID, but I didn't modify the data in the friends list.
But there seems to be no such problem in 3.8.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

2 participants