espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.38k stars 7.22k forks source link

Insufficient handling of Bluetooth GATT memory problems (IDFGH-3798) #5714

Open itmm opened 4 years ago

itmm commented 4 years ago

Environment

Problem Description

in the bluetooth GATT implementation components/bt/host/bluedroid/bta/gatt/bta_gatts_api.c nothing happens, if a memory allocation fails. Other files may also have the same problem.

Expected Behavior

generate an error response to the app or at least log an error

Actual Behavior

nothing happens; from the application side the bluetooth stack froze as neither a success nor a failure message arrives

Steps to reproduce

generate a BLE service with more that 500 characteristics

Alvin1Zhang commented 4 years ago

Thanks for reporting, we will look into.

WCCWCC commented 4 years ago

Hi, @itmm

itmm commented 4 years ago

Hi @WCCWCC ,

a test program is available at

https://github.com/itmm/esp-btle-chars

You can configure the number of characteristics using menuconfig (entry BLE Characteristics). With the default of 200 you should get a completion message on the console. With 500 no additional event is logged an also no completion message is written.

Kind regards, Timm.