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

Missing Thread stack lock can lead to crashes during ConnectToNetwork on some Thread devices during commissioning #33668

Closed
tcarmelveilleux opened this issue May 29, 2024 · 0 comments · Fixed by #33661
Assignees
Labels

Comments

@tcarmelveilleux
Copy link
Contributor

We observed that there can sometimes be, rarely but not never, crashes of Thread-based devices during commissioning that arises during OpenThread state change even logging on the Thread interface.

Example:

[29464765] <dbg> chip: LogV: [DL]OpenThread State Changed (Flags: 0x1100100d)
[29464978] <dbg> chip: LogV: [DL]   Device Role: DETACHED
[29465181] <dbg> chip: LogV: [DL]   Thread Unicast Addresses:
[29465401] <dbg> chip: LogV: [DL]        fdd0:876f:197f:0:b787:7e00:f5a1:8ed8/64 valid preferred
[29465727] <dbg> chip: LogV: [DL]        fe80::6886:bbc8:913c:e295/64 valid preferred
[29508887] <inf> chip: [DL]SRP Client was started, detected server: fdd0:876f:197f:0000:94f1:c03e:7c4d:4e9f
#### SRP registration complete.
[29508958] <dbg> chip: LogV: [DL]OpenThread State Changed (Flags: 0x00020d9d)
[29508992] <dbg> chip: LogV: [DL]   Device Role: CHILD
[29509019] <dbg> chip: LogV: [DL]   Network Name: NEST-PAN-2645
[29509152] <dbg> chip: LogV: [DL]   PAN Id: 0x2645
[29509346] <dbg> chip: LogV: [DL]   Extended PAN Id: 0x3E81DFCDA4579734
[29509590] <dbg> chip: LogV: [DL]   Channel: 13
[29509763] <dbg> chip: LogV: [DL]   Mesh Prefix: fdd0:876f:197f::/64
[29510001] <dbg> chip: LogV: [DL]   Partition Id: 0x837ED6E
[29510210] <dbg> chip: LogV: [DL]   Thread Unicast Addresses:
[29510430] <dbg> chip: LogV: [DL]        fd00:3105:a2e7:1:b622:7961:9ea3:6b27/64 valid preferred
#### UNEXPECTED RESTART BELOW, see timestamp returning to zero.
[00001191] <dbg> chip: LogV: [-]Starting pw_rpc server

During analysis, we found that this line calls a method with the following documentation:

/**
 * Log information related to a state change in the OpenThread stack.
 *
 * NB: This function *must* be called with the Thread stack lock held.
 */
void LogOpenThreadStateChange(otInstance * otInst, uint32_t flags)

However, at the call site, the Thread stack lock is missing.

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

Successfully merging a pull request may close this issue.

2 participants