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] invalid memory address or nil pointer dereference #2453

Closed
cipchk opened this issue Jul 28, 2024 · 4 comments
Closed

[BUG] invalid memory address or nil pointer dereference #2453

cipchk opened this issue Jul 28, 2024 · 4 comments
Assignees
Labels
bug Categorizes issue or PR as related to a bug.

Comments

@cipchk
Copy link

cipchk commented Jul 28, 2024

OpenIM Server Version

3.7

Operating System and CPU Architecture

Linux (AMD)

Deployment Method

Docker Deployment

Bug Description and Steps to Reproduce

请求 api/msg/search_msg 时会导致 chat server 奔溃:

请求体:

{
    "sessionType": 1,
    "contentType": 0,
    "recvID": "",
    "sendID": "",
    "pagination": {
        "pageNumber": 1,
        "showNumber": 10
    }
}

异常日志:

[signal SIGSEGV: segmentation violation code=0x1 addr=0x88 pc=0x1233204]
goroutine 1180 [running]:
github.com/openimsdk/open-im-server/v3/internal/rpc/msg.(*msgServer).SearchMessage(0xc00036ef80, {0x1923598, 0xc0017e27e0}, 0x10?)
	/openim-server/internal/rpc/msg/sync_msg.go:129 +0x244
github.com/openimsdk/protocol/msg._Msg_SearchMessage_Handler.func1({0x1923598, 0xc0017e27e0}, {0x15f1b20?, 0xc00030e620})
	/go/pkg/mod/github.com/openimsdk/protocol@v0.0.65/msg/msg.pb.go:5198 +0x75
github.com/openimsdk/tools/mw.RpcServerInterceptor({0x1923598, 0xc0017e26f0}, {0x15f1b20, 0xc00030e620}, 0xc001274d70?, 0xc0011bd470)
	/go/pkg/mod/github.com/openimsdk/tools@v0.0.49-alpha.19/mw/rpc_server_interceptor.go:59 +0x276
google.golang.org/grpc.getChainUnaryHandler.func1({0x1923598, 0xc0017e26f0}, {0x15f1b20, 0xc00030e620})
	/go/pkg/mod/google.golang.org/grpc@v1.62.1/server.go:1203 +0xb2
github.com/grpc-ecosystem/go-grpc-prometheus.(*ServerMetrics).UnaryServerInterceptor.func1({0x1923598, 0xc0017e26f0}, {0x15f1b20, 0xc00030e620}, 0xc00022efc0?, 0xc00102eb80)
	/go/pkg/mod/github.com/grpc-ecosystem/go-grpc-prometheus@v1.2.0/server_metrics.go:107 +0x83
google.golang.org/grpc.NewServer.chainUnaryServerInterceptors.chainUnaryInterceptors.func1({0x1923598, 0xc0017e26f0}, {0x15f1b20, 0xc00030e620}, 0xc001993998?, 0x146a480?)
	/go/pkg/mod/google.golang.org/grpc@v1.62.1/server.go:1194 +0x85
github.com/openimsdk/protocol/msg._Msg_SearchMessage_Handler({0x168d540?, 0xc00036ef80}, {0x1923598, 0xc0017e26f0}, 0xc00100ae00, 0xc0004a9000)
	/go/pkg/mod/github.com/openimsdk/protocol@v0.0.65/msg/msg.pb.go:5200 +0x135
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0004b5200, {0x1923598, 0xc0017e2630}, {0x192c1c0, 0xc0004a36c0}, 0xc0011baa20, 0xc0003478c0, 0x24bd310, 0x0)
	/go/pkg/mod/google.golang.org/grpc@v1.62.1/server.go:1386 +0xe23
google.golang.org/grpc.(*Server).handleStream(0xc0004b5200, {0x192c1c0, 0xc0004a36c0}, 0xc0011baa20)
	/go/pkg/mod/google.golang.org/grpc@v1.62.1/server.go:1797 +0x100c
google.golang.org/grpc.(*Server).serveStreams.func2.1()
	/go/pkg/mod/google.golang.org/grpc@v1.62.1/server.go:1027 +0x8b
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 348
	/go/pkg/mod/google.golang.org/grpc@v1.62.1/server.go:1038 +0x135

Screenshots Link

No response

@cipchk cipchk added the bug Categorizes issue or PR as related to a bug. label Jul 28, 2024
@withchao
Copy link
Contributor

Update to the latest 3.7

@cipchk
Copy link
Author

cipchk commented Jul 31, 2024

我使用的是最新版本了,这个问题的根源还是因为参数 recvID 不允许为空字符,一但空字符 IM 服务器就崩了。

@kubbot
Copy link
Contributor

kubbot commented Jul 31, 2024

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I am using the latest version. The root cause of this problem is that the parameter recvID does not allow null characters. Once the null character is used, the IM server will crash.

@withchao
Copy link
Contributor

It is recommended to upgrade to v3.8. We have optimized the search and fixed this problem.

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

3 participants