Skip to content

Segmentation fault happens frequently when server send requests to client #113

@WWaynee

Description

@WWaynee

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:

if (unlikely(session->client_info_.sslot_free_vec_.size() == 0)) {

I print the variable that the size() uses. The access of size_t type variable free_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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions