Skip to content

[BUG] xEventGroupSetBits returns garbage if another high priority thread freed container #1142

@skotopes

Description

@skotopes

Describe the bug

https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/main/event_groups.c#L643

pxEventBits->uxEventBits used after xTaskResumeAll(); which will return garbage if another thread freed underlying container.

Target

  • Development board: any
  • Instruction Set Architecture: any
  • IDE and version: any
  • Toolchain and version: any

Host

  • Host OS: any
  • Version: any

To Reproduce

  • In high priority thread:
    • create event group
    • call xEventGroupWaitBits
    • delete event group
  • In low priority thread:
    • call xEventGroupSetBits
    • check return value

Expected behavior
Not returning garbage

Screenshots
none

Additional context
none

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions