Commit 700c360
host: do not deinit ble_hs_timer while its event may be queued
ble_hs_stop_begin() sets ble_hs_enabled_state to STOPPING and then calls
ble_hs_timer_resched() on the next line. ble_hs_is_enabled() only returns true
for _ON, so ble_hs_timer_reset() takes the disabled branch and calls
ble_npl_callout_deinit(), which on the FreeRTOS port runs
ble_npl_event_deinit(&co->ev) and memsets the callout. That clears ev.fn.
If the timer had already expired, its ev is already on g_eventq_dflt. The
memset does not remove it from the queue, so nimble_port_run() dequeues it and
calls a NULL ev->fn. On Xtensa this is a CPU exception with pc 0 and the host
task is gone.
Removing the call leaks nothing: ble_hs_deinit() already ends with
ble_npl_callout_deinit(&ble_hs_timer), which runs after the host has stopped
and the queue is drained. Both apache/mynewt-nimble and espressif/esp-nimble
call only ble_npl_callout_stop() here.
Fixes #11841 parent 2c487b7 commit 700c360
1 file changed
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
447 | | - | |
448 | 447 | | |
449 | 448 | | |
450 | 449 | | |
| |||
0 commit comments