Skip to content

Race condition in the LWIP RTOS example #7

@LinuxJedi

Description

@LinuxJedi

In the LWIP RTOS example, the ethernetif.c file has low_level_input run in one thread and ethernetif_input run in another. This is fine for the example, but if you wish to do anything more complex, the do loop in ethernetif_input can read half-written pbufs.

I've found removing the do loop from ethernetif_input so that it is only executed once per queued message appears to resolve this. Not sure if that is the correct solution, maybe a mutex is needed?

I've had similar issues with the non-RTOS examples when pushing more than a basic echo. I haven't dug into the cause there, but I assume an interrupt half-way through the ethernetif_input loop to run low_level_input will do it?

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