Skip to content

Memory conflict: Multiple MIN ports access the same payloads_ring_buffer #48

@kinimodkoch

Description

@kinimodkoch

There seems to be a bug if you use multiple MIN ports at the same time with the TRANSPORT_PROTOCOL option enabled.

There is only one ring buffer defined in min.c:

// Where the payload data of the frame FIFO is stored
uint8_t payloads_ring_buffer[TRANSPORT_FIFO_MAX_FRAME_DATA];

While all other port related data - including access indices for this buffer - are available for each port in

struct min_context

The effect is that each port overwrites buffer data of the other ports.

I suggest that
uint8_t payloads_ring_buffer[TRANSPORT_FIFO_MAX_FRAME_DATA];
is moved to
struct min_context
so that each port has its own ring buffer.

The required changes are:

  1. min.h - Add ring buffer in
    image

  2. min.c - Remove old ring buffer
    image

  3. min.c - make sure the two usages of the old buffer access the new buffer instead
    image
    image

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