Skip to content

Possible infinite loop in dir fetch match  #17

Open
@felipeLeast

Description

@felipeLeast

Hi,

We are using lfs2 along with Mbed-OS and FlashIAP for the STM32G0 target. During our usage in development we've experienced no issue running the application. But after the deployment stage in a client, it occurred that power supply was cutoff from about 100 devices and all experienced the same outcome. They all got stuck on LittleFS initialization, more precisely in the lfs2_dir_fetchmatch while(true) loop, which is called by lfs2_mount. We can't understand exactly why this is happening, and we can't debug further. So far, with the help of GDB and OpenOCD, the only clue we could get is that in normal operation it should in some moment break in the following statement:

 if (!lfs2_tag_isvalid(tag)) {
    dir->erased = (lfs2_tag_type1(ptag) == LFS2_TYPE_CRC &&
            dir->off % lfs2->cfg->prog_size == 0);
    break;
}

We are not sure if the application is just getting stuck in an infinite loop or if some internal error are being thrown out and then the board stops.

I'm attaching a print from GDB server with its backtrace until the application reaches the watchdog timeout handler.
image

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