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

Getting unexpected string in grpc::Status error_message after broken Connection #36623

Open
Bernd-Tinkl-ASCONA opened this issue May 15, 2024 · 1 comment

Comments

@Bernd-Tinkl-ASCONA
Copy link

What version of gRPC and what language are you using?

grpc v1.46 with c++

What operating system (Linux, Windows,...) and version?

windows 11

What runtime / compiler are you using (e.g. python version or version of gcc)

Visual Studio 2019 with platform toolset v140

What did you do?

I startet my client and server. I implemented a simple call which blocks for 5 minutes using a sleep() in the Server. When I see the outgoing and incomming call in the Server, I kill the Server.
After that the Call in the Server returns and Status is set tu UNKNOWN, but the error text contains an String which seems to be currupt.

image

Code fragment in the Server:
image

The makro TRACE_GRPC_CLIENT_RESULT_CYCLIC_EX prints out an error if the Status is not ok using folllowing code

image

image

What did you expect to see?

The error_message should contain a well formed string.

What did you see instead?

image

Anything else we should know about your project / environment?

Is there any better way to detect and handle a broken connection? Up to now we test the returned grpc::Status of the called functions.

@drfloob
Copy link
Member

drfloob commented May 21, 2024

I suspect memory corruption somewhere in your application. Consider building your binary with /fsanitize=address and see if that's more informative. This sort of thing is hard for others to debug without a minimal application that reproduces the problem, preferably uploaded to github somewhere. Often, when trying to create a min-repro, you'll find the bug that's causing your problem.

Also, v1.46 is 2 years old, please consider using a more up-to-date library.

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

No branches or pull requests

2 participants