commaai / msgq

MSGQ: A lock free single producer multi consumer message queue
184 stars 251 forks source link

visionipc: fix assert in getAvailableStreams #562

Closed deanlee closed 4 months ago

deanlee commented 11 months ago

the vipc client still can connect to the ipc path even if the camerad is not running. This could be due to the camerad not shutting down properly and the ipc path not being removed.

ipc_sendrecv_with_fds will returns -1 In this case. this causes the following assertion to fail.

ui: cereal/visionipc/visionipc_client.cc:133: static std::set VisionIpcClient::getAvailableStreams(const std::string &, bool): Assertion `(r >= 0) && (r % sizeof(VisionStreamType) == 0)' failed.

This bug can be reproduced by clicking “preview driver camera" button quickly and continuously in the UI interface.

deanlee commented 10 months ago

VipcClient::recv and vipcClient::connect have similar problems, e.g. vipcClient:connect will returns true even if an attempt is made to connect to a non-existent stream type.considering use another pr to fix these issues.

@adeebshihadeh : In addition, vipc currently only uses yuv type buffs, and rgb seems to have been deprecated. Can this part of the code be deleted? This can make vipc's code much cleaner.

adeebshihadeh commented 10 months ago

Doesn't the map still use it?

deanlee commented 10 months ago

the map_render creates vipc buffer as yuv. Looks like a bug, though it probably doesn't actually affect the result. https://github.com/commaai/openpilot/blob/5f045176775c8c2cdd7f85e7229f78cf26f0c013/selfdrive/navd/map_renderer.cc#L92

deanlee commented 4 months ago

closed , moved to https://github.com/commaai/msgq/pull/624