ipc: ipc_icmsg: Can silently drop buffer if message is too big #45509
Labels
area: IPC
Inter-Process Communication
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
Stale
Description
Target platform: nrf5340dk_nrf5340
Application: Internal tests that uses ipc_service with ICMSG backend.
When we receive a message that cannot fit the callback buffer, in mbox_callback_process, when calling icmsg_buf_read we will get -ENOMEM. This error is not handled properly and the message is just silently dropped. I would an assertion on such an error or some error message at least. I would really help with finding the root of the issue.
Silently dropping the message is really the worst way of handling it when in development phase.
Such an error cannot be recovered in current ICMSG backend implementation and usually means that the user should alternate IPC_SERVICE_BACKEND_ICMSG_CB_BUF_SIZE setting for the application to work with the messages of the size requested.
To Reproduce
Run any application that uses IPC with ICMSG backend and try to pass more data than can fit in the CB buffer.
Expected behavior
Assertion should appear in the backend implementation.
Impact
This problem just slows down development when hit. In some situations the issue may be hard to be noticed while still influences the expected application flow.
Additional context
I don't like the fact that currently only -EAGAIN error from icmsg_buf_read is handled properly. Any other error including -ENOMEM would lead to silent message drop.
The text was updated successfully, but these errors were encountered: