Skip to content
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

ipc: ipc_icmsg: Can silently drop buffer if message is too big #45509

Closed
rakons opened this issue May 10, 2022 · 1 comment
Closed

ipc: ipc_icmsg: Can silently drop buffer if message is too big #45509

rakons opened this issue May 10, 2022 · 1 comment
Assignees
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

Comments

@rakons
Copy link
Collaborator

rakons commented May 10, 2022

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.

@rakons rakons added bug The issue is a bug, or the PR is fixing a bug area: IPC Inter-Process Communication labels May 10, 2022
@mbolivar-nordic mbolivar-nordic added the priority: low Low impact/importance bug label May 10, 2022
@github-actions
Copy link

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants