-
Notifications
You must be signed in to change notification settings - Fork 139
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
Segmentation fault happens frequently when server send requests to client #113
Comments
Interesting. There is a test that stresses sending requests from within request handlers: |
Here is a small exmaple(C++20) that has the posibility of segfault, sometimes it can run successfully. And the cause is still the variable Here is my test code.
test_client.cc
test_server.cc
|
It seems like something wrong happens when enqueuing requests on the server side, but the session is already connected. That's strange. |
I am currently writing a test, client sends requests to server and after some asynchronous processing the server sends the result back to the client, which is not directly enqueuing a response in server thread. So I need to make server connect to client's rpc, but something strange happens when server sends requests to client that causes segmentation fault.
The error is occurred in the enqueue_request function, on this line:
eRPC/src/rpc_impl/rpc_req.cc
Line 27 in 82b31fc
I print the variable that the size() uses. The access of
size_t
type variablefree_index_
caused segmentation fault.https://github.com/erpc-io/eRPC/blob/82b31fc4df53dd7a2aff1fc6ad1a3888c5c7b6ac/src/util/fixed_vector.h#L36C3-L36C10
I don't know the real cause of the problem. Does the startup sequence of client and server matter? I start the server first and then client, and I use a event_loop in a while to check the count of connected session to until they are fully and successfully connected.
The text was updated successfully, but these errors were encountered: