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

Fixes an assertion failure (SOS 10) with Mesh.subscribe() and threading enabled #1652

Merged
merged 2 commits into from Dec 21, 2018

Conversation

Projects
None yet
3 participants
@avtolstoy
Copy link
Member

avtolstoy commented Dec 21, 2018

Problem

The following app will trigger an assertion failure in OpenThread:

SYSTEM_THREAD(ENABLED);
void setup() {
    Mesh.subscribe("test", [](const char* a, const char* b) {
    });
}

Solution

This is a side-effect of OpenThread upgrade. It was previously possible to manage multicast subscriptions even if OpenThread netif was down or not fully up. In order to resolve this issue, we are adding a check for otIp6IsEnabled() in OpenThreadNetif::mldMacFilterCb() that manages multicast subscription state between LwIP and OpenThread. If OpenThread netif is down, we will keep them stored and will synchronize the state once it comes up.

This PR also enables wiring UDP logs only in DEBUG_BUILD=y builds, otherwise they pollute the logging output too much.

Steps to Test

Flash the test application, confirm that the device does not go into SOS 10 (assertion failure).

Example App

N/A

References

  • [CH26693]

Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@avtolstoy avtolstoy requested a review from sergeuz Dec 21, 2018

@avtolstoy avtolstoy changed the title Fix/mesh subscribe assertion failure Fixes an assertion failure (SOS 10) with Mesh.subscribe() and threading enabled Dec 21, 2018

avtolstoy added some commits Dec 21, 2018

[network] openthread: fixes an assertion failure being triggered in O…
…penThread due to multicast address management while the OT netif is not fully up

@avtolstoy avtolstoy force-pushed the fix/mesh-subscribe-assertion-failure branch from 54c11cf to 810e58a Dec 21, 2018

@avtolstoy avtolstoy merged commit 91c2a19 into mesh-develop Dec 21, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@avtolstoy avtolstoy deleted the fix/mesh-subscribe-assertion-failure branch Dec 21, 2018

@m-mcgowan

This comment has been minimized.

Copy link
Contributor

m-mcgowan commented Dec 24, 2018

Does the subscription work as expected when OT comes up later?

@avtolstoy

This comment has been minimized.

Copy link
Member

avtolstoy commented Dec 25, 2018

If OpenThread netif is down, we will keep them stored and will synchronize the state once it comes up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment