Stumped. Stack smashing protect failure
Posted: Tue Oct 01, 2024 2:20 am
I am totally stumped as to how to track this down.
The only time it happens is when I save a value every 30 seconds using preferences.h.
I basically read data from my CAN network and every 30 seconds call dothis. After a while I get stack smashing but I am totally stumped since it doesnt really say much.
this is the error in PlatformIO:
Then I run this to get some info on it:
and then I get this which doesnt mean anything to me:
I am totally stumped. This is a simplified version of what I'm doing. But if I dont save using preferences.h (I even tried littlefs which crashes also) then it doesnt give me any stack smashing.
The only time it happens is when I save a value every 30 seconds using preferences.h.
Code: Select all
void dothis(double value)
{
// Save the odometer value using Preferences
preferences.begin("gps", false); // Open preferences in read-write mode
preferences.putDouble("distance", value); // Store odometer value
preferences.end(); // Close preferences
}
this is the error in PlatformIO:
Code: Select all
abort() was called at PC 0x4012202b on core 1
Backtrace: 0x40083dc1:0x3ffbf59c |<-CORRUPTED
Then I run this to get some info on it:
Code: Select all
./xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-addr2line -pfiaC -e firmware.elf 0x40083e1d 0x3ffbf56c
Code: Select all
0x40083e1d: panic_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/panic.c:408
0x3ffbf56c: port_IntStack at ??:?