Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible infinite loop in dir fetch match #17

Open
felipeLeast opened this issue Mar 4, 2021 · 0 comments
Open

Possible infinite loop in dir fetch match #17

felipeLeast opened this issue Mar 4, 2021 · 0 comments

Comments

@felipeLeast
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant