Skip to content

base64 encode resets esp32 on certain strings #827

Closed
@euquiq

Description

@euquiq

Hi there!

I think I found a bug: Sometimes my DOIT ESP32 DEVKIT V1 starts resetting itself when encoding a string by using the base64 library. .

When trying to encode certain quantity of characters, my ESP32 will give the following error:

CORRUPT HEAP: Bad tail at 0x3ffc9aac. Expected 0xbaad5678 got 0xbaad5600
 assertion "head != NULL" failed: file "/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/heap/./multi_heap_poisoning.c", line 199, function: multi_heap_free
 abort() was called at PC 0x400d2af3 on core 1
 
 Backtrace: 0x400870ac:0x3ffcee50 0x400871ab:0x3ffcee70 0x400d2af3:0x3ffcee90 0x40086dd9:0x3ffceec0 0x40082796:0x3ffceee0 0x40082d19:0x3ffcef00 0x4000bec7:0x3ffcef20 0x400d0905:0x3ffcef40 0x400d0931:0x3ffcef80 0x400d0880:0x3ffcefa0 0x400dc84f:0x3ffceff0
 
 Rebooting...

I can reproduce the error with the following code:

#include <base64.h>
base64 b;

void setup()
{
	Serial.begin(115200);
	Serial.println("12345678 = " + b.encode("12345678"));
	delay(1000);
	Serial.println("123456 = " + b.encode("123456"));
	delay(1000);
	Serial.println("1234567 = " + b.encode("1234567")); //THIS LINE WILL CRASH ESP32
}

void loop()
{

}

I also tried this simple code in two other ESP32 boards, the geekworm EASY KIT ESP32-01 (revision 0 silicon) and another one with revision 1 silicon, which says ESP32_Core_board-V2.

Same behavior in the three of them.

Regards,

Enrique

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions