Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Heap corruption #277

@thekurtovic

Description

@thekurtovic

Tested with esp32-s3 on 5.3.2.241210.
If I run an example project with CONFIG_HEAP_POISONING_COMPREHENSIVE enabled, I consistently get crashes due to memory.
CORRUPT HEAP: Invalid data at 0x3fcbfaec. Expected 0xfefefefe got 0xfefefffe


According to the docs

If a call to heap_caps_malloc() or heap_caps_realloc() causes a crash because it was expected to find the pattern 0xFEFEFEFE in free memory and a different pattern was found, it indicates that the app has a use-after-free bug where it is writing to memory that has already been freed.


The code is basically the NimBLE_Client example with an onResult handler like so.

void onResult(const NimBLEAdvertisedDevice* adv) override {
        LOG_D("%s", advDevice.getAddress().toString().c_str());
        advDevice = *adv;
        pScan->stop();
        doConnect = true;
    }

Appears to have been introduced by 2151386.
I can upload an example project if it ends up not being reproducible for you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions