-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Segment fault at gpr_mpscq_pop_and_check_end #19923
Comments
Probably related to #14310 |
Since this is from rust, it is probably going to be hard to track it here especially without a way to reproduce this. |
I think it's related to #17786, which also provides a method to reproduce the core dump (and using c++). |
@BusyJay If it's the same bug, can you report your findings on that bug? Let's track this there. |
I have figured this bug out. #19531 In short, it is caused by calling the recv_message_ready completion function in advance in some rare cases. So scheduling closure rather than running it can solve this problem. Let me try to explain in detail. At first, in thread T1 grpc_call_start_batch is called after receiving msg. And then a lot of things to do such as scheduling some closures in exec_ctx closure_list and running it in flush function in exec_ctx destructor. After running T1 sleep and T2 go to work. Next, combiner pop this closure out and run T2 sleep and T1 go to work. T1 now run Soon after, next As before, T2 wake up and call
After popping this node out of queue, tail become That's why the bug happens. |
Cool, thanks @gengliqi ! |
Closing issue since a PR has been made to address it |
What version of gRPC and what language are you using?
v1.17.2, rust wrapper of grpc c core.
What operating system (Linux, Windows,...) and version?
Linux 3.10
What runtime / compiler are you using (e.g. python version or version of gcc)
grpcio, which wraps grpc c core in rust.
What did you do?
Nothing special, just a long running service.
What did you see instead?
stack trace:
The text was updated successfully, but these errors were encountered: