mynewt-nimble icon indicating copy to clipboard operation
mynewt-nimble copied to clipboard

Crash when a lot of data needs to be proxied

Open InfiniteYuan opened this issue 2 years ago • 1 comments

Problem Describing

Can't alloc os_mbuf when a lot of data needs to be proxied in BLE-MESH, so om is null to cause crash(assert).

static int proxy_send(uint16_t conn_handle, const void *data, uint16_t len) {
    ···
    BT_DBG("%u bytes: %s", len, bt_hex(data, len));
    om = ble_hs_mbuf_from_flat(data, len);
    assert(om);
    err = ble_gatts_notify_custom(conn_handle, svc_handles.proxy_data_out_h, om);
    notify_complete();
    ···
}

Related

These are also handled with assert: pb_gatt_srv.c#L410-L411 and proxy_srv.c#L876-L877. We should reconsider how to deal with it.

InfiniteYuan avatar Mar 24 '22 15:03 InfiniteYuan

@michal-narajowski Please help look into this issue. Thx very much.

InfiniteYuan avatar Mar 31 '22 02:03 InfiniteYuan