Skip to content

BusDisplay _refresh_area does not respect busio locks #10569

@JamesWhitlock

Description

@JamesWhitlock

If the RTOS is premptive, BusDisplay has a race condition that may caused faults on shared buses. displayio_display_bus_begin_transaction may return false indicating that the lock could not be acquired. As _refresh_area does not respect the return value of displayio_display_bus_begin_transaction, _send_pixels will try to write to the bus without a lock. A guard is present in the code, but it is implemented in a way that is not thread safe.

// Can't acquire display bus; skip the rest of the data.
if (!displayio_display_bus_is_free(&self->bus)) {
return false;
}
displayio_display_bus_begin_transaction(&self->bus);
_send_pixels(self, (uint8_t *)buffer, subrectangle_size_bytes);
displayio_display_bus_end_transaction(&self->bus);

This is likely responsible for issue #10536.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions