Christopher Collins created MYNEWT-749:
------------------------------------------

             Summary: BLE Host - Crash during key persistence if key-dist 
settings are 0
                 Key: MYNEWT-749
                 URL: https://issues.apache.org/jira/browse/MYNEWT-749
             Project: Mynewt
          Issue Type: Bug
          Components: Nimble
            Reporter: Christopher Collins


If BLE_SM_BONDING is enabled, but one of the the following settings is 0:
* BLE_SM_OUR_KEY_DIST
* BLE_SM_THEIR_KEY_DIST

then Mynewt crashes when pairing completes.  Here is an example stack trace:

{noformat}
Program received signal SIGTRAP, Trace/breakpoint trap.
__assert_func (file=file@entry=0x0, line=line@entry=0, func=func@entry=0x0, 
e=e@entry=0x0) at kernel/os/src/arch/cortex_m4/os_fault.c:137
137            asm("bkpt");
(gdb) whe
#0  __assert_func (file=file@entry=0x0, line=line@entry=0, func=func@entry=0x0, 
e=e@entry=0x0) at kernel/os/src/arch/cortex_m4/os_fault.c:137
#1  0x000181f8 in ble_store_persist_sec (obj_type=<optimized out>, 
value_sec=<optimized out>) at net/nimble/host/src/ble_store.c:92
#2  0x000177ca in ble_sm_persist_keys (proc=0x181f9 <ble_store_persist_sec+20>) 
at net/nimble/host/src/ble_sm.c:565
#3  ble_sm_process_result (conn_handle=conn_handle@entry=1, 
res=res@entry=0x2000165c <os_main_stack+3968>) at 
net/nimble/host/src/ble_sm.c:860
#4  0x0001792c in ble_sm_enc_event_rx (conn_handle=<optimized out>, 
evt_status=<optimized out>, encrypted=1) at net/nimble/host/src/ble_sm.c:1042
#5  0x00017942 in ble_sm_enc_change_rx (evt=evt@entry=0x20001698 
<os_main_stack+4028>) at net/nimble/host/src/ble_sm.c:1051
#6  0x000153be in ble_hs_hci_evt_encrypt_change (event_code=<optimized out>, 
data=0x20004c20 "\b\004", len=<optimized out>) at 
net/nimble/host/src/ble_hs_hci_evt.c:163
#7  0x00015438 in ble_hs_hci_evt_process (data=0x20004c20 "\b\004") at 
net/nimble/host/src/ble_hs_hci_evt.c:593
#8  0x00009016 in os_eventq_run (evq=<optimized out>) at 
kernel/os/src/os_eventq.c:172
#9  0x0000879e in main () at apps/bleprph/src/main.c:301
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to