-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Stack Smashing protect Failure - getCharacteristics() #3015
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
Comments
|
No, this is not related to stack size. This is a bug in the BLE library that took me some time to track down (frustratingly it seems it is already fixed in another repo). The problem is that the function at https://github.com/espressif/arduino-esp32/blob/master/libraries/BLE/src/BLERemoteService.cpp#L159 allocates space for a single result on the stack:
But then passes a
Since it is called in a loop already, I assume simply setting |
@mwild1 definitely looks like a possible solution, feel free to submit a PR for this after testing. |
Yes, this seems it is that bug. I still forgot it is not fixed in arduino. |
Trying to connect:
https://forum.mysensors.org/topic/6951/nrf5-multi-sensor-board-12-14
Configured appropriate service and characteristics:
static BLEUUID serviceMPUUID("6e400001-b5a3-f393-e0a9-e50e24dcca9e");
static BLEUUID charMP_BMUUID("6e400004-b5a3-f393-e0a9-e50e24dcca9e");
then when getting characteristic pointer:
pMP_BMRemoteCharacteristic = pMPRemoteService->getCharacteristic(charMP_BMUUID);
faced "Stack Smashing protect Failure"
Looks to be solved by:
nkolban/esp32-snippets#863
"Hi,
probably its because you are using arduino library with bug (maybe more than 1), in this library its already fixed:
https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/BLERemoteService.cpp#L129"
effectively changing "uint16_t count = 1;" looks to be resolved, my program then works.
The text was updated successfully, but these errors were encountered: