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

Crash when resolving node's IPs if it's discovered on more than one interface #17288

Closed
bzbarsky-apple opened this issue Apr 12, 2022 · 0 comments · Fixed by #17333
Closed

Crash when resolving node's IPs if it's discovered on more than one interface #17288

bzbarsky-apple opened this issue Apr 12, 2022 · 0 comments · Fixed by #17333

Comments

@bzbarsky-apple
Copy link
Contributor

Problem

Steps to reproduce:

  1. Check out SHA 2e33dec or anything else that has the fix for [Darwin] Keep resolving ips even when the first mdns result has been … #17246 in it.
  2. Compile chip-tool and chip-all-clusters-app:
    scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug/standalone chip_config_network_layer_ble=false
    scripts/examples/gn_build_example.sh examples/chip-tool out/debug/standalone/
    
  3. rm /tm/chip*
  4. Run ./out/debug/standalone/chip-all-clusters-app
  5. Run ./out/debug/standalone/chip-tool pairing onnetwork 17 20202021

Expected results: Commissioning is fine.
Actual results: chip-tool crashes.

The problem is that we are ending up resolving the operational node on multiple interfaces (in my case loopback and my wifi interfaces) and after the change in #17246 we end up calling back into HandleNodeIdResolve multiple times. But the first time we call it we do proxy->Release() and after that proxy can be a dead object, and the second time we call into that code we try to make a virtual call on it, jump into lala-land (well, in my case can't even read the vtable) and crash.

Proposed Solution

Sort out what the actual invariants are supposed to be here and make sure they are not violated.

I assume CI does not hit this because we advertise loopback-only in CI.

@vivien-apple @Damian-Nordic @andreilitvin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant