Stack Smashing from the BT stack/ROM code

ThomasBit
Posts: 10
Joined: Thu Jun 09, 2022 11:05 am

Stack Smashing from the BT stack/ROM code

Postby ThomasBit » Mon Oct 31, 2022 1:50 pm

Hi

I get stack smashing from time to time. It is detected during task switch, so the call stack does no reveal that much.

I can see it is related to the BT stack and happens with in some hours of usage of the BT connection.

Stack smashing protect failure!
abort() was called at PC 0x4015dc53 on core 0


I am using Bluetooth Classic and LW (only one at a time) in my project.
This issue happens at random intervals. It could take 1h to happen or a day. It happens regardless of the Bluetooth connection status.

I am using esp-idf version 4.4.1 and I also tried version 4.4.2 with it crashes less often. But that could be a coincidences.

Decoding the backtrace gives the following:
MicrosoftTeams-image.png
MicrosoftTeams-image.png (31.12 KiB) Viewed 2491 times
I tried to store the task name before the task switch is completed.
This is what I got:
smashing with task name.png
smashing with task name.png (9.28 KiB) Viewed 2491 times
The btControll must be somewhere in the ROM code, so I have no way of debugging way this is happens.

Anyone has any suggestion on how to procede?

Best regards Thomas

ESP_Sprite
Posts: 9715
Joined: Thu Nov 26, 2015 4:08 am

Re: Stack Smashing from the BT stack/ROM code

Postby ESP_Sprite » Tue Nov 01, 2022 12:13 am

There seem to be two knobs in menuconfig to change the stack size allocated to the BT tasks: BT_BTC_TASK_STACK_SIZE and BT_BTU_TASK_STACK_SIZE. Perhaps increasing those helps?

ThomasBit
Posts: 10
Joined: Thu Jun 09, 2022 11:05 am

Re: Stack Smashing from the BT stack/ROM code

Postby ThomasBit » Tue Nov 01, 2022 9:52 am

Hi, yes. That i tried. We doubled the stack size with the same result. Eventually we get a stack smash

Thomas

Who is online

Users browsing this forum: aapee-jcv, Bing [Bot], Google [Bot] and 456 guests