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

Using buttons on m5stack all-clusters-app calls into Matter stack in a thread-unsafe way #15065

Closed
bzbarsky-apple opened this issue Feb 11, 2022 · 0 comments · Fixed by #15066

Comments

@bzbarsky-apple
Copy link
Contributor

Problem

Pushing the buttons on the m5stack running all-clusters-app to affect its state (e.g. Device->Light Bulb->Endpoint: 1->Cluster: OnOff -> Attribute: OnOff -> Toggle) can end up calling into the Matter stack (in this case calling emberAfWriteServerAttribute).

But it does this on the m5stack's UI thread, not on the Matter thread. So we can get racy behavior of the sort observed in #14596

Specifically, if I log pcTaskGetName(xTaskGetCurrentTaskHandle()) in MatterPostAttributeChangeCallback when I do the above toggle, I get "main". If I use an over-the-wire toggle command I get "CHIP".

Proposed Solution

Fix all-clusters-app to queue all of its Matter interaction to the Matter thread.

bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Feb 11, 2022
mspang pushed a commit to mspang/connectedhomeip that referenced this issue Feb 16, 2022
mspang added a commit that referenced this issue Feb 16, 2022
step0035 pushed a commit to hank820/connectedhomeip that referenced this issue Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant